Live data from Hacker News

The other kind of JavaScript fatigue

chrismm.com

91–99 of 99 posts

Re: The other kind of JavaScript fatigue

#91
post #69

Earlier quoted context omitted.

I've seen people change Java code in production to fix a bug and recompile it. This is hardly a behavior that exists only in dynamic languages.

That's a different issue entirely. The article is talking about the quality of frameworks and libraries in JS.

Perhaps, but I was replying to the parent comment, which did talk about dynamic languages and copy paste code to production.

Re: The other kind of JavaScript fatigue

#92

Earlier quoted context omitted.

> Next, the dynamic nature of JavaScript is to blame. You can't easily extract and compile just the functions you need. Definitely check out rollup, if you haven't heard of it. We (the JavaScript community) are working towards solving this!

Thanks for the tip, rollup looks really powerful. This and related comments remind me that the latest ECMA stuff offers a brighter future. The challenge is getting there... Can/will jQuery work with rollup and all the other new module work? Or does it have to be effectively rewritten?

It needs to be rewritten, unfortunately. However this isn't just rewriting it so it works with one tool, since this is the new module syntax. I imagine that a future version of jQuery, and probably most libraries going forward, will want to take advantage of ES2015 modules, even if it's just to aid in their own internal development. Since we have module bundlers like rollup, it would be easy to still provide an ES5 bundle for environments that do not use ES2015 modules yet.

Re: The other kind of JavaScript fatigue

#93

Earlier quoted context omitted.

Agreed. Transpilers are saving you nerves initially at the expense of making you want to commit suicide later. Like when you need to debug in real time, or check underlying "native" objects, or when a library the transpiler is relying on has a bug. IMO transpilers are a Faustian deal. That's what my experience has taught me, your mileage may vary of course.

I disagree. I have been developing an IONIC application with JSweet. My experience is that when I want to refactor the code (for example, just renaming the data objects because the customer changes its mind about how to name something), then you are happy to have JSweet and you can make the code up-to-date in no time. The more the application gets complex, the better it is to have a transpiler to help you update your…

I know nothing about JSweet but I have a 7-8 years of Java background and I can tell you right now that nothing in the Java world is a magic bullet.

But I am not here to argue specific examples. Sure, I definitely agree with you that Javascript is the worst offender in the transpiler world. I do however not see the connection between using a transpiler and having it easy when refactoring. If you mean that the transpiled language has an easier to parse AST and is thus much more prone to automated refactoring (Eclipse's "Rename Method" for example), I won't argue that; I know it can be true.

Nothing of what I said will stop me from trying Elm (transpiled to JS) for a hobby project though.

Re: The other kind of JavaScript fatigue

#94

There is another upside to modules being easy to make and publish - they are also easy to change. The query parser you want isn't able to handle nested objects and arrays easily - fork it, add your small piece of code (to what is hopefully an already small module), use it with a direct reference in your package.json, send a pull request upstream. The fact that libraries don't handle your specific edge case/ special n…

I've fixed a couple of things in tiny modules. A great experience to get started on open source contributions.

Js has fragmentation but what do you expect with the largest repo of packages?

Re: The other kind of JavaScript fatigue

#95

Earlier quoted context omitted.

I disagree. I have been developing an IONIC application with JSweet. My experience is that when I want to refactor the code (for example, just renaming the data objects because the customer changes its mind about how to name something), then you are happy to have JSweet and you can make the code up-to-date in no time. The more the application gets complex, the better it is to have a transpiler to help you update your…

I know nothing about JSweet but I have a 7-8 years of Java background and I can tell you right now that nothing in the Java world is a magic bullet. But I am not here to argue specific examples. Sure, I definitely agree with you that Javascript is the worst offender in the transpiler world. I do however not see the connection between using a transpiler and having it easy when refactoring. If you mean that the transpi…

JSweet is not a magic bullet in the Java world, because JSweet is not Java. JSweet borrows the Java syntax to have well-typed JavaScript. Of course, not all transpilers have a focus on typing and not all of them have great tooling to back refactoring (not only renaming... you have plenty of other kind of help you will get when using a good Java IDE). But the focus of JSweet is typing and tooling (through Java).

I think that Christian Maioli Mackeprang is right. Some languages focus on instant productivity. They are really good and powerful to sketch a program in a few lines of code. But this quality comes at the expense of other important features that are really important for a language/development environment. People need to consider this or we will end up with poor programming environments and languages that are great for prototyping, but that don't scale up for complexity...

Re: The other kind of JavaScript fatigue

#96
post #74

Earlier quoted context omitted.

No by URL I meant the URL of the service that would provide the autocomplete or the validation. Like:

I'm not sure how either of these would help: - validation: Fundamentally, to be able to trust the input, the server needs to validate it in its final state. The only reason validation should be done on the client is to reduce the latency from the time the user inputs the data to the time the validation result is reported, so the user can fix their input faster if it fails validation. Sending it to a URL before form s…

Being faster is not the point. Having to rely less on javascript libraries and more on the built in framework in the point.

And client side validation is not a substitute for server side validation, merely a better UX.

Re: The other kind of JavaScript fatigue

#97
post #56
post #32

Earlier quoted context omitted.

I think it's rather that the java and .net framework are pretty good out of the box. So there is only a need for additional framework for certain corner cases. And then some get bought by Microsoft and integrated out of the box, like the datavisualization libraries or xamarin. JavaScript on the other side is a language that only its conceptor could love. All these frameworks are sort of required to be barely producti…

Javascript has a terrible embarrassment of a standard library. Things that should just be baked into the language are not, which has lead to attempts to rectify that shortcoming, like jQuery, Underscore and LoDash. Because this standard library isn't implemented in the browser itself, where it belongs, people have gotten upset about downloading a few hundred kbs of a general purpose utility library, and instead reimp…

FWIW - The new ES2015 spec has a lot of features baked into the runtime which otherwise would have to be handled by underscore. - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Of course, its not exhaustive by any means. But your general everyday stuff is covered.

Re: The other kind of JavaScript fatigue

#98
post #25

One factor that leads to fragmentation is this "theme" that I seem to see over and over that when a project is popular the creator gets to be the github maintainer and take credit for it's success as a large and popular project, which by itself is a good thing. The bad part is that when the maintainers make unpopular decisions like disabling all functionality by default and relying on submodules, or not wanting to fi…

Not sure, whether you saw this or not. But there has been some effort on this front - https://github.com/jashkenas/underscore/issues/2182

Re: The other kind of JavaScript fatigue

#99
post #18

I blame Github, in particular its "stars" feature. It makes putting out code a popularity contest. "Why should I make someone else's project more popular? I'd rather spend my free time making myself popular."

That seems very selfish to me.

If you like someone else's code and it has helped you out in a difficult situation, why won't you star that project ? Sure, you can choose to spend your free time in whatever way you feel like. But I think contributing to other repos, fixing bugs is what the community is all about.

Post reply on HN