Live data from Hacker News

You might not need JavaScript

youmightnotneedjs.com

231–240 of 254 posts

Re: You might not need JavaScript

#231
post #225
post #211

Earlier quoted context omitted.

How would you suggest breaking out of that silo?

Start from scratch/plain ol html. Add dependencies as you need them and for very specific purposes rather than have them "just because"

Right, start with something simple, say a form and add client side validation to it. Move to making a small widget that updates with data obtained async using plain XHR. Add some styling with out preprocessors (so you know why they make life easier). Understand events and how they propagate etc. Learn a bit about the DOM and how to query it with built in apis. Etc...

Consult MDN (Mozilla developer network) and read their articles

Re: You might not need JavaScript

#232
post #156

Earlier quoted context omitted.

The first two were actually making a good point. This website (yours, presumably) is just jumping on the bandwagon and sticking an affiliate link in it. I'm not against affiliate links, but this site lacks substance.

HTTPS and full contrast text are important. The 2nd attempt is a downgrade from the first. This 3rd attempt is an actual improvement.

Honestly, I can't stand websites that decide to waste 70% of screen estate. I can see the first site almost without scrolling. It is 2 to 3 pages on the other iterations.

The only things I may agree with is https and zipping.

"Fits on all your shitty screens" Does mean that it FITS ON ALL YOUR SHITTY SCREENS. Mine is a 1920x1080 (which is the minimal nowadays) and the 2nd and third iterations DO NOT FIT IT.

That thing around the web page, it is called a fucking window. It resizes. I'll do that if I want your fucking column-format.

Re: You might not need JavaScript

#233
post #216

Earlier quoted context omitted.

"Here's another perspective. I started learning JS in reverse and ended up just creating my own framework because it was less verbose. But you would hire me over your patch-and-patch fellows?" Yes more likely. In fact I would find informative to see the framework that you have built as an example of understanding web development. To expand a bit I think learning the framework is easier once you have an understanding…

My framework looks like this: https://github.com/serprex/openEtG/blob/master/dom.js The code that uses it looks like this: https://github.com/serprex/openEtG/blob/master/views/MainMen... The site looks like this: http://etg.dek.im I recently worked on a site at my job where I was able to implement it with JS + C#/OWIN, all static html, only uses toastr/jquery. Was nice they let me break away from the illusion that th…

Seeing that code I would not hire you.

Re: You might not need JavaScript

#234

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?

Market share might be a ridiculously small percentage overall, but it's never appropriate to dismiss compatibility outright.

Reasons to include inefficient code for compatibility reasons might include applications where maximum reach is valuable, or where the scale is so large that the "infinitesimal market share" percentage plays out into thousands of end users.

Re: You might not need JavaScript

#235
post #48
post #5

It's sad that this site uses SCSS for displaying the rules, I'm using it in production and fully understand it, but it's needlessly abstracting the rules for the sake of a few extra words in each declaration. That aside, these are some pretty cool examples. Are there ways of doing this with CSS which doesn't screw with my browser back button?

I half agree with you, but one of the real benefits that SASS gives you here is making dependencies more obvious. A named variable like `$slider-height` is much clearer than a random number like `50px`. Yeah, you could put a comment next to every constant in the CSS, but I don't think that's clearer than the SASS alternative.

SCSS variables also make things FAR more maintainable. To change a color, you shouldn't have to change every single line where that color is used.

You update the value where your color variable is defined, and then each style declaration that uses the color variable receives the new value automatically.

Re: You might not need JavaScript

#236

Earlier quoted context omitted.

I've had interview candidates for frontend developer positions who only know how to build web pages using frameworks like Angular and React. They don't seem to understand how those frameworks work but essentially patch together a bunch of example online to get something going. It's truly unfortunate that many beginner web development tutorial introduce these technologies first in my view. Without giving new developer…

> only know how to build web pages using frameworks like Angular and React I've never been able to fathom how anybody can do that without understanding the foundation that it's built on. At the bare minimum, how the heck do these people troubleshoot errors? If you have so much as a typo in your code, Angular is going to give you a completely cryptic jQuery error message.

This is why I came to really dislike angular pretty quickly. Maybe it's just evidence that I suck at javascript, but I found it devilishly difficult to debug even seemingly simple issues. But the errors were not in jquery, they were in the maze of the digest cycle. But I agree, I have no idea how beginners manage when things fall off the happy path.

Re: You might not need JavaScript

#237

Earlier quoted context omitted.

Same here and it seems fucking amazing. I'm beginning to wonder how many more html-things like this I don't know about?

If this is your first time hearing about caniuse, then you likely also want to know about html5please.com as well; if you haven't already.

I use caniuse excessivly, I just hadn't heard about the pattern attribute. But thanks for the tip, html5please seems very nice!

Re: You might not need JavaScript

#238

Earlier quoted context omitted.

Same here and it seems fucking amazing. I'm beginning to wonder how many more html-things like this I don't know about?

May be worth perusing https://developer.mozilla.org/en-US/docs/Web/HTML/Element/in... for additional attributes that are native to the input field.

Seems like the pattern attribute is the only input attribute I've missed somehow.

Re: You might not need JavaScript

#239

Earlier quoted context omitted.

I think by now it's pretty safe to say most websites don't care about the tiny % of people using Tor or disabling JavaScript.

That doesn't make it laudable, or even defensible.

From a commercial point of view it kind of does. If the development costs exceeds the increased revenue it's not really worth it.

Re: You might not need JavaScript

#240
post #105

Earlier quoted context omitted.

Sure, but (unless their GUI is implemented with web technologies for some reason) they generally use native widgets, at least.

I've actually spent many hours trying to make them work. You should at least invest a little research time before making proclamations about how you imagine they work.

I now see that we're not really talking about alerts in the 'alert()' sense, but rather about the popups - which are not native widgets (which are better off non-modifiable, in my opinion).

My bad.

Do you know of any good reading material concerning these form validation popups?

From reading on MDN [0], they seem to be browser specific - like the Chrome connection tab [1] - but somewhat customisable via JS.

[0]: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Form...

[1]: https://blog.digicert.com/understanding-the-google-chrome-co...

Post reply on HN