Live data from Hacker News

You might not need JavaScript

youmightnotneedjs.com

241–250 of 254 posts

Re: You might not need JavaScript

#241

Earlier quoted context omitted.

Lazyness is a virtue for software engineers in my opinion.

Generally when I hear people talk about having imposter syndrome in software development, I feel like they're missing this key insight. The fastest code, and the easiest to maintain is the code that's never written. I've been trying to formulate how to express this idea to people who don't have it ie paraphrasing YAGNI: "Strive to optimize for less code, and the minimum level of abstraction."

"Strive to optimize for less code, and the minimum level of abstraction."

That should be the appropriate level of abstraction. The appropriate level of abstraction being that which requires the least code to implement and least effort to reason about.

Re: You might not need JavaScript

#242
post #206

Earlier quoted context omitted.

"They were using React to make 1 AJAX request to Foursquare." Did anyone get fired for that bit of programmer malpractice?

The parent comment is a freelancer. The code he corrected was almost certainly from another freelancer. And so the cycle of outsourced code continues.

Exactly this, but hey at least I know what I'm doing and the client is happy!

Re: You might not need JavaScript

#243
post #241

Earlier quoted context omitted.

Generally when I hear people talk about having imposter syndrome in software development, I feel like they're missing this key insight. The fastest code, and the easiest to maintain is the code that's never written. I've been trying to formulate how to express this idea to people who don't have it ie paraphrasing YAGNI: "Strive to optimize for less code, and the minimum level of abstraction."

"Strive to optimize for less code, and the minimum level of abstraction." That should be the appropriate level of abstraction. The appropriate level of abstraction being that which requires the least code to implement and least effort to reason about.

I think "appropriate" is highly subjective. The problem is developers seeking to impress their peers with over abstraction of trivial things. I personally think "minimal" is more "enforcable" ie easier to convey in a code review comment for example. Again, imo.

Re: You might not need JavaScript

#244

Earlier quoted context omitted.

Given "fetch" is not yet a standard, jQuery $.ajax is actually a decent cross-browser polyfill.

I've been out of the JS world for a few years, but for a single Ajax call, why wouldn't you use XMLHttpRequest?

jQuery ajax essentially is just a wrapper to XMLHttpRequest.

With some effort, the relevant jQuery methods that act as polyfills could be extracted.

However, a minified version of core jQuery is < 20Kb. A very low technical debt trade-off to support 99% of browsers.

Re: You might not need JavaScript

#245
post #94

Earlier quoted context omitted.

One is a server-side depencency and one is a client-side dependency. Don't conflate them.

SCSS isn't even server side, it's developer side. Your build pipeline can be ugly as sin, the client should never care.

Until you need to maintain it (small changes) or worse, (breaking) change it. I'm not going to trade a flexible js dep for a limited css trick.

Re: You might not need JavaScript

#246

Earlier quoted context omitted.

Given "fetch" is not yet a standard, jQuery $.ajax is actually a decent cross-browser polyfill.

Why would you care about IE8 - 9 or whatever other browser you might be thinking about that has probably an infinitesimal market share?

Because market share is only meaningful if you target consumers. If you write (internal or niche) web applications for e.g. schools, large companies, non-profits etc. legacy browsers can easily be > 30% of your targets.

Re: You might not need JavaScript

#248

When I was hired on the Watson team, the first thing they asked me to do was help improve performance of their AngularJS-based website. It was all-around slow, especially for the initial page view. I stripped out AngularJS and most of the other JavaScript, and published a website that was almost pure static HTML. It loaded very quickly. My manager thought it was hilarious - his "JavaScript expert" came in and deleted…

I just sent an email to my "favourite customer", recommending that they hire you!

Re: You might not need JavaScript

#249

Earlier quoted context omitted.

Actually you need a tiny bit more: http://bettermotherfuckingwebsite.com

And a very tiny bit of additional polish (which would make a good basis for, say, browser defaults), IMO, even better: https://codepen.io/dredmorbius/full/KpMqqB/ 14 style rulesets.

I think it would be better without the horizontal lines.
Post reply on HN