News for hackers. Stuff that matters.
Re:Modern Javascript: Everything you missed over the last 10... by AegirLeet on Saturday May 15, 2021 @01:11PM (#27166980)
I write PHP for a living and every time I look at the JS world, I feel like they're exactly where PHP was 15 years ago, except with 20 times the amount of incomprehensible tooling.
Re:Modern Javascript: Everything you missed over the last 10... by steve_adams_86 on Saturday May 15, 2021 @02:37PM (#27167728)
I’ve worked with PHP and JS extensively and while I could almost agree from some narrow perspectives, I think JS is nowhere near where PHP was 15 years ago in any sense.

I was writing PHP 15 years ago. It wasn’t a great dev experience and the tooling was awful. JavaScript today has stellar tooling in comparison, and arguably less warts in its standard library than PHP still has today.

I really disliked JavaScript until I read some books that helped me understand what it’s doing under the hood. These days I just don’t have issues with it. Yeah, the ecosystem thrashes a lot and the tooling experience can be bad in regards to that, but otherwise it’s impressive lately. Even without TypeScript, intellisense on regular JS enables extremely streamlined navigation of references and implementations, refactoring, project navigation, tooling integration, etc. Not to mention modern profiling and debugging tools for JS are incredibly easy to use and benefit from.

PHP wasn’t at this stage even 10 years ago. The debugging story was still xdebug and tooling was improving but not great. Composer was painfully slow and buggy - nowhere near as nice as yarn and npm are now.

Yeah JS has problems, but I don’t believe it’s nearly as bad as old PHP.

Re:Modern Javascript: Everything you missed over the last 10... by BeefWellington on Saturday May 15, 2021 @03:52PM (#27168386)
> JavaScript today has stellar tooling in comparison, and arguably less warts in its standard library than PHP still has today.

There are a lot of reasons to like JavaScript as a language and NodeJS as a particular implementation. The standard library (or lack thereof) is absolutely not one of them as things stand today. I'm not even sure what you'd compare between them.

If you meant to say "package available at the other end of npm install" instead of "standard library" I could see that being a different story.

Re:Modern Javascript: Everything you missed over the last 10... by effable on Saturday May 15, 2021 @05:25PM (#27169172)
This may be a little off topic but your comment piqued my interest: I am currently learning JavaScript and I was wondering if you would like to recommend any of the books you read.
Re:Modern Javascript: Everything you missed over the last 10... by steve_adams_86 on Sunday May 16, 2021 @01:17AM (#27171408)
It’s been a while, but I really enjoyed the “You don’t know JS” series by Kyle Simpson. It explained a lot of the details I needed to understand in order to be proficient more consistently. Whether I was working on client or server side code, I felt like I understood my tools well enough to feel a lot more confident than I did before.

https://github.com/getify/You-Dont-Know-JS

Re:Modern Javascript: Everything you missed over the last 10... by sdfin on Saturday May 15, 2021 @06:11PM (#27169486)
I re-learned JS recently, https://javascript.info/ was an awesome resource and has almost anything you may need. Also MDN is good.
Re:Modern Javascript: Everything you missed over the last 10... by agumonkey on Saturday May 15, 2021 @01:40PM (#27167253)
Can you give more details ?
Re:Modern Javascript: Everything you missed over the last 10... by AegirLeet on Saturday May 15, 2021 @02:52PM (#27167846)
15 years ago, PHP didn't really support any programming paradigm very well, it was a huge untyped mess, the standard library was missing a lot of stuff, reusing code meant including individual files based on filesystem paths.

Today, PHP offers a solid OOP experience, good gradual typing, a larger and saner standard library and code loading based on namespaced components.

Now compare today's JS to PHP back in the day. It has the exact same kinds of problems. Except with modern JS, you'll end up adding TypeScript, webpack, Babel and a dozen other tools as well as several hundred megabytes of libraries to paper over all of those problems. But by doing that, you make the build process and the code that ultimately runs in a browser completely incomprehensible and undebuggable for the average developer. And then you start adding even more tooling (source maps that barely work) to try and solve that problem...

Re:Modern Javascript: Everything you missed over the last 10... by agumonkey on Saturday May 15, 2021 @04:52PM (#27168908)
I had the impression that beside gradual typing, ES6 solved most of the mess (cleaner apis, modules) which was happening at the same time PHP (and python) accelerated their growth.

I find it really unfair to compare es6 to php 15 years ago, es6 is really cute (the babel/transpiling part is peculiar, I admit it)