Question is, is there any reason not to pick javascript as a first language? Been hearing alot about Node.js and Meteor, any downsides to picking it over something like ruby?
Would be great to hear your thoughts.
1–10 of 15 posts
Question is, is there any reason not to pick javascript as a first language? Been hearing alot about Node.js and Meteor, any downsides to picking it over something like ruby?
Would be great to hear your thoughts.
let see what others say
I think python is a good first language for a few reasons.
1. Overall the syntax is clean, concise, and readable in the sense that the actual code can be close to "sudo" code, or that it is somewhat similar to what what you might encounter in a mathematics class.
2. From Wikipedia:
"Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library."
All of those programming paradigms are important to understand and few languages capture all of them as nicely as python. Also, static typing and memory management are important to understand – yet, mostly distracting while learning a first language. Python removes the distraction.
3. Python's strict white space rules will force you maintain a somewhat consistent code style – something that many new programmers are awful at.
This list is not exhaustive, just some thoughts.
To be good with JavaScript you need a rather substantial and solid grasp of CS fundamentals and how they are implemented in languages that are stricter about what they will accept and how.
In JavaScript there are too many situations where it either does something totally unexpected (well actually totally logical, but you need to know some pretty arcane stuff to see it that way) or it just fails silently or less likely with a terse exception.
For a beginning programmer that is very little feedback to help with overcoming the initial roadblock. Sometimes called the "getting helloworld to run problem". Trying to learn JS in a browser context is made even more difficult because you need to grapple with the DOM - it is not easy to grok at the best of times.
If you decide to ignore the advice in this and the other posts and go ahead learning JavaScript as the first language, then I suggest getting a very good introductory book and perhaps using Developer JavaScript Console. The debugger is good in that you can single step code and watch variables as they change. You will probably need to take copious notes to understand what is going on.
To be a competent programmer is more than learning a language, it requires a solid foundation in computer science and software engineering. Whilst these topics can be learnt from a book, most people need guidance from those who have acquired such knowledge. Whether they can be bothered answering newbie's questions is another matter.
Not JavaScript – Prototypal inheritance is interesting and powerful. However, overall JavaScript does not afford good programming practices and does not cleanly expose important re-usable programming concepts. Between the good parts of JavaScript, there are nasty surprises. I think python is a good first language for a few reasons. 1. Overall the syntax is clean, concise, and readable in the sense that the actual cod…
https://wiki.python.org/moin/SimplePrograms
name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
http://www.utexas.edu/learn/javascript/example1.html var who = window.prompt("What is your name");
document.write("Hello " + who);
The complication in the Javascript example are the window.prompt and document.write parts which make Javascript harder for beginners to learn.Want to become a competent programmer and do that for a living? The advice in this thread is solid (particularly @CyberFonic's).
If you simply want to hack/glue-up/play around with some side projects, I once heard someone suggest you pick the language your close friends know best and buy them lots of beer.
In my case, I needed a newbie-friendly prototyping tool and JavaScript/Meteor has served me well.
So, give us an idea of your goals, and I'm sure the community here will be able to steer you in the right direction.
JavaScript is not even a good second or third language. Of course it is easy to cut and paste code and hack things. But when it doesn't work right you will go crazy trying to work out why. To be good with JavaScript you need a rather substantial and solid grasp of CS fundamentals and how they are implemented in languages that are stricter about what they will accept and how. In JavaScript there are too many situation…
Failing silently - it's nice to have 'incorrect' programs still do stuff when learning. Who wants to spend hours tracking problems they cannot even comprehend? Figuring out the DOM - tricky indeed. But it's at least superficially familiar to everyone. Browsers have great tools to inspect and play around with it. You have to learn so much more of insert other language to output to the DOM (or other graphical environments).
My advice: Learn underscore. Always refer to Mozilla's docs first (avoid w3schools). Learn ins and outs of Chrome DevTools (or the FF equivalent).
If you end up wanting to choose a different language - either go lower-level (Go, Java, Swift, C-family etc) or higher-level (any LISP pretty much).
Railscasts.com and Laracasts.com are great tools for learning those. But get a decent foundation before moving to a framework . . . then you can add things like Angular on top of your app.