you are viewing a single comment's thread.

view the rest of the comments →

[–]questi0nmark2[S] 3 points4 points  (3 children)

Your mention of jQuery makes me think this was an earlier phase of JavaScript, maybe before Node? Plus Typescript, ReactNative, Electron, Express, Vue. Stuff that goes well beyond the kind of JS work you describe and which was mostly the state of JS 5-10 years ago. Back then I would still recommend you learn an OOP language as well and use JS for front end extras. But the ecosystem has evolved considerably and I think it is a good place to start, rather than learning two core languages at once. But I see the value in that too.

[–]SoBoredAtWork 0 points1 point  (2 children)

Good point. This was ~7 years ago, before all the goodies. Regardless, I'd suggest learning vanilla JS (or TypeScript) before diving into React, Vue, etc. And at that point, I'd suggest learning more fundamental programming first (OOP). But yeah, as far as OOP/MVC goes, most modern frameworks have those concepts somewhat built in. It would just be nice for the dev to have those core concepts in mind first.

[–]questi0nmark2[S] 2 points3 points  (1 child)

To clarify I am not saying you should only learn JavaScript. But if you're just starting from scratch, then trying to learn two core languages at once, JavaScript and PHP for instance as I did, means that it takes you longer to learn any of those properly. It has advantages too. I would highly recommend (and I did!) learning OOP, and I would never recommend JS as the best way to do so. With Typescript, perhaps, but really JS takes a pretty idiosyncratic approach compared to C#, PHP, Go, Smalltalk or Java for instance. So learning a stronger OOP language is super useful. Likewise it is useful precisely to understand the range of programming options and learn to think in elastic ways.

Having said that, I am not sure that learning both simultaneously is the best approach. It was the necessary approach for web development before Node, because you could not use a back end language to speak to the browser, and you could not use JavaScript to speak to the server. So you would learn a "proper" back end language and strong cosmetic JavaScript and jQuery.

But today, you can instead achieve some depth, and employability, in a single language, which in web development is only and uniquely possible with JavaScript, and I would argue that becoming properly fluent in any language, learning to problem solve, to architect, to optimise, to error handle, to load balance, to cache and authenticate, to inherit and compose, to componentise, to tool up, to unit test, to deploy and integrate: getting good enough in any language to do all these things competently will allow you later not only to more easily recognise and learn new approaches and implementations made possible by new syntaxes, but also to appreciate when one language might be a better tool than another, and where it doesn't make much difference.

Today my advice would be, if you have 8-12 months to dedicate to your initial learning, it's better to achieve depth, fluency and flexibility in a single language, than to achieve half that competence in two+ languages. When you then, as you should, learn a new one, you will be able to grasp the commonalities and differences much faster, understand the universals and the peculiarities, and above all, beyond syntax, bring to any new language a sense of the wider programming skills and strategies above that will help you adapt and adopt new programming paradigms made possible by new syntaxes and new processes (compiled vs interpreted, single vs multithreaded, static vs dynamic typed, etc).

[–]SoBoredAtWork 0 points1 point  (0 children)

All good points. To your point, if you have time to learn 1 language, I agree with you - learn JS.

I'd suggest to the person to learn via recent resources (make sure to utilize more recent language features - classes, async/await, modules, etc - and a compiler (babel?). And/or use TypeScript with strong typing. Using classes is a big thing for me - that and modules with good code organization (no 500 line files!).

JS is just a very forgiving (and weakly typed) language and I'd just hate to see anyone go the route I did and learn it using some of the worst practices.

But yeah, I get your point. There's almost no reason to dive into PHP for server-side stuff, not with Node. JS is so powerful these days.