Learning your first programming language(singhrahul.com)
singhrahul.com
Learning your first programming language
http://www.singhrahul.com/2012/07/learning-your-first-programming.html
4 comments
+1 love, love, love the simplicity of the Lua language. If I were teaching introductory programming it would be high on my list of languages to consider.
(I wish its syntax was a little less verbose, but that's why I use http://moonscript.org (like coffeescript for lua) right now, although the compiler has some rough edges and looks like it hasn't received much attention for awhile).
(I wish its syntax was a little less verbose, but that's why I use http://moonscript.org (like coffeescript for lua) right now, although the compiler has some rough edges and looks like it hasn't received much attention for awhile).
C was the first language that i learned and i still feel very comfortable using it. I think that's what affects my choice in recommending it as the first programming language to be learned.
Still, personal experiences in using a language would always be different for different people. That's why i recommend asking other programmers for some advice, before jumping into programming for the very first time :)
Still, personal experiences in using a language would always be different for different people. That's why i recommend asking other programmers for some advice, before jumping into programming for the very first time :)
From the article: i [sic] find C to be the language that every first time programmer must learn.
Well, yes and no. I say no because, on Windows, C is not one of the easier languages to set up. I wouldn't recommend Visual Studio (or any IDE), and getting GCC on Windows (MingW or Cygwin or ???) and updating your PATH isn't obvious. And C compiler errors might be cryptic to a new programmer. And C pointers are tricky. Heck, even printf has its gotchas.
On the other hand, I would say that every programmer would benefit from learning C. If you learn C first then you'll have learned all of the above, and that's great. You'll have some understanding of how arrays are stored in memory, what a compiler does, how references work, etc, which are aspects that other languages hide from you.
For the record, I'd probably recommend Python. Python has a binary installer for Windows, it's lighter on syntax, and it has exceptional documentation. You can play around interactively in the interpreter, and it's a language that has a little bit of everything to try: scripting, objects/inheritance, (some) functional features, etc.
Well, yes and no. I say no because, on Windows, C is not one of the easier languages to set up. I wouldn't recommend Visual Studio (or any IDE), and getting GCC on Windows (MingW or Cygwin or ???) and updating your PATH isn't obvious. And C compiler errors might be cryptic to a new programmer. And C pointers are tricky. Heck, even printf has its gotchas.
On the other hand, I would say that every programmer would benefit from learning C. If you learn C first then you'll have learned all of the above, and that's great. You'll have some understanding of how arrays are stored in memory, what a compiler does, how references work, etc, which are aspects that other languages hide from you.
For the record, I'd probably recommend Python. Python has a binary installer for Windows, it's lighter on syntax, and it has exceptional documentation. You can play around interactively in the interpreter, and it's a language that has a little bit of everything to try: scripting, objects/inheritance, (some) functional features, etc.
The TDM GCC installer [1] is great on Windows as it deals with updating the path and even makes a nice shortcut in the start menu.
I know a few people who began programming with C (or C++) using TDM-GCC and after a couple of questions asking me about the command prompt they were good to go. To begin with just a gcc -o hello.exe hello.c is all that is needed and as you progress with learning the language the additional params are introduced.
As the command line on Windows is extremely simple I have found it easier to teach people how to use the command line than to switch to another browser. They only need to have a basic knowledge half a dozen commands, which can easily be written down, to get started. Also, and sorry if this seems insulting, if someone can't grok the idea of using cd to change a directory (and therefore under what a directory is) they probably are not going to be able to learn to program no matter what the language.
[1] http://tdm-gcc.tdragon.net/
I know a few people who began programming with C (or C++) using TDM-GCC and after a couple of questions asking me about the command prompt they were good to go. To begin with just a gcc -o hello.exe hello.c is all that is needed and as you progress with learning the language the additional params are introduced.
As the command line on Windows is extremely simple I have found it easier to teach people how to use the command line than to switch to another browser. They only need to have a basic knowledge half a dozen commands, which can easily be written down, to get started. Also, and sorry if this seems insulting, if someone can't grok the idea of using cd to change a directory (and therefore under what a directory is) they probably are not going to be able to learn to program no matter what the language.
[1] http://tdm-gcc.tdragon.net/
When i started out, i used Turbo C++ Compiler on a Windows 98 system. It was as easy as copy/pasting the TC++ directory and changing the directory path in the compiler settings. It hardly took much time to learn the basics and soon i was enjoying writing some cool logical programs and having a good time :)
Good one-on-one teachers may not be available to everyone, true, but they can make a huge difference.
Here's a personal anecdote. My first exposure to programming was back in 2005. I was living in Tokyo and agreed to do a "language exchange" with a Japanese friend: I would help him with English, he would teach me Ruby. And so we began. We shared our frustrations; we coached each other through the rough spots; we offered up nuance and context for everything. He gave me the gift of instance_eval long before I could have figured it out on my own. I gave him the confidence to hit on foreign girls. Win-win.
The author is right to suggest new programmers should just dive in, without waiting to find the perfect teacher. That's fine. Do, don't wait. But if you do get the chance to study under someone's wing, take it!
Here's a personal anecdote. My first exposure to programming was back in 2005. I was living in Tokyo and agreed to do a "language exchange" with a Japanese friend: I would help him with English, he would teach me Ruby. And so we began. We shared our frustrations; we coached each other through the rough spots; we offered up nuance and context for everything. He gave me the gift of instance_eval long before I could have figured it out on my own. I gave him the confidence to hit on foreign girls. Win-win.
The author is right to suggest new programmers should just dive in, without waiting to find the perfect teacher. That's fine. Do, don't wait. But if you do get the chance to study under someone's wing, take it!
I absolutely agree with you here. Learning from a good teacher can really make a big difference. You will learn things at a much greater speed than if you start alone.
But, sadly, it's not always easy to find such kind of teacher. I have met so many teachers in my life who only think about teaching as a job, and simply don't care about the students that much. Based on my experience, i have hardly found 5% of the teachers who are really good at what they do.
If you can't find such kind of teacher, it's best to start on your own :)
But, sadly, it's not always easy to find such kind of teacher. I have met so many teachers in my life who only think about teaching as a job, and simply don't care about the students that much. Based on my experience, i have hardly found 5% of the teachers who are really good at what they do.
If you can't find such kind of teacher, it's best to start on your own :)
Very simple minimalistic syntax, few concepts, few primitives, few keywords, dynamically-typed / garbage collected, variable arity, no real gotchas, good tool support, great speed, the ability to access a key in a hash either using bracket or dotted notation, and one of the best programming books for any language (PiL).
But it also scales well; closures, first-class / true anonymous functions, metatables / metamethods, nice simple API for talking between script and C, tail-call optimization, coroutines, short circuiting operators.
And, the path from Lua to JavaScript is very straightforward. In fact I'd say that mastery of Lua would make you a mid-level JS programmer right out of the box...