Live data from Hacker News

Do Not Follow JavaScript Trends

pragmaticpineapple.com

181–190 of 275 posts

Re: Do Not Follow JavaScript Trends

#181
post #147

I vividly remember 2016. I was doing backend programming at the time, but no one I knew were using Angular.js at that time for new codebases. React emerged in 2013, by 2014 the hype was at full swing, and by 2015 React "won" the framework battle. It's been 5+ years since then, and React JavaScript world was remarkably stable. Fashion changes were largely superficial: React.createClass vs ES classes, Heavy use of Deco…

You make it sound like we're all using React and that's all there is to it. That's not quite true, and it's just one of the choices you have to make. So you've decided on React, but what about state management, transpilation, do you use GraphQL? What am I doing for styles, should I write them in Javascript too now? Oh no! Webpack isn't for me! Can I use modules yet? Ah bugger, we need SSR, suppose I should have manag…

I even got fatigued reading your list of choices and you even missed critical choice such as flavor of SSR.

Re: Do Not Follow JavaScript Trends

#182

Earlier quoted context omitted.

I'm just now getting back into webdev after 3 years. Can you please recommend a good tutorial/demo using Hooks? Especially if it's using Typescript! I strongly dislike the create-react-app project because it abstracts everything away.

For react hooks: the base results are decent, for that particular search phrase. You won't go wrong with the reactjs docs, prominently placed there. https://reactjs.org/docs/hooks-intro.html For react hooks typescript: sorry, I can't. This is a pretty good example of the problem, because I just searched Google's first page of results for react hooks typescript tutuorial, and they were all bad. 3 of very top results s…

There is an excellent community resource on using React with TypeScript here:

https://github.com/typescript-cheatsheets/react-typescript-c...

Re: Do Not Follow JavaScript Trends

#183

Earlier quoted context omitted.

What do you mean, everyone is now updating their codebases to remove redux, HoF and switch to hooks.

No, people are realizing that they were just using redux as a caching layer and the boilerplate associated with it wasn't worth it when there are better approaches to caching local data now.

What do you believe people are replacing it with? Hooks?

Re: Do Not Follow JavaScript Trends

#184
post #101

I think either vanilla js, or the other route, a full blown batteries included, like Visual Basic 6 was for windows development. Either abstract away nothing, or everything. In the middle, is developing with a framework. The problem is you have to know the language + the peculiarities of the framework. New frameworks and "features" happen on too short a timeframe. And, frankly, it costs too little to just invent a ne…

Been a while for me, but I agree

But when I spent a year doing Javascript I found that in JQuery there were a lot of shortcuts I was writing my self to lower the RSI from typing long Javascript statements.

Beyond that there is nothing useful in JS frame works. They make simple things easy and the complicated stuff (which is design and logic) stays hard.

Re: Do Not Follow JavaScript Trends

#185

Didn't read. Follow JavaScript trends that make sense for you and your team. Ignore the noise, get shit done. You know what I hate more than "JS fatigue" - it's ppl complaining about "JS fatigue". Software evolves, and I'm always looking to bring a better experience for my users - and then means replacing components sometimes when there are clearly better alternatives, whether that is for developer experience, smalle…

Depends if you want your code to be maintainable into the future with other teams.

If you do not care about the future (which os OK in some contexts) then you are correct

Re: Do Not Follow JavaScript Trends

#186
post #118

Earlier quoted context omitted.

Rewrites only make sense if you get a multi-fold improvement. In the history of computing, that's rare. So they rarely make sense. Well, JavaScript was really horrible when it came out. It was just about the worst major programming language ever made. It sort of reminds me of an interpreter I threw together for a programming language I invented when I was in high school, when I really didn't get any aspect of program…

How about using Typescript? That still seems like a huge improvement, especially because you can implement it incrementally (aka for parts of code where type checking is vitally important). I'm using it now at my work and I'm surprised how much info I'm getting compared to whatever JS is throwing at me.

