Hacker News new | ask | show | jobs
by whytaka 3478 days ago
Could you point to more advanced concepts? As a newb, I'm eager to learn.
1 comments

If you want to be a good programmer, pick another language, and start there. you will learn more good practices from starting with a modern, full-featured language like python, than trying to work in the the chaotic disaster zone that is javascript.

A good programmer can pick up javascript quickly. Other than syntactic and semantic warts, it is not a difficult language to learn.

Thanks for the suggestion.

I actually started with Python and moved on to JavaScript for my work involving web development. Currently, I use both.

I'm generally comfortable with making CRUD apps employing OOP, using both Python classes and prototypal inheritance in JS. My issue is that I still don't have the experience to understand WHY people often lament the 'chaotic disaster' that is JS. I haven't had any issues yet...

I also just want to keep the momentum up and never stop learning.

JavaScript just isn't the "chaotic disaster" many try to paint it as anymore. Sure, you can write it in a chaotic way, but the level of understanding and education has helped make it easier for people coming into JavaScript actually do well, and avoid the major stumbles that caused issues in the early days. Add in advances to the language itself over the lat few years, and it's a very solid language.
I don't really want to stoke a language war, but if it truly isn't immediately obvious to you why a language like Python is less of a mess than JS (which lacks fundamental things like "packages"), then you aren't done with Python yet.

I don't mean that to be rude. It's just...the bar is very low here.

you mean, the future version of javascript that nobody uses yet has modules:

https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...

meanwhile, everyone else uses one of the sixteen competing implementations of something that was built-in to any real language starting in the 70s. that's not a mess at all.

Seems like a typical response by a non-JS programmer that doesn't really understand where JavaScript is at these days.
I second this. It was so easy to write JavaScript after writing C# and others for awhile.

Now I write mostly JavaScript (<3 TypeScript) because it's so easy and fast, but having traditional OOP principals in my head is very helpful.

You'll also find many more, much better examples for data structures and algorithms in Java or C#.

Java and C# aren't going to give you the same flavour of protypical inheritance that JavaScript has.

Perhaps you might try Lisp or scheme:

http://www.crockford.com/javascript/little.html

Neither Lisp nor Scheme offer prototypical inheritance out of the box. Lisp uses ol'-fashioned nominal subclassing, while Scheme doesn't even have "objects" in the OOP sense. They're powerful enough to add it, but nobody does because the prototypical object model pales in comparison to CLOS. Come to think of it, every object model that's not CLOS pales in comparison to CLOS...

I think this is a poor recommendation regardless, because programming in JS really is more similar to modern C# than it is to Lisp or Scheme.

Also, Douglas Crockford is an asshat. How did he wind up an authority on anything?

No, not the same. The general concepts are similar, though.

My thinking goes: understanding classic OOP is helpful in learning JavaScript because the high level concepts are the same but in my opinion more obvious and easier to implement in Java/C#.

By more obvious, a Java/C# (+ others) program starts with a class and to add functionality you either have to add more methods to that class or implement another class. So to a new programmer "duh, everything is an object and objects are instances of a class".

It's kind of hard to convey the same idea to someone in JavaScript when {} is called an object, "xxx" is an object, and to compose a new class, you compose a new function.

However, to someone who already understands classes and objects, it's just a new/different way to create classes and objects.

Try not using prototype or class in JavaScript for a while, and you will do just fine without them. If there's a paradigm, or best practice, and you want to learn, don't follow it and see what happens.
I write procedural scripts all the time for just getting things done, often in JavaScript, Perl and PHP.

I've only worked on one application written without any OO patterns, completely procedural, and it was a complete mess.

Adding or extending features caused cascading bugs. Eventually we had to rewrite the backend (PHP) into MVC to be productive. I quit because I dreaded the work. I didn't want to write another line.

I have been pretty interested in functional programming lately, or the functional paradigm everyone in JS is following nowadays, but haven't gotten the chance to take a deep dive yet.

I have reasons to believe that using "traditional OOP principles" is a bad way to program in JS. If you look at TypeScript development history, they started from adding classes to JS, but now work on advanced stuff that has nothing to do with OOP.
Do not do this. Do not listen to anyone calling JavaScript a "chaotic disaster zone", or engaging in any such 1990s style language-wars childishness.

I spent years programming C# before switching to JS, and it took me a long time to stop thinking in a object-oriented way and embrace the functional style that works best with JavaScript.

If you want to learn JS and be a good JS programmer, you are best learning JS, not some other language. That's basic common sense. A great place to start is with the "You Don't Know JS" book series, which are all available online, for free: https://github.com/getify/You-Dont-Know-JS.

If you want to be a good programmer, pick another language, and start there. you will learn more good practices from starting with a modern, full-featured language like python, than trying to work in the the chaotic disaster zone that is javascript.

This is just wrong on so many levels. I wish "we" would get over this meme that by picking up language X that is a paradigm shift from language Y, that you're going to be a better programmer in language Y. That's just nonsense.

The comment about "chaotic disaster zone" is just bitterness for the typical reasons of hatred for JavaScript.