Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have avoided JavaScript for as long as I could.

I simply think that it is a very, very dirty scripting language. I have nothing against curly braces, I work with PHP almost every day, I'm fine with them. I think the biggest issue is that I'm pretty much self taught and started out with PHP. I've worked previously with jQuery, so that dealt pretty much with my JSfobia (as manipulating a few elements on a page did the trick for me, as well as the tons of pre-made plugins out there).

Now I just have to take a step further. I've recently done some exploration, and I must say that I like the way that RoR looks like. And well - there is a similar way of writing JS - CoffeeScript.

On top of that, there is an project coming up for me ( a week or so ) to develop an iPhone app, now I already know that I'll be storing data on the phone and then displaying it. Nothing too complicated yet, but these are new grounds for me. I will probably be working with PhoneGap to make it an app, since I don't really want to start messing in Objective-C (although I could, but without C/C++ knowledge it may take a lot more time than I'd want it to)

So - this brings to my question. Is it okay if I start learning CoffeeScript with just basic understanding of JS, and start trying to use Backbone.js with jQuery/+jQuery Mobile for the project ? Open for any additional suggestions as well.

share|improve this question

closed as off-topic by gnat, GlenH7, MichaelT, Snowman, Kilian Foth Apr 9 at 8:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – gnat, MichaelT, Snowman, Kilian Foth
If this question can be reworded to fit the rules in the help center, please edit the question.

Possible duplicate: programmers.stackexchange.com/questions/102986 –  PersonalNexus Jan 8 '12 at 21:30
Not quite a duplicate. I'm looking for more infromation than just the CoffeeScript. Looking to find out about how CoffeeScript works with Backbone and Mobile environments, and maybe a few fresh suggestions as well (read that topic already) –  Norris Jan 8 '12 at 21:38
Ok, didn't quite get that from your question. There is a lot of unnecessary backstory in there that you might consider trimming to more clearly point out what specifically you are interested in. –  PersonalNexus Jan 8 '12 at 21:53
JavaScript was specced to have quite a low entry level to use it. It's not necessarily a dirty language, but it's easy to write dirty, but functional scripts. Check out JavaScript: The Good Parts to get a bit more education to get over your conception of it. –  StuperUser Jan 9 '12 at 10:55

4 Answers 4

up vote 6 down vote accepted

I think the biggest issue is that I'm pretty much self taught and started out with PHP.

The first one isn't an issue, the latter certainly is ;) PHP is horrible.

... and I must say that I like the way that RoR looks like.

= You like the syntax of Ruby.

So in short, you did some PHP and had a glimpse at RoR.

Now you want to use CoffeeScript because of the "nicer" syntax.

"All problems in computer science can be solved by another level of indirection"
- David Wheeler goes

Keep in mind that CoffeeScript is JavaScript. It's just a syntax abstraction. There a no debugging tools for pure CoffeeSript. One bug and you'll have to dig into the automagically generated JS source.

I would highly recommend that you do not start with CoffeeScript unless you have quite some decent experience with JS.

There are so many good JS tutorials these days as well as a ton of sites who help to demystify the quirks of the language.

We've got a really good list of sources for learning JS over at the TagWiki at SO:

CoffeeScript may have a lot of followers now, but it has just as many people fro the core JS community who hate it to the death. Who knows, there might be different "dialect" of JS tomorrow and everyone and their dog will let CS fall like a hot potato.

Learning JS won't hurt you, trust me, it's not nearly as bad as PHP once you've gone beyond the "looks dirty" part.

Of course it depends on what you're doing, there are good PHP frameworks too. Just as there is horrible Python and Ruby code.

share|improve this answer

I have avoided JavaScript for as long as I could as well. Definitely a mistake. JavaScript is the "operating system" of the browser, which is the "operating system" of the web. You might want to have a look at "JavaScript: The Good Parts" (it's a short book ;) which explains a number of the design choices in JS. It also makes the point that it must have done something right, as opposed to e.g. Java for the task of making web pages more dynamic, even though Java is a "better" language by many standards. I've had a look at CoffeeScript as well but didn't like the additional hassle; also it's just syntactic sugar and doesn't really change the problem below, if you want to call it a problem

share|improve this answer

Here's a few suggestions, since you asked.

Go learn as many programming languages as you can, to give yourself some perspective. You've basically told us that you're operating on assumptions and without any data to back up your decisions. You need to change that if you expect to have a long and successful career as a programmer.

PHP is in an awful state of being. I'm of the opinion that it damages your thinking to program in it long term, because it puts you in the mindset of "hell, I'll just get it done like this because it works and it's easier", rather than writing quality code that isn't full of spaghetti.

Javascript has had almost exactly the same historical perspective as PHP: bootstrapped on the web, hacker/get stuff done mentality, and similar syntax. The difference is that the Javascript community has built good libraries and pushed the web forward. As far as I can tell, PHP has held the web back since about 2003.

The reason you like RoR (and probably Django, etc) is because it has a clean separation of templating code from controllers and data. You can find that in just about any framework. So far, you've only said you played around with PHP, but hopefully you've used a framework such as Code Igniter that exhibits similar cleanliness.

All of that is purely aesthetics though. You really just need to go write and read more code in as many languages as you can, and soon.

share|improve this answer

The Javascript you hate is the Javascript of ten years ago. Problem is many people still write it this way. Find some tutorials on modern Javascript and you will find it a powerful and flexible dynamic language. Good starting tutorial I found at this blog

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.