TypeScript? Erm... Not for me.

There were many such systems in the past. CoffeeScript was a big improvement over 2010 JavaScript. Before that was GWT, which was sooo much nicer than 2006-era JavaScript. I could list a bunch of others. If you used any of them, you're now stuck with a legacy system(+), and you'll find fewer and fewer people able to read/write your code, and otherwise.

I'm also not a big fan of static typing. And if you do static typing, you should at least do it properly, which is not what TypeScript does.

Types should be things like "This is an integer between 0 and 100," "Meters/second," or similar. We've known this for a long time. Ada is now 40 years old and was mandated for military work since if you added feet and inches without a conversion, that was a problem, and that resulted in more robust systems (TypeScript would make them both of type "number" and never catch the error). If you tried to have 120% of your fuel tank full, you'd violate an assertion as well. Those were turned on in dev and in your test suite (but generally turned off in your deployment system, which was running on a 33MHz CPU if you were lucky).

C++ templates let you define things like "This is a list of lengths, in meters." Duck types languages like Python won't do this statically, but it's easy enough to do dynamically; while you won't catch errors at compile-time, at run-time, you'll get a clear exception.

(+) Standard disclaimers apply.

Re: Do Not Follow JavaScript Trends

#187
post #31

tl;dr: use TypeScript, but don't worry so much about hooks. --- I recently switched my JS + PureComponent mobile app to TypeScript and FC Hooks. I felt motivated to do so because: - You cannot use hooks in PureComponent render(). The two modalities do not play nice together. - Many of the libraries I use like react-spring and react-navigation have fully embraced hooks, sometimes without an HOC equivalent. So I felt f…

I was initially kind of worried about TS. It has kind of a high barrier to entry with linter settings, typescript-specific setting, solving how to compile your code easily, learning the new syntax, etc. etc. I literally spent like an hour reading up on it and learning it, and I realized I never want to go back to a plain old JS. TS feels way closer to Java than to JavaScript, with its own quirks and way of functionin…

"I wonder what are the cons of "TS.

I would like to know too. Sounds too good to be true....

Re: Do Not Follow JavaScript Trends

#188

Earlier quoted context omitted.

What do you mean, everyone is now updating their codebases to remove redux, HoF and switch to hooks.

No, people are realizing that they were just using redux as a caching layer and the boilerplate associated with it wasn't worth it when there are better approaches to caching local data now.

I disagree. Redux has a lot of icky boilerplate, but the Flux pattern, and variations of it, are useful. You're either using Redux, something like Redux (context hooks, possibly), or you are passing single variables through 3 or more layers of spaghetti.

Re: Do Not Follow JavaScript Trends

#189
post #142

Earlier quoted context omitted.

Yeah; I think your timeline is off. I don't remember React being the very clear choice until probably 2017. It was still up in the air in 2016, and certainly moreso in 2015. > by 2015 React "won" the framework battle. Things have calmed down now. Its better, and has been for a couple years (not 5+ years). But, this isn't a battle. Its not a war. Just because things are calm now, doesn't mean they won't go crazy again…

"I don't remember React being the very clear choice until probably 2017." Maybe you werent paying attention then.

CSS Modules didn't become the default way to go until sometime in 2016. Before that point people were still stumbling over how to manage their CSS in a component-oriented fashion, and it was only once that happened did React "win".

Re: Do Not Follow JavaScript Trends

#190

Earlier quoted context omitted.

For react hooks: the base results are decent, for that particular search phrase. You won't go wrong with the reactjs docs, prominently placed there. https://reactjs.org/docs/hooks-intro.html For react hooks typescript: sorry, I can't. This is a pretty good example of the problem, because I just searched Google's first page of results for react hooks typescript tutuorial, and they were all bad. 3 of very top results s…

There is an excellent community resource on using React with TypeScript here: https://github.com/typescript-cheatsheets/react-typescript-c...

Thank you! Much better answer - I'd now recommend this.
Post reply on HN