Scott Hanselman

The (Programming) Language Explosion

April 20, 2007 Comment on this post [33] Posted in Musings | Programming
Sponsored By

I couldn't be prouder. My little sixteen-month-old Z said "Mommy Bathing in the Water" while my wife was in the shower. He said it with American Sign Language (ASL), a language we've been teaching Z. I think it's a big deal because he independently strung these words together, one after another, and made a declaration.

The Language Explosion has begun with my little man. He's starting to speak more and more (verbally) and my wife is continuing to (try) to speak to him in her language. When he starts school he'll (hopefully) be in an Spanish immersion program, so he'll theoretically have four languages going forward. (ASL qualifies as a foreign language in college and has a different sentence structure than English.)

The "language events" of the last few weeks got me thinking about choosing Programming Languages.

(No, not for Z, hopefully he'll be much more well-rounded than I, and will NOT be a programmer.)

There are many folks who study linguistic learning in young people and the conventional wisdom says that learning between 4 and 5 languages is quite reasonable, even easy, if some basic rules are followed. Things like one language per care-giver, consistency, etc.

If a theoretical child (not mine) was to get "good language coverage" from a population perspective - trying to pick a set of languages that would enable the child to communicate with the largest number of people - they might want to learn English, Chinese, Spanish, Hindi, Russian and maybe Arabic. If a theoretical person wanted to learn a set of programming languages that would enable them to write code today with a good chance of getting a job they might want to learn Java, C, C#, PHP, Ruby, maybe Javascript and possibly Python.

However, if a theoretical child wanted to get a good set of solid languages that would enable them to more easily learn other languages, they might want to learn English and Spanish (Indo-European Family), Chinese (Sino-Tibetan Family), Arabic (Afro-Asiatic Family), Swahili (Niger-Congo Family) and maybe Japanese or Turkish (Altaic Family). These languages would give the child very broad exposure to different structures and tones.

What programming languages would a new Student of Programming want to learn in order to get good coverage and enable them, at an early age (or stage in their career) to not only learn other languages but also solve problems in non-traditional ways.

An parallel could be drawn between an older life-long English speaker having trouble learning a language because the sentence structure of the new language is so very different from English, or a tonal language like Mandarin where the English speaker's brain simply can't hear the tones.

Studies have show that children who are exposed to tonal languages at some length, like Mandarin, before their second year can lay the pathways to recognize and distinguish between "similar" tones years later. But they have to hear the tones early in life.

What programming languages should a New Programmer experience early so that they might be more able to "hear the tones later" when a new languages comes along? What language should a new programmer be exposed to first?

Should we make selections from the major Programming Language "families"?

  • Imperative - statements that contain a sequence of commands
    • Fortran, C, Pascal, VB, LISP
    • Object-Oriented
      • Smalltalk, Java, C#, Ruby, LISP
  • Declarative - "It's like this, figure it out"
    • XSLT, SQL (kinda)
  • Logical - describe some theoretical state and the steps it implies, and work backwards to solve
    • Prolog
  • Functional - Keep it stateless and create functions, often recursive
    • ML, Haskell, Common LISP

Should young (or new) programmers be taught many languages and philosophies, or just ones that will get them a job? Should we optimize for language coverage or language diversity?

If there are benefits in teaching young children Chinese because of the language's complexity and tonal qualities, is there a benefit in teaching new programmers Lisp for the (mostly) same reasons?

Speaking only to Basic's comparative "linguistic" value, to be clear. if Lisp is comparable to Chinese then should Basic considered on par with English Slang?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

New Release of Notepad2 - Updated (again) with Ruby Support

April 20, 2007 Comment on this post [18] Posted in Programming | Tools
Sponsored By

I'm a big fan of Notepad2. I have used a ton of text editors, but I keep coming back to Notepad2. Partially because it's one better than Notepad, but mostly just because it feels very natural. Notepad++ is nice, but still, I'm drawn to Notepad2.

After nearly three years of silence, Florian Balmer of Flo's Freeware has updated Notepad2! You can get the latest version here directly from Flo, as well as the C++ source.

There's some cool changes in this version, including the removal of settings from the Registry. They're stored in a .ini file now, which makes Notepad2 more appropriate as a Portable App.

Here's a few of the changes that I'm enjoying (full list of changes here):

  • "Insert HTML/XML Tag" helper tool (Alt+X)
  • Rectangular selection (Alt+Mouse)
  • BSD License for Notepad2 and source code (see License.txt)
  • Multiline find and replace
  • Find and replace dialogs are now modeless
  • File change notification (optional)
  • "Duplicate Selection" command (Alt+D)

And dozens and dozens more small improvements. Let's all congratulate Flo on his triumphant return!

Unfortunately, Ruby as a syntax highlighting scheme still isn't included in this distribution, and while I want the new Notepad2, I can't give up the Ruby support added before by Wesner. So, I took the source of the New Notepad2 used Beyond Compare and Rubyified it, again. If you want to build it yourself, you have to get the source for Scintilla first, then modify it to change some Lexer linking stuff (see the Notepad2 readme.txt).

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

FIX: Missing Thumbnails for Videos (WMV, AVI, MPG) in Windows Explorer

April 19, 2007 Comment on this post [9] Posted in Tools
Sponsored By

Some time last months all the Thumbnails in Explorer disappeared for me. It might have coincided with me installing VLC Player on Vista. Either way, it sucked because I had family photos with thumbnails next to videos taken with the same camera with no thumbnails. It's no fun to lose functionality.

While poking around in the Registry trying to fix this issue, I noticed that Thumbnails for AVI files worked, while no others did. The only difference with that extension was this registry key:

[HKEY_CLASSES_ROOT\.avi\ShellEx\
{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{c5a40261-cd64-4ccf-84cb-c394da41d590}"

So, I made a registry file with this entry for each extension I wanted thumbnails for. Merged it into the registry and, lo and behold, I have thumbnails again. The file is below.

As an aside, while I was trying to fix this, I also picked up a codec pack called the CCCP (Combined Community Codec Pack) and noticed while running through its settings that it had an option to "fix perceived types." I wish I'd known this last week when I fixed THAT problem with missing Media Center Thumbnails.

Switching over to the CCCP also had the added benefit of letting me watch my MP4 encoded PSP (Playstation Portable) files in Windows Media Player, and added Thumbnails in Explorer for MP4s as well via their settings dialog. Once I got MP4 working I exported those settings and appended to them to this file.

Also, by the way, did you know that the new location of the Explorer Thumbnail Cache is down here?

C:\Users\Scott\AppData\Local\Microsoft\Windows\Explorer>dir
Volume in drive C is 70 GIGS SYSTEM
Volume Serial Number is 98A2-64B2

Directory of C:\Users\Scott\AppData\Local\Microsoft\Windows\Explorer

04/18/2007 10:29 PM <DIR> .
04/18/2007 10:29 PM <DIR> ..
04/18/2007 10:29 PM <DIR> ThumbCacheToDelete
04/18/2007 10:29 PM 24 thumbcache_1024.db
04/18/2007 10:29 PM 1,048,576 thumbcache_256.db
04/18/2007 10:29 PM 24 thumbcache_32.db
04/18/2007 10:29 PM 1,048,576 thumbcache_96.db
04/18/2007 10:29 PM 4,064 thumbcache_idx.db
04/18/2007 10:29 PM 24 thumbcache_sr.db
6 File(s) 2,101,288 bytes
3 Dir(s) 21,871,742,976 bytes free

Crazy new stuff this Vista, eh?

No warranty or support, express or implied. YMMV. Backup your Registry before you do this and please don't come to me if your world is destroyed. You have been warned.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Network Connections: Using Verizon Broadband Access Wireless Internet without VZAccess Manager

April 18, 2007 Comment on this post [4] Posted in Musings | Tools
Sponsored By

I was talking to Juval Löwy today about wireless broadband access. We both use Verizon's VZAccess Rev0 network for Nationwide Wireless Broadband. I get decent results and have blogged about the service before, last year.

UPDATE: Some folks have reported that the Username and Password aren't needed. Some have reported it IS needed. Your Mileage May Vary.

One thing that irritates me and Juval is the VZAccess Manager application that Verizon provides to access the service. Fortunately , Juval figured out how to connect to Verizon's Wireless Broadband using Network Connections in Vista bypassing the VZAccess Manager. As Juval doesn't have a blog, I'm posting his instructions here with his blessing.

First, you need to manually create a new connection.

  1. Open VZAccess Manager, go to Help, about.
  2. Copy the phone number:

  1. In the Windows Control Panel, bring up the Network and Sharing Center.
  2. Click Set up a Connection or Network.

 

  1. Click Set up a dial-up connection

  1. Select the modem:

 

  1. Enter #777 for the number. For user name, plug your number from Step 2  plus "@vzw3com.com." For password use "vzw" (all lower case). Be sure to name the connection.

  1. Connect and run. Select public location for network type you are all set.

You can now use the connection without VZA.

Thanks Juval!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Automating Adding iTunes Album Art to MP3 ID3 tags from the Command Line in C#

April 18, 2007 Comment on this post [6] Posted in Podcast | Programming | Tools
Sponsored By

It's been bugging me that the album art for my podcast doesn't appear in Windows Media Player, iTunes, or in iPods.

I assumed, incorrectly, that this was an iTunes meta-tagging problem, but then I realized that this was an MP3 problem, not an AAC or WMA problem, although both formats support adding art to the file.

The ID3 format is pretty extensive. You can put a great deal of meta-information into an MP3. The Attached picture or APIC "Frame" in ID lets you embed in PNGs or JPGs, along with their respective mime/types. 

I googled around over lunch and couldn't find a simple, free, command-line program that would let me easily add pictures to not only the existing MP3s for our show on the server-side, but also could be integrated into our existing audio file production workflow.

I ended up finding this great little library from 2004 called the tagnetlib project source was offered for free from the Nancy Street Blog. I converted it to .NET 2.0.

Now, note that the tagnetlib project is currently deprecated in lieu of the NTag product that Greg Keogh started in 2005 and released in May of 2006. The NTag project is much more interesting and appears to be well thought-out. He intends to support WMA and OGG and turn the project info a "Meta Tag Tagging" project that would support all popular audio formats.

I used the Tagnetlib because it was quick, incredibly easy, and I only had my lunch hour to do this. However, he's pretty clear that Tagnetlib is, again, totally deprecated and unsupported. Perhaps one day I'll get to spend more time with the NTag library. For now, my little hack is used like this:

embedid3.exe file.mp3 file.jpg [optionally "mime/type", default is "image/jpeg"]

Disclaimer: This app does one thing. It adds images to MP3 files that don't have them. It has no error handling or checking and it doesn't care about you or your MP3 collection. Don't even think about running it over your collection or using it for any purpose. It's useful for one thing. It's useful to me. Your Mileage WILL Vary. You have been warned.

Do make sure you checkout NTag and what Greg's working on over there. It's really pretty fun code to read.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.