Hacker News new | past | comments | ask | show | jobs | submit login

> But I don't work for a bakery -- I work for a large company with a complex tech stack writing web applications that will have to be maintained by some poor sucker long after I move on.

Or rewritten because the flavor of the month has changed.

>Tools like React/Angular, Webpack, and npm allow me to do that in a way I couldn't as little as 3-4 years ago.

What exactly couldn't you do 3-4 years ago that you can now?




The big shift has been from managing complexity to avoiding it where possible, encapsulating it when not. In my current favorite webstack, every logical view is abstracted behind an API (which happens to be a React Component). Internally, everything about that component is encapsulated -- the internal implementation, the sub-components, even the CSS thanks to CSS Modules. In fact, if I really had a reason to write a specific component in Angular or jQuery I would be able to: it's easy to embed non-React code inside React, and as long as it exposes a top-level React Component I'm hunky dory. I refer to React because that's my library of choice -- but you can say similar things about Angular and Aurelia.

This has only been something we've gotten right over the last few years. jQuery trampled all over the DOM, data-binding heavy frameworks like Backbone were impossible to reason about, Closure Library turned your Javascript into Java-flavored spaghetti, Coffeescript was basically Perl, and CSS was global by default. Now React lets me write perfectly performant abstractable code. Redux lets me manage state in a functional, reproducible way. Webpack supports CSS modules which let me write sane styles and code-splitting so I don't need to worry about managing resources. Typescript lets me write code that's safe and easy for others to consume. ES6 modules allow me to actually architect my codebase without shoving everything onto window. And the ringer is I'm not married to any of these technologies -- I can scalp out Redux for another data store, Typescript for Babel, go back to global CSS, etc.

Writing UI code is hard, and I'm not sure why some HN folks assume web developers are ignorant. Web apps are a HUGE hack, and it's funny to me that a forum dedicated to hackers has so many who shun it for that reason. It's not "flavor-of-the-month", it's finally making progress towards a really hard problem in really exciting ways.


Writing UI code is hard, and I'm not sure why some HN folks assume web developers are ignorant.

But it really isn't and the proof is HyperCard from the 1980s. It's only hard because you have made it hard, for no reason that anyone can fathom (apart perhaps from job security).


I'm very curious what kind of web apps you think people are building. HyperCard was great for demoware -- and if you were to try and make it into a real production-ready tool you'd get VBA.

Do you really think everybody -- from Android/iOS to Swing to qt to Web 2.0 -- just had no idea what they were doing?


> Writing UI code is hard, and I'm not sure why some HN folks assume web developers are ignorant.

Probably because every feature you listed was achievable before react.


I just want to hear your answer with one of those...

How did you do type checking before TypeScript (or the like) in JS? give me a real answer.......


I didn't, and you didn't mention type checking above.

One very common way though was to avoid the need for it altogether in javascript, by rendering html on the server.


That's a different poster, and I did mention it above.

What does server-side rendering have to do with Typescript? Are you advocating avoiding javascript all together?


Sorry, I missed that, I was replying to the parent comment only.

But yes, I do advocate avoiding javascript altogether whenever possible (which is more often than current trends). There were a number of other transpilers too, all of which were a pain and I don't see how typescript is going to improve on that.


I actually regret writing out such a detailed reply. Congratulations, you're a top HN troll.


Great answer. Sometimes I hate HN for people like above.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: