News for hackers. Stuff that matters.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by ritchiea on Tuesday November 07, 2017 @04:34AM (#15642025)
I'm not buying this argument.

There's a Rails way, Python famously aims for one obvious way of doing things. That just isn't true of Javascript exactly because there is a history of developers writing several styles of JS, the "right way" to write JS being redefined by diligent people like Douglas Crockford & John Resig and things changing yet again and yet again.

And look at ES6, the JS ecosystem barely resembles what was considered good, idiomatic Javascript just a few years ago. There are a bunch of devs who have managed to stay on top of what's current and I'm sure are laying down examples of good practices & building tools in that style. But you are also talking about an ecosystem that includes people that started writing JS 4-10 years ago, have adopted some of the absolute newest flavor of the month practices but also have seen JS change so much over the years that they aren't throwing themselves into everything that is now considered a best practice because they know their code works and there could be another seismic change in 8 months.

Writing Javascript nearly every line of code is haunted with "is this still the way I should do this?" and no other language has that much hassle.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by Sacho on Tuesday November 07, 2017 @05:24AM (#15642221)
C++ has had the same problem ever since C++11(or even since its inception, if you consider it as an evolution of C). It also has the same solution - you don't have to chase the latest standard if you don't want to, thanks to an excellent history of backwards-compat. People do it because the new stuff is legitimayely better, not just out of some fad.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by sillysaurus3 on Tuesday November 07, 2017 @04:45AM (#15642055)
But you are also talking about an ecosystem that includes people that started writing JS 5-10 years ago, have adopted some of the absolute newest flavor of the month practices but also have seen JS change so much over the years that they aren't throwing themselves into everything that is now considered a best practice because they know their code works and there could be another seismic change in 8 months.

Again, this is a symptom of the "one toe in the pool" syndrome. You have to throw yourself in.

Yarn is a perfect example. It came out very recently, relatively speaking. And yet it's clearly the future. Like, the only reason not to use yarn is if you have a legacy app that explodes for some reason if you try to type "yarn" instead of "npm install". But the common case is that you do "git clone foo && cd foo && yarn" and everything works perfectly.

It's so much faster, and almost never causes problems.

So why embrace that? It sounds like horseshit yeah? I hate to use heavy handed metaphors like that, but that's exactly the feeling that you get when you hear "Oh, now we're supposed to use yarn? what? npm install isn't good enough now? Those fucking JS idiots have no idea what they're doing."

In reality, you're seeing evolution in action. This is what natural selection looks like. The good ideas triumph. And yes, it's subjective what constitutes a "good idea." But when yarn comes along and makes all my npm installs 3x faster, you bet I notice and you bet I embrace it right away.

That's what I mean about throwing yourself in, though. If you don't actually force yourself to love this stuff, then of course you end up hating it. It's insanity incarnate. Yet if you just embrace that fact, and take it as a given, you can actually find it quite fun. It's an adventure to get to learn these new systems, not a chore. If you run across something that doesn't seem to make sense or doesn't work for you, just ignore it.

It just seems like we as developers run the risk of having our heads stuck so far up our own rears regarding our favorite language paradigms or the lack of greenthreads in JS or whatever it is you hate about the ecosystem, that it's very easy to lose sight of the bigger picture. Right now you can build a team of 50 engineers, and if you choose React, that codebase probably won't devolve into utter chaos. React makes it possible to do large-scale coordination. Like, I can send you my React component and it'll probably work in your codebase.

Ditto for Vue. If you hate the complexity of React, and you're a small team (usually just you alone), then you can just use Vue and not have to care at all about React+Redux's monstrous complexity.

You see? You can pivot however you like. If you hate X then just avoid X1 It's really hard to take these concerns seriously when there are so many options.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by ritchiea on Tuesday November 07, 2017 @04:47AM (#15642058)
It's actually really simple why we can't all just throw ourselves in 100% to every new thing. Instead of learning a new tool I could be writing app code for my client or employer who needs the code for their business. I have a finite amount of time & energy so I try to use it well.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by sillysaurus3 on Tuesday November 07, 2017 @04:59AM (#15642094)
And that's fine! You can still do that. That's the thing -- you can stop climbing wherever it makes sense. If YarnMaster5000 comes out tomorrow and claims to simplify your code so much that you can write a webapp simply by pressing the ` key, you don't have to spend one second learning it. Just stick with whatever you were already doing. The time to learn it is whenever the next project kicks off.

Ah, yes, that's the crux of it. We'd love it if the world would just stop changing so we can relax and stop learning. Well, too bad! Here's the uncomfortable truth: the moment you let yourself get too comfortable, your career dries up. That fear is a powerful motivator, so I suggest internalizing it. If you can't force yourself to love learning, then become afraid that if you don't learn it you'll find yourself unemployable after 5 years.

This almost happened to me, so I'm speaking from direct experience. I came from gamedev, and low level skills like that really do not translate into "I'm getting paid $INSANE/yr in a hot new startup." In fact, you can barely pass webdev interviews because you have to go "Uhh... Yeah, I worked on Rails back in 2007 or so. I guess I have some learning to do. But just trust me, I can learn it as I go. Oh wait, you don't believe me? But... I've spent my whole life learning as I go... It's fine if I don't already know Rails even though you're hiring for a senior rails dev position."

That situation is exactly what happens when you stop being on top of all this stuff. Go to sleep and wake up 5 years later and suddenly getting a job is hard. It's easy to smirk ad feel like it won't happen to you, but FWIW the way you feel about JS now is exactly how I felt about Rails in 2007.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by tome on Tuesday November 07, 2017 @05:40AM (#15642306)
> That's the thing -- you can stop climbing wherever it makes sense. If YarnMaster5000 comes out tomorrow and claims to simplify your code so much that you can write a webapp simply by pressing the ` key, you don't have to spend one second learning it. Just stick with whatever you were already doing.

And there you are a few comments above telling us we have to use Webpack because other older module systems are zombies that came and went.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by dagw on Tuesday November 07, 2017 @05:12AM (#15642162)
We'd love it if the world would just stop changing so we can relax and stop learning.

The truth is that we'll never have enough time learn everything we should learn and every minute I spend re-learning a different way to do something I already know how to do is a minute I'm not spending learning something actually new and useful.

If, for example, I'm writing a web app related to storing and processing geology related measurements (which I am) I should be spending most of my 'learning time' studying things related to geology and the processing of said measurements, not re-learning how web development is done this week.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by Gigablah on Tuesday November 07, 2017 @05:20AM (#15642196)
You will have to "re-learn" web development regardless. HTML, CSS, HTTP, browser features and compatibilities etc are also continuously evolving.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by dagw on Tuesday November 07, 2017 @05:45AM (#15642327)
That's not really re-learning. That's incrementally building on and evolving existing knowledge. Virtually all my HTML and HTTP knowledge from 199X is still valid.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by Gigablah on Tuesday November 07, 2017 @07:01AM (#15642647)
And somehow your JS knowledge isn't?
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by LyndsySimon on Tuesday November 07, 2017 @06:04PM (#15648536)
JavaScript has changed significantly more than HTML, HTTP, or even CSS.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by jodrellblank on Wednesday November 08, 2017 @03:10AM (#15650563)
Ah, yes, that's the crux of it. We'd love it if the world would just stop changing so we can relax and stop learning. Well, too bad!

Something about this smells.

What is it.

Is it the way "we would love it if it stopped changing" but it's us who is changing it?

Is it that the changes are reinventing the wheel? Churn because frothy churn is easier and more profitable than meticulous, solid, long-lasting foundations?

Or is it that we still haven't managed to orient the programming industry around 'finished' software such that if we ever 'finish' software we immediately stop being employed, so we have a pathological need for software to continually need to be rewritten, at the level the average programmer can rewrite?

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by sillysaurus3 on Wednesday November 08, 2017 @03:25AM (#15650616)
It doesn't matter if I agree with you in principle. If you don't play the game, your career will dry up. The world won't care.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by jodrellblank on Wednesday November 08, 2017 @03:26PM (#15656610)
From your other posts, your main problem was that you didn't want to / couldn't move to where jobs were, not that low level gamedev code is no longer being written - VR and AR are testifying to that.

How is this client side rewrite every few months fundamentally different from the broken window fallacy? as in, unsustainable because it adds no value overall?

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by orf on Tuesday November 07, 2017 @05:29AM (#15642241)
> Yarn is a perfect example. It came out very recently, relatively speaking. And yet it's clearly the future.

Node threw themselves into Semver, and it was supposed to be great. Nobody needs a lockfile because everyone obeys semver, so every time you do 'npm install' your app is guaranteed to work because everything is semver'd!

Oh wait, no, that didn't work out. Better freeze every dependency and sub dependency because who knows what will break when we update!

This is why throwing yourself at whatever shiny new thing without thinking or looking at how other languages do it is not always a great idea.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by n3dst4 on Tuesday November 07, 2017 @06:22AM (#15642472)
To be clear though, npm and yarn have not abandoned semver. Semver is still a good way of expressing dependencies. It's just that there are enough cases where it's not sufficient, and that's why lock files are in fashion this season. The underlying semver data is still there though, which is different to the sort of package manager which only records installed versions.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by orf on Tuesday November 07, 2017 @06:57AM (#15642631)
Sure, I didn't meant to imply they abandoned it. I simply meant that in a perfect semver world you wouldn't need lockfiles, except maybe in special cases.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by ashark on Tuesday November 07, 2017 @10:30AM (#15644143)
> Yarn is a perfect example. It came out very recently, relatively speaking. And yet it's clearly the future. Like, the only reason not to use yarn is if you have a legacy app that explodes for some reason if you try to type "yarn" instead of "npm install". But the common case is that you do "git clone foo && cd foo && yarn" and everything works perfectly.

Last I checked its issue tracker was a pile of "hey, you, uh, didn't implement this npm feature at all, so things break" and "you're missing yet another obvious sanity check here, so things break". No wonder it's faster. The last thing I need in my JS stack is another thing that can fail under ordinary use, for marginal benefit.

Re:Sick of Ruby, dynamic typing, side effects, and object-or... by pluma on Tuesday November 07, 2017 @03:22PM (#15647174)
If you think npm is less buggy, you haven't been paying attention after the npm 5 release. Or when npm had an obvious race condition that resulted in publish breaking at random for years. Let's not pretend npm is slowed down by being well-crafted and reliable.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by ashark on Tuesday November 07, 2017 @04:17PM (#15647741)
I've not personally encountered an NPM bug ever, as far as I can recall, and hit a couple inside a week of using Yarn. So I'm gonna keep not using it for the time being, since there's no real difference aside from not having to spend time ruling out my package manager as a source of broken builds.
Re:Sick of Ruby, dynamic typing, side effects, and object-or... by pluma on Tuesday November 07, 2017 @07:42PM (#15649118)
I've run into several NPM bugs (including publishing broken packages because of that race condition bug several times) and have yet to run into any problems with Yarn.

You do you, though.