KBD

Keith Devens .com

Thursday, January 8, 2009 Flag waving
... we can never use experience to prove the inductive principle without begging the question. Thus we must... forgo all justification... – Bertrand Russell ("On Induction" in The Problems of Philosophy)
← 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)
:

January 2009
SunMonTueWedThuFriSat
 123
45678910
11121314151617
18192021222324
25262728293031



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

Recent comments XML

new⇒The Elegant Universe

Well I have finally found the crazy​guy that preaches useless nonsence​in A...

Joseph Baxter: Jan 7, 11:07pm

I hate Norton Antivirus


SYMANTEC is very​cunning..
Symantec now have a​redeemable cash back offe...

CAN: Jan 4, 6:25pm

Spider solitaire

Hi everyone!

Glad to have found​this site.  I have enjoyed reading​the c...

flwrchld53: Jan 4, 5:30pm

The Escaped Prisoner: When God Is a Monster

if islam is afraid of one woman, it​is sad. it is sad that a lot of​muslim ...

alex: Jan 2, 1:56pm

Generated in about 0.107s.

(Used 8 db queries)

mobile phone