News for hackers. Stuff that matters.
Re:Old Code Gets Younger Every Year by deckard1 on Monday June 08, 2020 @03:24PM (#23459833)
> The real horsemen of the legacy apocalypse is the depth of the dependency tree.

I won't speak for Java or Python. For Node/JS, I do not see this being a problem for the future. The reason is because npm is so fragile that the entire thing falls over today if you just look at it wrong. The very second you run "npm install" you have a mountain of instant tech debt. The primary reason for this is because the people writing JavaScript do not know what they are doing. They have not cut their teeth on libraries in C/C++ or other languages and have no clue how backwards compatibility or versioning works. If you doubt what I'm saying, then I invite you to do your own quality inspection of any major JS library or framework out there. I'm not going to name names, but the vast majority of it is pure shit.

In my experience, JS code has a life expectancy of about a year and a half. Give or take. After that, it is rewritten. Which also contributes to the lack of quality in the JS ecosystem. There is a built-in assumption that this code won't survive past the time your average dev gets bored of it.

People, today, do not realize there are JS frameworks that predate React/Angular/etc. and have already died. Once popular frameworks. And I'm not talking jQuery. You don't see them because JS development = churn. You don't even see CoffeeScript mentioned today, and that was just a few years ago.

Re:Old Code Gets Younger Every Year by joekrill on Monday June 08, 2020 @05:01PM (#23460754)
This sounds like the sort of thing I hear from folks who have only passively dealt with the Javascript ecosystem but somehow still seem to think they have a really great handle on the entire situation, how it got there, what exactly the root of the problems are, and (sometimes) how it can be fixed.

And while I partially agree in some cases, I don't think this is in any way a problem specific to the JS ecosystem. There is definitely a lack of quality in a whole lot of JavaScript code out there. But I've also seen TONS of horribly written Ruby gems, .Net libraries, Java apps, even Dockerfiles.

It is just much more prevalent when those ecosystems are still "maturing" - which I think JS, Node, NPM, etc still very much are. Even the early Android days were plagued with tons of horrible options for networking libraries, SQLite helpers, or whatever else wasn't fleshed out well. And that was just the _platform_ maturing with a language that was already quite mature. With JS you have not only the language itself maturing and changing rather quickly, but also all the underlying platforms, package management systems, security issues, etc.

Patterns, best practices, and standards often take quite a while to surface and become established. And they seem so obvious in hindsight! Which is why I think we get a lot of people coming from other ecosystems who seem to have selectively forgotten about that happening in their own established tech niche.

Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @09:16PM (#23462618)
> This sounds like the sort of thing I hear from folks who have only passively dealt with the Javascript ecosystem but somehow still seem to think they have a really great handle on the entire situation, how it got there, what exactly the root of the problems are, and (sometimes) how it can be fixed.

Never in the last 11 years have I not been professionally developing JavaScript to some degree, and I fully stand by what was said in the post above.

> It is just much more prevalent when those ecosystems are still "maturing" - which I think JS, Node, NPM, etc still very much are.

Then why are things getting worse?

> Patterns, best practices, and standards often take quite a while to surface and become established.

The best practice for JavaScript at this point is to use the few good libraries (in most cases, that's literally only React) and beyond that, do as little in JavaScript as you can to minimize its impact on your system. User experience comes before everything, so that means you still have to do a lot of JavaScript.

Re:Old Code Gets Younger Every Year by tashoecraft on Monday June 08, 2020 @09:27PM (#23462686)
It's very limited to think that the user experience comes before everything. If I focus purely on the user and not my business I don't have a business. If I do something good for the user experience but in fact breaks the law, then I am no longer in business. The user is incredibly important, but it's all a balancing act of resources and where to dedicate them.
Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @09:49PM (#23462832)
If your business doesn't serve its users, I am not particularly concerned that you don't have a business.

Its my impression that most relevant laws are geared toward protecting users from businesses, but I'd be open to hearing if you know of any exceptions (GDPR isn't one--secretly collecting data on users without their consent isn't serving users, it's harming users).

Re:Old Code Gets Younger Every Year by tashoecraft on Monday June 08, 2020 @10:06PM (#23462926)
User experience is a broad term. People here generally think of speed, but in fact that can actually result in a worse user experience. I believe users react better to a loader that takes longer for certain tasks like calculating tax returns because they like to think the computer worked hard to get the best result. It’s not always black and white.

I have had to implement features that are awful for the users, but are required by law to have. Others to protect the business from liability.

I’m not saying doesn’t serve users as the original comment was “user experience” and was specifically mentioning JavaScript in terms of a presumably slow site. User experience is many things and all of them need to be considered. I totally agree that sites have gotten way to bloated, but the js community is recognizing that and trying to work on it, lazy loading and improvements to module bundling are going to help. I think the craze of tiny packages is coming to an end. Libraries post proudly when they have zero dependencies. As the community evolves it’ll improve, though some sites will probably continue to get worse as higher ups demand more features.

Re:Old Code Gets Younger Every Year by kerkeslager on Wednesday June 10, 2020 @08:16AM (#23476243)
> I believe users react better to a loader that takes longer for certain tasks like calculating tax returns because they like to think the computer worked hard to get the best result. It’s not always black and white.

This is a concern with creating the impression that you're serving the user, rather than actually serving the user.

> I have had to implement features that are awful for the users, but are required by law to have. Others to protect the business from liability.

This is basically what you said in the previous post, and remains lacking in concrete examples.

Re:Old Code Gets Younger Every Year by marvy on Tuesday June 09, 2020 @01:03AM (#23463813)
> awful for the users, but are required by law

I am really curious what sort of law does this. (Though maybe I'm better off not knowing...?)

Re:Old Code Gets Younger Every Year by orange8 on Monday June 08, 2020 @11:26PM (#23463369)
> Never in the last 11 years have I not been professionally developing JavaScript to some degree

I know a designer who has also been professionally developing JS to some degree for over 15 years. Still very much a JS novice.

The terms "passively dealt with the Javascript" and "to some degree" sound like the same thing to me.

Re:Old Code Gets Younger Every Year by no_wizard on Monday June 08, 2020 @09:46PM (#23462803)
How’s it getting worse, exactly? I must admit I am intrigued by this contrarian view Than the average, but this feels light in specifics so I don’t have any way to address it on a point by point basis. Could you elaborate your positions here?
Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @10:09PM (#23462939)
Classes: JavaScript developers couldn't be arsed to learn prototypical inheritance, so they added class-based inheritance. Except they didn't really--classes in JavaScript are just an abstraction built around prototypical inheritance. So now you have to understand prototypical inheritance to understand how the class abstraction leaks. It's fewer lines of code, but it brings in a bunch of implicit complexity.

Promises: this is just syntactic sugar around callbacks, and does nothing to address the underlying problems of why callbacks were painful. It does introduce two ways of doing the same thing though, so now if you want to write any sort of abstractions you have to handle both ways.

Leaning hard into global frameworks that actively resist reusability and composition: Angular, Ember, etc. just start from the assumption you're writing an SPA. React is a rare gem of an exception, and is an awesome project, but there you have Flux/Redux/etc. trying to turn every React App into an SPA. This is probably the clearest example of JS projects being unsustainable: if you sacrifice reuse and composability in order to have a framework that does a lot for you, that lets you spin up projects quickly, but the project will slowly grind to a halt. React projects are great as long as you can fight the fight to keep Redux et al out, but eventually Redux fanboy gets it in and it quickly consumes your project. Global state is bad, folks. And don't tell me about reducers: I know, and if you think that means there isn't global state, that's only because you don't understand what global state and/or reducers are. I also am not interested in hearing about the other library you use to clean up your Redux code--instead of piling on more libraries to fix the problems you introduced, don't introduce the problems in the first place.

Re:Old Code Gets Younger Every Year by csnover on Tuesday June 09, 2020 @12:10AM (#23463562)
The classes thing is even worse than what you are describing since it is the only way to create correctly functioning sub-types of built-ins (e.g. `Error`). So not only is it still syntactic sugar for prototype-based inheritance for most things, there are also these edge cases where there’s actually no fully functional prototype-based equivalent.
Re:Old Code Gets Younger Every Year by no_wizard on Tuesday June 09, 2020 @12:03AM (#23463523)
So, I see small bits here, that all boil down to developers not understanding enough about their language of choice. The web being the vast platform that it is and JavaScript eating so many domains may very well be a situation where not having full mastery of a language will still get you very far perhaps - which says a ton of positive about the platforms imo- but that’s the heart of what I’m seeing here.

So, perhaps the issue Heyer is lack of education, not that the ecosystem itself is unquestionably broken?

Also, curious, how do you handle state full actions without some kind of global? Genuinely curious

Re:Old Code Gets Younger Every Year by kerkeslager on Wednesday June 10, 2020 @11:48AM (#23478424)
> The web being the vast platform that it is and JavaScript eating so many domains may very well be a situation where not having full mastery of a language will still get you very far perhaps

Sure, it gets you into a project far enough to commit a lot of resources to it, and then falls over.

> So, perhaps the issue Heyer is lack of education, not that the ecosystem itself is unquestionably broken?

The problem may be a lack of education, but that becomes a problem with the ecosystem when the uneducated are determining the direction of the language. Classes are a feature of JavaScript now: that's irreversible damage done to the language. We can educate people about prototypical inheritance and explain to them why hacking classes over top of them is a bad idea, but that's too little too late: we can't remove classes from the language because there's already too much code that depends on them. And we can't even add classes into linters and say "don't use them", because as another commenter pointed out, core language features now depend on it. At this point, we have to embrace the suck.

And there's a fundamental opposition in the JS community to education. Education starts with admitting you don't know something, and you can see in this thread a lot of people jumping in to defend the JS ecosystem. But the type of defenses you see are telling: instead of discussing the technical merits of the decisions made, people are shooting the messenger[1] or taking it personally[2]. The only defense of JS that's vaguely technical is brundolf's post, which isn't so much a defense of JS as a strategy for writing good code in a crappy language. Not a single post here is actually defending the JS ecosystem on technical grounds.

> Also, curious, how do you handle state full actions without some kind of global? Genuinely curious

Let's say you are writing a configuration interface for virtual servers. You have three attributes on sliders bars: memory units, CPUs, and solid state drives. There's also a total cost field. The Redux global state way looks something like:

1. Have the CPUs, Memory Units, SSDs, and Total Cost in a global store.

2. Create 3 actions and corresponding reducers that update the Total Cost when any of the slider bars change.

3. Create 3 slider bar components, which dispatch to the global store with the proper actions.

4. Create a base component that renders the whole thing.

This approach already runs into some problems:

1. First, you've got three slider components that are basically the same. You can pull out the rendering code into a Slider superclass, and that reduces the repetition, but your reusability is limited: every time you want to add a slider elsewhere in the app you have to write a whole new component. And when you look at those components, you've got a lot of implicit code being pulled in by the superclass, which means you have to switch between the component and the supercomponent to understand what's going on.

2. Your reducers operate on changes in different pieces of data, but ultimately each all have to know about all three data sources to calculate the total. You can check out "Reusing Reducer Logic"[3] and that's certainly a better idea than repeating yourself three times, but you can see that there's a complexity explosion happening here.

3. In actuality, what happens too often is the duplication is just left in the three slider classes, and you have three reducers since reuse is too complex. Even if you're very disciplined about it, the complexity of achieving reuse sometimes mean you don't have time or energy to do it. In short: this design punishes reusability and rewards duplication.

4. If you want to have multiple private servers, you now have to change literally every single one of these components, because every single one needs to know in some way which server it's operating on.

Let's design the same functionality, without Redux:

1. Have a slider component which accepts a min, max, initialValue and onValueChanged callback as props.

2. Have a parent component that holds the three values in its state, and renders the three sliders with onValueChanged callbacks that update the parent component's state. The total can be rendered without being stored in state, but if you want to have multiple servers on the page, you might want to put the total in state.

At first glance, each of these components is slightly larger, and it seems annoying to have to pass all the info into the slider components. But consider the benefits:

1. All your server state is in one place. No one else stores information on servers, and nowhere else even knows that servers exist. It's decoupled.

2. Because of this decoupling, the slider is a reusable component. You can use the same slider to modify literally anything with a min/max/value, favoring composition over inheritance[4].

3. The only thing you have to understand here is React components. The complexity is greatly reduced.

4. If you want to have multiple servers on the page, the parent component is already most of the way to being a reusable component. All you have to do is expose props for the initial server configuration, and an onServerChanged handler. There's one gotcha here: changes to the sliders need to propagate up to the parent of the parent component and still trigger the proper events and re-rendering. Pitfalls can be avoided here by using an immutability library--I prefer Immer, but I imagine ImmutableJS can do the same things. You could even roll your own, since you really don't need much to handle this--a simple set of copy-on-write functions would be adequate, although they would stop being performant if your data structure gets more complex.

[1] "This sounds like the sort of thing I hear from folks who have only passively dealt with the Javascript ecosystem"

[2] "Almost every comment thread, regardless of topic, has someone shitting on front-end developers and it's extremely demoralizing."

[3] https://redux.js.org/recipes/structuring-reducers/reusing-re...

[4] https://en.wikipedia.org/wiki/Composition_over_inheritance

Re:Old Code Gets Younger Every Year by no_wizard on Thursday June 11, 2020 @06:50PM (#23494064)
Just to say, I was taking a neutral position on this, genuinely not trying to get caught in the lack of details I was seeing in the back and forth, so I appreciate the detailed response.

I'll say this with redux: precisely. You can achieve reusability if you build with that in mind, but even fresh projects I've seen get caught at some point on duplicating code irresponsibly here. The fact that they didn't just make this a core part of the redux experience - I'm referring to the abstraction they use in the example on the page named `createNamedWrapperReducer` specifically - to simply allow you to pass a unique identifier you can associate with a component (which it could then offload from the state container if the component is removed from the page, saving memory) or even requiring it as a prop (people might grumble, but it'd catch on regardless) would have been a much more effective way to do this. I'm shocked 5 version sin we don't have this as the default...leaving it up to the user to create a very basic abstraction around this just irks me, as I don't see how consumers benefit from that.

Yet, I don't want to create _yet another library_ since redux is so well entrenched. Internally where I used to work, we had a library that basically was just what I described. You specified a special prop on a component and any reducers were created from a factory that respected the prop, worked well enough.

Now, with that said, I have to say this:

I think JavaScript is a great language. I think TypeScript is an even better manifestation, despite some quirks.

Now, onto some technical bits.

Classes are more than just fancy wrappers on prototypical inheritance. The way its going with the standards committee, and the way I've interpreted the point of having classes, is to have formal encapsulation[0]. With things like the private fields & method proposal[1] already well on their way to formal standardization, classes are starting to make more sense. They also provide a way to extend builtins in a way the engine understands (This is also the logic behind Web Components I feel like everyone misses, but that's another story).

While I know there is plenty of object oriented pitfalls everyone has seen, like abuse of inheritance, I find that the very common pre-class way was just, if not more so, prone to pitfalls. Extending classes is pretty obvious to most programmers - I mean this in terms of syntax and typical expected behavior - I coded up a simple example here to illustrate just how gnarly ES5 "classes" are.

https://gist.github.com/ScottAwesome/67d2d10761bd4993eec9d9d...

I also think classes provide the correct abstraction for exposing public and private APIs, as I already mentioned the private fields and method proposal, but also its more conventionally straightforward to encapsulate this even using a WeakMap to make private methods/fields unexposed to the consumer, (one of its primary use cases when it was introduced). Plain objects, without some sort of system to manage their creation (like factories) and their visibility (Object.seal, Object.freeze, Object.preventExtension, Object.DefineProperty - all of which work on classes too, of course), they're otherwise going to leak their members and its all too easy to find private APIs on object members. I know you can with classses - sans using a WeakMap or the new private fields API. I find it feasibly easier however to integrate classes when I need to encapsulate a well defined interface with properties & methods, in large part because I can keep the private APIs private more easily, via an internal WeakMap, without sacrificing extensibility.

I know you can do this with objects, however its much more clear that you get a discrete instance with classes. When that sort of thing is important, I think classes are useful.

I also think there is a lot of value to the mixin pattern.

I also think this reaches into what most developers just expect out of a language. Arguably, the complete lack of usage of the Reflect[2] APIs I see in the wild and where I've worked tells me most people just don't reach for these kinds of APIs. Therefore from a language development point of view, I can't argue classes are bad, either.

Now I understand you can get there with plain objects, and I think this is an under-utilized mechanism of the language. In fact, I think the plain javascript object are amazing, and very few languages have such a powerful construct. I'm a big fan of composition over inheritance (to which end I have leveraged the stamp specification and its toolkit[3]. I think it would have been nice to see more specialty objects (with a static `Object` factory to create them) over having to just introduce classes. Alas, they are here to stay.

Truth be told, I don't use classes that often, preferring pure functions & plain objects most of the time, but sometimes there just isn't a better way to encapsulate behaviors than the a class, in fewer lines of code, that's easy to reason about and maintain.

Now one trend I don't like, is that a lot of things are becoming class only APIs (Web Components being a major one). This complicates things, but you can certainly 'hide' the implementation details via factories if you don't want to expose classes directly, so far in these cases, that's pretty straightforward to do.

Worth noting: I'm just not strongly opinionated enough to say you're right or wrong on this. We already acknowledged a massive education problem in the industry, one that, I will admit is in my personal experience seemingly true, that not enough people take the language serious enough to spend the time to learn how to work with it appropriately. Until that's solved, I don't think its worth fighting over other minutiae in this particular discussion. Solving the problem of good developer evangelism in the JS ecosystem is a discussion for another time, though, and one that will ultimately be futile if we can't get the major stakeholders to have some agreement on what that means.

[0]: https://en.wikipedia.org/wiki/Encapsulation_(computer_progra... [1]: https://github.com/tc39/proposal-private-methods#private-met... [2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... [3]: https://github.com/stampit-org/stamp-specification

Re:Old Code Gets Younger Every Year by vlovich123 on Monday June 08, 2020 @05:29PM (#23461029)
That could be the case. It could also be the case that those deeply rooted in the Javascript ecosystem aren't listening to domain experts.

The numerous security problems with how NPM installs dependencies was pointed out as problematic from the get go by language maintainers, package manager maintainers, & security experts from other projects.

I think it's possible that Javascript is getting better & more responsive here & I bet at least some of the defensiveness was that it has also been unfairly criticized which makes it hard to separate signal from noise.

Re:Old Code Gets Younger Every Year by brazzy on Monday June 08, 2020 @05:34PM (#23461053)
> It is just much more prevalent when those ecosystems are still "maturing" - which I think JS, Node, NPM, etc still very much are. Even the early Android days were plagued with

Node is about half a year younger than Android, and npm another half year. Javascript is, of course, over a decade older.

If JS, Node, NPM, etc is "still maturing" after all that time, then that is a pretty strong indication that there is something wrong with that ecosystem.

Re:Old Code Gets Younger Every Year by hombre_fatal on Monday June 08, 2020 @07:00PM (#23461720)
You compare it to Android as if Android dev isn't full of its own problems. Here is some Android complaints that I agree with from the other day: https://news.ycombinator.com/item?id=23438732

Android is definitely still maturing. So is iOS/macOS dev.

I guess client development isn't as easy as we told ourselves.

Re:Old Code Gets Younger Every Year by joekrill on Monday June 08, 2020 @06:01PM (#23461300)
It's not a scenario where you can look at "absolute years from inception". It's all relative. With the JS ecosystem, you have rapidly changing Web APIs and standards, varying degrees of browser support and Node versions. And no real "central authority" to guide things in a specific direction. With Android you have a much more managed platform, with Google providing at least some guidance on best practices (explicitly or not). I'm sure the recent introduction of Kotlin added some complexities and confusion to that system. But I still don't think things are changing as rapidly as they are in the JS world, and from so many different angles.
Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @09:37PM (#23462753)
> With the JS ecosystem, you have rapidly changing Web APIs and standards, varying degrees of browser support and Node versions. And no real "central authority" to guide things in a specific direction.

All of these (except Node versions) are constraints of the original problem domain: running user interface code in a browser. These are unavoidable for client-side Javascript.

But these are not constraints of server-side or command line code, so it's absurd to write server-side code under these constraints. Server-side JavaScript should not exist. Command line utilities written in Javascript should not exist.

What part of using having a bunch of completely different ways to bind to events to read a file makes any sense? https://stackoverflow.com/questions/9168737/read-a-text-file...

Re:Old Code Gets Younger Every Year by akiselev on Tuesday June 09, 2020 @02:02AM (#23464124)
> But these are not constraints of server-side or command line code, so it's absurd to write server-side code under these constraints. Server-side JavaScript should not exist. Command line utilities written in Javascript should not exist.

This is a myopic view entirely disconnected from reality. The purpose of code isn't to be perfect or pretty, its purpose is to do useful work. The most relevant constraint is always available resources which is dominated by human capital and experience. Productivity is measured using useful output, not code quality.

> What part of using having a bunch of completely different ways to bind to events to read a file makes any sense?

The part that puts food on the table. I can't name a single language I have any experience with that has One True Way™ of binding to events except for C and assembly which can only pass callable pointers around.

Re:Old Code Gets Younger Every Year by kerkeslager on Tuesday June 09, 2020 @09:52PM (#23473039)
> The most relevant constraint is always available resources which is dominated by human capital and experience.

Which is why it's particularly puzzling that JavaScript community ignores vast swaths of human capital and experience. Global state? Awesome! Principle of least astonishment? For the birds. Caring about security of your dependencies? What on earth for?

> Productivity is measured using useful output, not code quality.

Useful output is strongly correlated with code quality, and that correlation grows stronger as a project grows.

> The part that puts food on the table.

Sure, my billable rate is the same no matter what language I'm writing and if that's all you care about, okay I guess. But I've rewritten a server-side JavaScript application in Python, and my clients wouldn't hesitate to say that they got more for my billable hours than they did for the team of three JavaScript developers who wrote the original application.

> I can't name a single language I have any experience with that has One True Way™ of binding to events except for C and assembly which can only pass callable pointers around.

You need to take a bigger step back to understand what I'm saying. It's not about having One True Way, it's about keeping your code simple enough that you can read it when you come back to it a year later, you can break it into composable chunks, and reuse it. Every one of the ways on the page I linked forces you to think about an event loop in a process that's fundamentally procedural. It's fundamentally the wrong abstraction for the situation, but JavaScript literally can't represent a better abstraction.

Re:Old Code Gets Younger Every Year by mgkimsal on Tuesday June 09, 2020 @08:59AM (#23466253)
I don't think the GP was saying JS is bad because there's not 'one true way' to read from a file. I think the GP was saying it's bad because we're trying to get it to read from a file in the first place. ('Server-side JavaScript should not exist')
Re:Old Code Gets Younger Every Year by halostatue on Tuesday June 09, 2020 @01:21PM (#23468627)
SSJS has existed more or less from the beginning of JS.

https://docs.oracle.com/cd/E19957-01/816-6410-10/816-6410-10...

Any general purpose language will be used in ways and places that it was not expected to be used. Both Netscape and MS offered some level of SSJS, and MS added a JScript Windows Script Host.

Re:Old Code Gets Younger Every Year by bena on Monday June 08, 2020 @07:46PM (#23462071)
I mean, if Javascript is eternally stuck in a state of "still maturing" or it's environment make maturation take much longer than other ecosystems, then wouldn't that make it just a bad ecosystem?
Re:Old Code Gets Younger Every Year by hinkley on Monday June 08, 2020 @06:08PM (#23461353)
npm is not 'maturing'. It is now regressing.

There is no spec, there is no feature list, and so patches keep breaking behavior and then it gets declared as being on purpose.

I am using several flags for CD builds that are not documented on the npm page (or at least were not when I started using them).

If you are thinking of deflecting by talking about how maybe my builds are too complex then you can save your breath, because I don't want to hear it.

Tinker toy apps won't have any maintenance problems, aren't the sort of things you get paid to work on for years, can be replaced instead of mucked with. And quite frankly, bringing up happy path applications just dates you as a young developer with no field experience (or worse, an idiot).

Re:Old Code Gets Younger Every Year by brazzy on Tuesday June 09, 2020 @02:19PM (#23469182)
I think you replied to the wrong person.
Re:Old Code Gets Younger Every Year by rudolph9 on Monday June 08, 2020 @07:18PM (#23461847)
People seems to forget how many people program in JavaScript. Just because the average is low doesn’t mean there aren’t just as many really good ones out there as any other language. It might be common to have lots of dependencies but I can tell you gist hand you only need a few with a really shallow tree to build a full featured web app (both server and client).
Re:Old Code Gets Younger Every Year by koolba on Monday June 08, 2020 @08:05PM (#23462214)
It’s not just the average that’s low. It’s the median as well. There’s an incredible long tail of skill with JS and the related ecosystem.
Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @09:39PM (#23462761)
It's possible to write good code in bad languages.
Re:Old Code Gets Younger Every Year by _bxg1 on Monday June 08, 2020 @04:23PM (#23460361)
> The primary reason for this is because the people writing JavaScript do not know what they are doing.

Hello. I'm a JavaScript programmer who cut my teeth on Java twelve years ago, followed by C++ two years later and throughout the course of my Computer Science program, and over the years I've done personal work in half a dozen other languages including Rust, Clojure, Python, C#, etc.

Despite all of that TypeScript remains by go-to general-purpose language of choice, for any arbitrary project without particular constraints.

Take your flame-bait elsewhere, please.

Re:Old Code Gets Younger Every Year by HeWhoLurksLate on Monday June 08, 2020 @05:02PM (#23460765)
It's always neat to read reasoned replies to comments like these.

> > The primary reason for this is because the people writing JavaScript do not know what they are doing.

I think GP has a point here, though- it feels (to _me_, someone with only a small amount of programming experience) that there are all too many beginner tutorials that jump straight into framework-of-the-week.js and that leave huge knowledge gaps- if people start with node.js and angular and and and and, they might not know that they can do xyz in a vanilla install of JS, thus making their core knowledge of the language dependent on a particular framework.

Re:Old Code Gets Younger Every Year by _bxg1 on Monday June 08, 2020 @05:09PM (#23460853)
I think there's some truth to this, but the same is true in, say, the Java world where you're almost not even writing things in Java-the-language, you're writing things in Spring. That said, it's probably more true in the JS world because it is so feasible to teach someone to make something in a JS framework before they know the fundamentals. Which is, honestly, an enormous compliment to the language, not an indictment! But it does come with some interesting side-effects.

I do feel the need to make one small correction (the OP actually made the same mistake): Node.js is not a framework, it is a runtime. If you want to run JavaScript the way you run Python, you use Node (or, very recently, an alternative called Deno). You also don't have to do anything special with your code to run it in Node, like you would with a framework, unless you want to use its system APIs which of course do not exist in the browser. But even those are really more like libraries.

But yes, your overall point is valid

Re:Old Code Gets Younger Every Year by Cthulhu_ on Tuesday June 09, 2020 @04:32AM (#23464856)
I personally (anecdotal) feel that the Java world is a lot more formal; there are some Strong Opinions held in what "good" Java code is, which is missing in Javascript. This is in part due to great books like Effective Java, and in part due to editor / IDE support that will warn you and help you write great code - keep in mind that good IDE support has been missing in Javascript for years because of its lack of support for e.g. modules or namespaces, and its lack of Opinions.

Java's community has been Opinionated, whereas the JS community has been a lot more freeform. JQuery and NodeJS have been very influential in adding an opinion to the language; jquery by adding a kind of namespacing and scoping (also thanks to its predecessors / peers like YUI), NodeJS by adopting a module system (CommonJS) and centralized dependency management (NPM).

I came into JS via Java and while the lack of standards and rules / expectations was liberating, I was also missing it. It took a while before the best practices of Java made it into Javascript; in my experience, AngularJS was a big push for that, in that it was a much more opinionated way to structure your components and application - with a strong emphasis on (unit) testability.

Re:Old Code Gets Younger Every Year by bobthepanda on Monday June 08, 2020 @07:07PM (#23461769)
This is mostly because there is not really a formal way of learning webdev, which is both a strength and a curse. JS's closest thing to a prescriptive and authoritative guide to do things is the MDN, which isn't very prescriptive at all; there's certainly nothing like the C programming book, or even contenders equivalent to something like a Headfirst Java book. If you want strong direction and strong opinions JS does not have an overly dominant one unless you pick something that starts off with its own ecosystem like React.

Asking for something on vanilla JS is like asking for an "original" English copy of the Bible, whatever that means.

Re:Old Code Gets Younger Every Year by bena on Monday June 08, 2020 @07:50PM (#23462097)
I think the inclusiveness of the statement is the issue. He didn't say "the majority of the people writing JavaScript", he implied all of them.

I'm sure there's a lot of people who are writing decent JavaScript. But running JavaScript is easy. Every single computer comes with a JavaScript development environment. Because all you need is a text editor and a web browser. The barrier to entry is so low it might as well be non-existent.

So a lot of people with no clue of what they're doing will get in there and write some atrocious code.

Re:Old Code Gets Younger Every Year by quickthrower2 on Monday June 08, 2020 @06:42PM (#23461598)
Vanilla JS for UI work is like using Windows Forms (the Microsoft tech from 2002 for building windows UI in .NET). Unless you want something pretty basic, you are going to be writing your own frameworks. Maybe not a bad thing from a learning perspective, but I'd prefer a battle tested framework in general.
Re:Old Code Gets Younger Every Year by jagged-chisel on Monday June 08, 2020 @04:28PM (#23460409)
I'm interested in your take wrt to the dependency hell GP mentions.
Re:Old Code Gets Younger Every Year by brundolf on Monday June 08, 2020 @04:39PM (#23460507)
Personally, I:

1) Keep my direct dependency list slim and mostly limited to "too big to fail" projects backed by major companies

2) Avoid frameworks in favor of libraries

I don't stress about indirect dependencies. If one of React's dependencies stops being maintained, or has a security problem or a bug, Facebook isn't going to not address it. Far too much money is riding on React as a whole, so whether they have to switch to a new dependency, or update the version, or reimplement the functionality themselves, they will. On top of this, the left-pad catastrophe can't happen again, because NPM publications are now impossible to remove after 72 hours: https://docs.npmjs.com/cli/unpublish

On the other hand I'm not going to add a direct dependency that I don't truly need. If it's a one-off function that I can write myself, or copy, I'll do so. On time I copied and pasted Lodash's debounce function into my codebase because that was all I needed, and I didn't want to bring in the whole library.

Libraries, compared with frameworks, are easier to predict, to fill gaps in, and to replace if necessary. And even some things that we call ""frameworks"" like React can really be used as libraries. If you only use React as a rendering layer - what it's best at anyway - it actually has a very thin and elegant boundary with your code: you construct a data structure, and you hand it off. Others, like Angular and Aurelia, are truly frameworks and I tend to avoid them as a result.

I wrote a blog post recently about the libraries/frameworks thing which got some attention/discussion here on HN: http://www.brandonsmith.ninja/blog/libraries-not-frameworks

Re:Old Code Gets Younger Every Year by speedgoose on Monday June 08, 2020 @04:50PM (#23460630)
There is a NPM package lodash.debounce if you only want this feature from lodash. Lodash is available splitted in many small packages.
Re:Old Code Gets Younger Every Year by _bxg1 on Monday June 08, 2020 @04:54PM (#23460682)
The point remains, though, that I avoided an unnecessary dependency. I copied that function once and never needed to mess with it again, because it was 15 lines and I could verify personally that it did what it needed to do.

For contrast, we wanted to be able to incorporate new versions of React, because it isn't a simple enough thing that it can be written once and be done. It evolved, and offered real improvements in terms of performance and useful features.

As in all things, there are costs and benefits to making something an external dependency or not. The key is to realize that there are indeed tradeoffs, and that outsourcing every single thing you can isn't necessarily ideal.

Re:Old Code Gets Younger Every Year by entropicdrifter on Monday June 08, 2020 @05:00PM (#23460748)
Right, but his point about that was essentially:

"Why depend on that as a dependency rather than just have a copy directly in my project that I know will never behave any differently?"

Re:Old Code Gets Younger Every Year by speedgoose on Monday June 08, 2020 @05:29PM (#23461026)
Because it's one line to a dependency with a name, a documentation, a bug tracker, many users, and that could be improved in the future.

If you are scared about packages behaving differently, you should know that npm has lock files that describes your full dependency tree with versions and checksums.

Re:Old Code Gets Younger Every Year by majormajor on Monday June 08, 2020 @05:53PM (#23461220)
"Could be improved in the future" is a risk when it comes to a simple utility function that does a simple thing that you don't want to change.

In the same way that someone constantly tweaking your utility functions in your own project would be a risk - and you'd understandably want to code review all that - the more you choose to (or have to) outsource "trivial" stuff, the more brittle your project is.

Re:Old Code Gets Younger Every Year by ioseph on Monday June 08, 2020 @09:16PM (#23462617)
Hence the lockfile, on the flipside if you've copy and pasted source across which contains a security update you'll most likely not realise
Re:Old Code Gets Younger Every Year by snovv_crash on Monday June 08, 2020 @05:42PM (#23461124)
In any other package ecosystem you'd be laughed out of the room for suggesting to add a dependency for a 15 line function, instead of just copying it into your codebase. And the 15 line function here is a fairly major function. People add dependencies for 2 or 1 line functions!
Re:Old Code Gets Younger Every Year by elagost on Monday June 08, 2020 @05:39PM (#23461089)
"one of React's dependencies"

Which one? There are... several. (someone posted this here a while ago, and it's lovely to look at)

http://npm.anvaka.com/#/view/2d/react-native

Re:Old Code Gets Younger Every Year by williamdclt on Monday June 08, 2020 @06:52PM (#23461667)
That's react-native. React (http://npm.anvaka.com/#/view/2d/react) does have... several: 5 of them.
Re:Old Code Gets Younger Every Year by elagost on Monday June 08, 2020 @09:20PM (#23462644)
Guess I'm wrong then! Thanks for the correction.
Re:Old Code Gets Younger Every Year by _bxg1 on Monday June 08, 2020 @05:55PM (#23461239)
The point is that it's not my problem. Those things, together, comprise "React" as far as my application is concerned. React being a huge project which millions of dollars have been poured into, and which billions of dollars probably ride on, is going to be kept working, one way or another. As long as it continues to provide a functioning interface for my code, that's all I care about.
Re:Old Code Gets Younger Every Year by noobermin on Monday June 08, 2020 @06:33PM (#23461540)
The problem isn't just what you see, the problem is sustainability for the whole ecosystem as a whole. FB has a lot of money but how do you know they won't determine at some point this is not sustainable and in two years you have to learn some other framework?
Re:Old Code Gets Younger Every Year by _bxg1 on Monday June 08, 2020 @06:38PM (#23461573)
I don't know if you realize how massive the React user-base is at this point. That would be like saying, "how do you know they won't determine at some point python is not sustainable and in two years you have to learn some other language?" I mean, I guess. But even in that scenario, I'm sure the hundreds of companies who depend on it would pick up the slack.
Re:Old Code Gets Younger Every Year by wolco on Monday June 08, 2020 @08:26PM (#23462325)
It happened to Angularjs. It didn't die just stopped evolving in the 1.x branch. Everyone had to accept 2.x or move on or stop evolving.
Re:Old Code Gets Younger Every Year by frosted-flakes on Monday June 08, 2020 @05:59PM (#23461284)
That React has a lot of dependencies isn't a problem in itself. At this point, React is stable. It's backed and relied upon by a gigantic company called Facebook. It's used by millions of developers around the world.

If there's a major problem with one of React's dependencies, it will be promptly fixed.

Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @09:44PM (#23462795)
React doesn't have a lot of dependencies. The person you are responding to linked to React Native, which is an entirely different thing.

I think it's a bit misguided to think that code quality won't be visible to users. As someone who has used both React and React Native, the quality of these two projects from a user perspective is worlds apart, and I have little doubt that their different approaches to dependencies are partly to blame for that.

Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @09:39PM (#23462765)
That's not React, that's React Native.
Re:Old Code Gets Younger Every Year by Mandatum on Monday June 08, 2020 @07:32PM (#23461963)
I cut my teeth on VB6. Then PHP, .NET and finally Java.

I look back at all the code I wrote.. And it's all bad. Except anything I wrote 2 weeks ago, that was my crowning achievement. In 2 months I'll hate it, but right now - it's perfect.

Re:Old Code Gets Younger Every Year by fulafel on Monday June 08, 2020 @05:07PM (#23460819)
Another perspective: It's nice that there are many nicer languages that target JS, besides the fairly new TypeScript there's ClojureScript, ReasonML, Elm, CoffeeScript, Dart, Haxe etc etc.
Re:Old Code Gets Younger Every Year by mrlala on Monday June 08, 2020 @05:07PM (#23460826)
But, but, but, if you don't write in C and manage your memory you are not a real programmer! Says slashdot/HN...
Re:Old Code Gets Younger Every Year by vturner on Monday June 08, 2020 @03:38PM (#23459948)
Recently came back to a React GUI at work. Doing the Docker build is almost comical as the npm red text rolls by :). You would think the thing is surely going to explode. Of course, when you run the app React reminds us of all the new best practices which were non existant 6, 8 months ago
Re:Old Code Gets Younger Every Year by zackify on Monday June 08, 2020 @03:45PM (#23460014)
I’ve got a 5 year old react app that still gets worked on just fine. It doesn’t need every new state management library.

The problem with JS isn’t the major frameworks. It’s people that complain about how many packages exist. This is a consequence of its popularity. Take some time to use the language more, and you won’t be installing packages that are out of date in a month.

Re:Old Code Gets Younger Every Year by nicbou on Tuesday June 09, 2020 @05:29AM (#23465091)
The packages aren't directly installed by you. They're installed as dependencies of the frameworks you use.
Re:Old Code Gets Younger Every Year by Scottopherson on Monday June 08, 2020 @04:02PM (#23460158)
Almost every comment thread, regardless of topic, has someone shitting on front-end developers and it's extremely demoralizing.
Re:Old Code Gets Younger Every Year by Sophistifunk on Monday June 08, 2020 @09:26PM (#23462676)
If you read that GP post as a personal attack, you might be identifying with your tools. We all do it sometimes, but it's something we should keep an eye out for because it's IMO the most toxic part of programmer culture, and a big part of what's holding us back.

Almost all of my programming time these days is JS, and I've been doing JS as long as anybody. I know what I'm on about, and I can tell you the JS+NPM ecosystem as a whole is a hot mess. GP is not some crazy person with no idea what they're on about. Well, they might be, but you can't tell from that post :)

Re:Old Code Gets Younger Every Year by pldr1234 on Tuesday June 09, 2020 @01:59AM (#23464100)
Please re-read the GP carefully: "The primary reason for this is because the people writing JavaScript do not know what they are doing".

If that isn't a personal attack on a particular group of developers, then I'm not sure what constitutes personal attacks.

Also, as a top-flight engineer working in a multi-billion company (and also having worked with Java and .net professionally for many years), the JS/TS ecosystem as a whole has never been better than it is today.

And TS remains my lang of choice today, for professional and personal projects :)

Re:Old Code Gets Younger Every Year by kerkeslager on Monday June 08, 2020 @11:07PM (#23463236)
I think it's important to realize that these criticisms are primarily leveled at Javascript and its ecosystem, not at front-end developers, who have to work in that ecosystem. It's possible to write good code in a crap ecosystem. You aren't your tools, don't take it personally when your tools get criticized.

I've written some scathing things here and elsewhere about JavaScript. Does that mean I think everyone who writes JS is a crappy programmer? Of course not--I write JavaScript myself every day. I criticize Javascript because I write a lot of it.

Re:Old Code Gets Younger Every Year by mikekchar on Tuesday June 09, 2020 @12:07AM (#23463542)
On the other hand, true criticisms of Javascript, the language, are boring. Yeah, there are problems. You learn to deal with those problems. They aren't really that horrible. I worked with a lot of less convenient languages than JS (especially ES6, which is actually not bad). The standard library is pretty bad, but the language itself is easy enough to use that it's pretty trivial to implement what you need yourself. There are also a few pretty well written third party libraries with no other dependencies which you can use. The build environment is horrible, but not really any more horrible than some other environments I've had to deal with.

No, the real problem is that a lot of Javascript developers choose to stick hot pokers in their eyes. They don't read the code of their dependencies. They don't care how many ridiculous dependencies of dependencies they use. They refuse (absolutely refuse, to the point of calling you an imbecile if you even suggest it) to write their own tools. They choose the build tools that are the most wonky and are built on the most insane internal code -- because they don't care to ever look at that code. They look at the "box features" and say, "Oh, everyone is using that and it has all the features we want. You are crazy if you want that stupid boring thing that barely does anything (and yet works)". They don't do any planning for configuration management. They don't think about how they want to upgrade their dependencies, and especially don't dare think about inspecting the code in the dependencies. "Latest is best! If it breaks, we'll deal with it then".

Javascript is not really that bad. It really is that the community does not have a particularly good grasp on how to minimise risk in large projects. On the other hand, it's a common refrain on other platforms. While Javascript is not really that bad, other platforms are considerably better and you can get away with really poor practices for a lot longer. Not that they won't absolutely kick your ass eventually -- it's just going to be a couple of years away when you have moved to another company at a higher pay scale.

Re:Old Code Gets Younger Every Year by kerkeslager on Wednesday June 10, 2020 @08:13AM (#23476207)
Yeah, I think you're hitting the nail on the head here. I'd go so far as to say that the language itself is actually better than C (in the sense that it's more intuitive and less error-prone). C has the excuse of age. But the C community has a culture of carefully designing architectures to minimize pain points and bugs, and avoid other pitfalls--and that was true 20 years ago when I started programming and C was a lot closer to as old as JS is now.

As I've said elsewhere, you can write good code in bad ecosystems, and some people are doing amazing things in JS.

Re:Old Code Gets Younger Every Year by bcrosby95 on Monday June 08, 2020 @06:34PM (#23461544)
I think it's because people grow to hate languages they merely dislike but are forced to use for a long period of time.

At least, that's why I hate Javascript. I don't care for it, and thanks to the web I basically had no other option for around a decade.

Re:Old Code Gets Younger Every Year by ptasker on Monday June 08, 2020 @04:53PM (#23460669)
Yup ignore it. Front-end dev is super complex these days! I started when it was just HTML/CSS. JavaScript dev these days is much more complex than some 'real' programming languages!
Re:Old Code Gets Younger Every Year by systematical on Tuesday June 09, 2020 @12:58AM (#23463793)
JavaScript wasn't too complex back in the HTML/CSS days though. Lets be honest, we viewed it as a toy to sprinkle in some slick UI. Then some jQuery scripts started getting really out of control. Then I think ember and angular came out, or maybe it was backbone. Then things just kind of got more and more complex. Webpack is insane to learn. I finally took the time to learn it in isolation with es6, away from the heavy frameworks, and it wasn't so bad. But then when I look at using it with the heavy frameworks it makes me want to run for the hills.

I was playing around with puppeteer recently, which is a fantastic tool. It's perfect for what I needed. After I put together an ugly procedural proof of concept I wanted to figure out how to do things right and move it into classes. It's an adventure figuring out the right way to layout a project or even the right way to build a class. The fact that there isn't an authoritative answer tells me the eco-system is not mature or maybe I just didn't Google it right.

Meanwhile, PHP has https://www.php-fig.org/psr/. So anytime I can't remember how to name an Interface or an Abstract or anything really, I just google $blah + php psr. JavaScript is a shitshow that I have to live with, unfortunately. I know its funny coming from a guy that just used PHP as example for good language design, but at least the community has coalesced around standards...and composer > npm.

Its to the point now that I actively avoid making dynamic pages and SPAs AT ALL COSTS. It reduces the complexity of the code a ton that way. Thats not to say I haven't. I used VueJS for a big SPA because marketing wanted feature sets that required it. I fought it and lost. VueJS wasn't so bad, at least the learning curve was less than React, but SPAs are still terribad. Yuck.

Re:Old Code Gets Younger Every Year by speedgoose on Monday June 08, 2020 @04:09PM (#23460227)
I would suggest to ignore them. You read it 10 times and you are fine, it's always the same.
Re:Old Code Gets Younger Every Year by brlewis on Monday June 08, 2020 @04:24PM (#23460365)
> it's always the same

They're usually the same. This one forgot to flame about how the JS community is supposedly constantly reinventing things real programmers discovered decades ago. I think there's still time to edit that comment into conformance with the JS-bashing standard.

Re:Old Code Gets Younger Every Year by stormdennis on Monday June 08, 2020 @04:55PM (#23460700)
That's what it was like for VB developers in olden times.
Re:Old Code Gets Younger Every Year by hoorayimhelping on Monday June 08, 2020 @09:46PM (#23462811)
Do you get upset at other examples of people confirming their baiases? That's all comments like that are.

Anytime you see someone take a complex problem and flatten it down into a simple, single platitude that neatly solves the entire issue like this, (and also happens to reinforce a common belief) turn on your bullshit meter. Cause that's what it is.

There are absolutely issues with the node ecosystem and the dependencies and the quality of the software in that ecosystem. Is it because millions of engineers all don't know what they're doing and they're all idiots and they all happen to be using the same language, and they're all too stupid to realize it? Probably not, it's more likely that the person saying that is making an immature, emotional argument and lacks context.

Re:Old Code Gets Younger Every Year by perlgeek on Monday June 08, 2020 @04:50PM (#23460634)
Same happens with every article about Perl. Or PHP. Or any other technology that people love to hate.
Re:Old Code Gets Younger Every Year by hobofan on Monday June 08, 2020 @06:04PM (#23461321)
Shhh! This keeps everyone away from frontend work, and the rates for frontend freelancers high!
Re:Old Code Gets Younger Every Year by quickthrower2 on Monday June 08, 2020 @06:40PM (#23461584)
The rates for frontend are not high though.
Re:Old Code Gets Younger Every Year by 0xy on Monday June 08, 2020 @08:23PM (#23462308)
Really? Expert React developers are paid top of band in my current company. Someone who is -really- good at React is very hard to find.
Re:Old Code Gets Younger Every Year by quickthrower2 on Tuesday June 09, 2020 @07:37AM (#23465674)
They are hard to find but not hard to create :-)
Re:Old Code Gets Younger Every Year by quickthrower2 on Monday June 08, 2020 @08:29PM (#23462341)
Maybe a US thing then?
Re:Old Code Gets Younger Every Year by hobofan on Tuesday June 09, 2020 @01:59AM (#23464102)
I know that it's a thing in Berlin, where a big chunk of programming demand comes from creative agencies and similar, where frontend generally sells better to their clients.
Re:Old Code Gets Younger Every Year by corford on Monday June 08, 2020 @06:04PM (#23461318)
I've been programming since the late 90s and as recently as one or two years ago I would have agreed with a lot of this. However, having recently come back to JS and currently in the midst of developing a large, complex non-frontend app in it; I have to say the language, tooling, standards and ecosystem have jumped forward significantly.

It has honestly been a pleasure building this out. Yes, you still need to be selective about dependencies but that's the case for many languages. Beyond that, JS/Node in 2020 (in the right hands and for the right project) is pretty awesome.

Re:Old Code Gets Younger Every Year by dijit on Monday June 08, 2020 @06:10PM (#23461381)
The parent is not decrying developing things right now.

They are suggesting that what is built will not survive a very long time.

It would be more interesting if you had picked up a 3yr old project and could tell us your experience with that; failing this it would only be interesting if you come back in a few years to tell us how it is.

Re:Old Code Gets Younger Every Year by cmrdporcupine on Monday June 08, 2020 @07:29PM (#23461933)
Honestly what the post author is describing sounds about my experience with the Java + Maven deps world about 10 years ago when I last used it. A giant trail of dependencies of questionable quality (and how many problems with commons-logging?).

I have no desire to write JS, really, but it doesn't sound unfamiliar.

Re:Old Code Gets Younger Every Year by corford on Monday June 08, 2020 @06:15PM (#23461413)
>They are suggesting that what is built will not survive a very long time.

I suspect that thanks to the recent jumps forward (language itself, common best practices, tooling) that this argument doesn't hold as much weight as it once did. I see a lot of JS library code today that looks eminently supportable and survivable beyond a ~3yr time horizon.

Re:Old Code Gets Younger Every Year by dijit on Monday June 08, 2020 @06:39PM (#23461575)
I would like to agree, but given that we have no evidence for this and a history that has not supported this assertion- we cannot make that claim.

Only time will tell.

Re:Old Code Gets Younger Every Year by quonn on Monday June 08, 2020 @05:49PM (#23461201)
> In my experience, JS code has a life expectancy of about a year and a half.

Maybe for toy projects. I‘m working on projects that take years to build and are around for many years.

There are problems with JS but with TypeScript and React I find it more maintainable and robust than other languages.

The worst project I‘ve worked on in the last few years had 800k lines of C# around a C++ core from the early 90s. It was terrible to work with and far worse than anything I‘ve seen in the Javascript world.

Re:Old Code Gets Younger Every Year by systematical on Tuesday June 09, 2020 @01:08AM (#23463830)
Probably because its nearly 40 years old now.... Find me when we have the first large scale JavaScript project that is forty years old.
Re:Old Code Gets Younger Every Year by chc on Monday June 08, 2020 @04:20PM (#23460326)
I think "a few years" is a bit of an understatement. CoffeeScript came out one year after Google Chrome, in the heyday of Ruby on Rails. The entire web development landscape has shifted a lot since then.
Re:Old Code Gets Younger Every Year by mywittyname on Monday June 08, 2020 @04:57PM (#23460723)
That kind of supports the parent comment. RoR is not even that old and, "the development landscape has shifted a lot since then."
Re:Old Code Gets Younger Every Year by chc on Monday June 08, 2020 @05:21PM (#23460957)
It would support the parent comment if the point of the parent comment had been something like "The state of the web has changed a lot since 2005," but it wasn't. The parent comment was specifically castigating the JavaScript ecosystem for having so much "churn" "because the people writing JavaScript do not know what they are doing." Ruby on Rails is not a JavaScript framework, so if there's been lots of change throughout the web ecosystem in same timeframe, how does showing the same trend reflect negatively on JavaScript developers in particular? It seems a bit like pointing to somebody in an earthquake and yelling at them to stop moving around.
Re:Old Code Gets Younger Every Year by majormajor on Monday June 08, 2020 @05:55PM (#23461249)
Yes, it was bad then, too. Doesn't seem like much of the Node ecosystem learned from that, though.

Rails projects were pretty famously brittle and painful to deal with for doing major upgrades.

I've moved to JVM-land and don't miss that part of working with Rails, though there are still things I miss about Ruby.

But everything my coworkers tell me about Node projects sounds like it's even worse than Rails was.

Re:Old Code Gets Younger Every Year by downerending on Monday June 08, 2020 @04:01PM (#23460154)
Ha. I've only had one experience with 'npm' (user requested install), and it went just like that. It seemed to want to install about 500 modules and just exploded half-way through.
Re:Old Code Gets Younger Every Year by noobermin on Monday June 08, 2020 @06:26PM (#23461496)
Not sure I understand this post. You say it isn't a problem for the future but then go on to say it is a problem.
Re:Old Code Gets Younger Every Year by samcodes on Monday June 08, 2020 @10:15PM (#23462976)
He’s saying it’s not a problem for the future, because that implies it’s not a problem now, which he asserts that it is. It’s humor
Re:Old Code Gets Younger Every Year by tengbretson on Monday June 08, 2020 @05:20PM (#23460937)
I used to think backbone was kind of cool! RIP I guess.
Re:Old Code Gets Younger Every Year by Cthulhu_ on Tuesday June 09, 2020 @05:03AM (#23464984)
It was, at the time - this was right before Angular, then React made a splash, but before those became mainstream, Backbone was a really good framework to be using.

Plus, both Angular and React kinda relied on the performance of JS engines becoming what they are nowadays.

Re:Old Code Gets Younger Every Year by skrebbel on Monday June 08, 2020 @06:30PM (#23461519)
I totally disagree but I just want to compliment you on a delightfully written comment. I laughed out loud multiple times.
Re:Old Code Gets Younger Every Year by sergiotapia on Monday June 08, 2020 @03:43PM (#23459994)
marionette, backbone, knockoutjs! lol the list is endless.

in 5 years, react??? who knows.

Re:Old Code Gets Younger Every Year by jcheng on Monday June 08, 2020 @05:03PM (#23460782)
In fairness, a lot has also changed/churned in Windows desktop UI development, iOS development, and Android development over the same time period. (I know a lot less about the latter two, but didn’t they at least both change languages and see the significant rise of PhoneGap/Titanium and then React Native and then Flutter?) And those are all ecosystems that, for better or worse, have a single dominant corporation lording over it.
Re:Old Code Gets Younger Every Year by viklove on Monday June 08, 2020 @04:04PM (#23460179)
I love seeing these opinions on HN, it means my job as a qualified JS dev is very, very secure. If you work at a place that has problems with npm deps, just understand that the problem is your team, not the ecosystem. Choose which tools you use, and choose carefully my friends.
Re:Old Code Gets Younger Every Year by mywittyname on Monday June 08, 2020 @05:02PM (#23460764)
Software developers have been rewriting legacy codebases since forever. My early career was spent bouncing in and out of projects that the customer deemed in need of a rewrite. If it was perl, it needed to be replaced with Java. When it was Java, it had to be replaced by Ruby. And now all the Ruby needs to be replaced with JS. Now that we are stuck with JS, devs are just finding new reasons to rewrite stuff.

PHP projects never seemed in need of a rewrite.

Re:Old Code Gets Younger Every Year by phist_mcgee on Monday June 08, 2020 @09:17PM (#23462619)
That last line! Oh boy have I seen some PHP projects rushed out that sure do live by the skin of their teeth. They really do need a rewrite.