From: Paul Sutton Date: 2012-06-14T01:33:43+09:00 Subject: Re: Why should I learn ruby? On Thu, 2012-06-14 at 00:38 +0900, Jan E. wrote: > Admin Tensor wrote in post #1064432: > > Isn't that array handling, regular expressions, command line argument > > parsing, and file reading and writing also covered in JavaScript and in > > scripting languages in general? > > Well, standard JavaScript only runs in the browser and doesn't have > access to the file system or the command line. You'd have to use > something like Node.js (server side JavaScript). > > This is also the reason why I don't find JavaScript a good choice for > learning: It doesn't run on its own, it's limited to editing HTML, and > it requires some previous knowledge. I agree. JavaScript is not a great learning language because the runtime enviroment (i.e. the browser, usually) makes error handling, debugging and experimentation difficult. When you are starting you are going to make a bunch of errors in the code and syntax, and will want to play with how things work. In the browser you don't see errors (normally), and it is painful to do things like inspect what is happening (alert boxes everywhere?). With Ruby (and other command-line languages) you'll get meaningful errors, you can debug and single step your code easily, you can throw in some pp or puts statements as needed, and you get the super-useful irb to be able to play with statements and inspect the state of the environment. If you do learn using JavaScript, get a good browser debugger such as Firebug. -Paul