KBD

Keith Devens .com

Saturday, July 4, 2009 Flag waving
All I want is to have my peace of mind. – Boston (Peace of Mind)
← 410: GoneDynamic languages and the .NET VM →

Daily link icon Thursday, March 27, 2003

Strategies for learning new languages

Via LtU, Strategies for learning new languages

When you start to learn any new language, you need to first look at the language from almost a linguistic perspective. Is it strongly typed or weakly typed? Is it statically typed or dynamically typed? Does it do garbage collection? What kind? Does it have class-based or prototype-based OO? What type of "higher order" features does it have? (Can I pass functions around as values easily?) What are its value/reference semantics?

Here's one little example of the type of hints you get from looking at a language. You look at Perl, and notice it needs to have different operators for string concatenation and numeric addition. It shows you it's has weak dynamic typing. On the other hand, you look at Ruby, and you have to explicitly convert a numeric string into a number if you want to use it as such. It has a little different mindset, even though things might look similar on the face of it. Do variables auto-vivify? Perl, yes, Python, no. Etc. etc.

So, when you know enough languages, you start to look for little things that key you off to how they work. When I started with Python, I was confused by its scoping, and then I noticed they had a "global" keyword, and I was able to immediately understand that its scoping model was similar to PHP. They've since added lexical scoping.

I've always thought C's approach to reference/value semantics is interesting to look at. Everything is passed by value, but then, some values can be pointers. Also, C doesn't have closures, but then again, all functions are statically declared in the global scope.

The problem arises when a language uses features you're not used to. While I think I understand what's going on, I'm not totally comfortable yet with Python's generators. I've only recently got my brain wrapped around multi-methods, or multiple dispatch, and with either of these features I'd really have to write some code that uses them before I could claim I really understand what is going on. I might understand conceptually how Lisp's macros work, but I've never used them. Right now I'd probably be a terrible Lisp programmer. Don't even ask me about continuations - I wish I grokked them.

One of the messages in the thread had this:

Until you've actually written at least several hundred lines of code in a language you effectively know nothing about it.

That's very true. And moreover, if you don't use a language for awhile, things don't stick. It'd take me a little while to get back up to speed with Python, and even Perl again, since I haven't used them in awhile. Our brain seems to treat programming languages very similarly to how it treats natural languages. You have to use a language for a long time to really become fluent, learn the culture, learn the idioms, for computer languages, to learn the class library, etc. etc.

← 410: GoneDynamic languages and the .NET VM →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2009
SunMonTueWedThuFriSat
 1234
567891011
12131415161718
19202122232425
262728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 3 posts

Recent comments XML

new⇒Wizard's First Rule

> while it is cheesy to some​extent, I actually found it to be​pretty enjoy...

Keith: Jul 3, 6:33pm

I hate Norton Antivirus

I bought Norton 2009 and it is not​installing on my computer!!!
It​seems l...

o'neil: Jun 30, 11:44am

Generated in about 0.205s.

(Used 8 db queries)