Hacker Newsnew | past | comments | ask | show | jobs | submit | cbaleanu's commentslogin

And we were all staring at the blinkenlights too.


Please mark as [pdf]


I have just upvoted this for you as I also loved the article :)


I have to use an Oracle product for timesheets and besides the UI which is as you can imagine reading the previous comments, contains javascript code for a 'finite state machine for controlling the notification popup component'... [edit: typo]


And that is why HN is my favorite part of the net for about a decade now :)


I get a 403 as well, no point in linking to something unaccessible just because reasons. Gdpr is hard but people in Europe should not be denied access just for the sake of immutable URIs


Wait what? https://web.archive.org is inaccessible to you because you are European? FWIW: I am European, and it works for me.


Me and my team are happy users of keycloak[0] running in a docker swarm, pretty nice so far anf very good documentation. Building your own authorization/authentication solution is really nice as you learn a lot, but there is a lot of work involved. [0] https://github.com/keycloak/keycloak


Sorry but your facts are just wrong. Angular2 was announced in late 2014, just about the time when angular 1 was becoming mainstream used by big banks and the like. Look at Microsoft's blog from early 2015 announcing the use of typescript in Angular2. Linking some generic website does not make your comment less toxic and I would strongly suggest you get your facts right before posting stuff like that here.


When I first joined my local photographer's club, one of the masters there told me that I need to accept that all the photos I will take will have been probably already shot by someone else. Obviously not that realistic, but articles like this sure make it sound more plausible.


> all the photos I will take will have been probably already shot by someone else

> Obviously not that realistic

Depends on how literally you want to take it. Lighthouses have definitely been photographed before. Photos depicting the man vs wild nature archetype too.


Bad article, the author should have indeed put some more time into understanding what he is writing about.

  var firstTeenager = people.find(teenager)
Stuff like this, when you write about ES6 features but use var makes my eyes hurt :(


I agree that the article needs some work, but there really is nothing wrong with still using var. I'm in the Kyle Simpson camp and just use var for everything except if I'm actually creating a constant or block scoping comes into play or I need to prevent the hoisting of a variable. That way, it's clear what I'm doing and what my intentions are.


> That way, it's clear what I'm doing and what my intentions are.

It's the exact opposite since you're defaulting to the most permissive binding style.

Defaulting to `const` would actually make it clear what your intent is: you use `let` if you need mutable bindings and you use `var` if you need hoisting.

If you default to `var` your intent is apparently to make use of mutable bindings and hoisting everywhere, at which point I can only expect that you put your variable declarations at the bottom of your function blocks after the `return` statement.


Defaulting to const does nothing. If you or someone else decides later that it should be reassignable, then they'll change it and not think about it. If const is rare in your code, people will be aware of what const means in that context.

If you're putting your variable declarations after your return statement, then you probably have other problems. I also don't know why you would ever expect someone to do that.


> Defaulting to const does nothing. If you or someone else decides later that it should be reassignable, then they'll change it and not think about it.

Which they'll do regardless. `const` is an indication that the binding is not updated in the rest of the scope and thus that said scope can be perused without needing to consider an update to the binding itself. It is a guarantee of SSA, nothing more and nothing less.

> If const is rare in your code, people will be aware of what const means in that context.

The same as above which you apparently assert is "nothing"?

> If you're putting your variable declarations after your return statement

Why would I do that? I'm not adamantly using `var` when I have no reason to.


If everything is a constant then nothing is a constant.

Code bases change and some things that a coder did not foresee needing to be reassignable may later need to be reassignable. There aren't frequent cases that switching them becomes a problem, and as a result, people switch them. Since they do get switched so often, people stop thinking about when it really matters or if there was some intent to it originally being written that way. If everything is a constant, then the cases where it matters and the cases where it doesn't get blended together and it's impossible to differentiate the two.

When real, true constants are the only things declared with const, then it's abundantly clear what the intention of the coder was and that the value should never be changed nor should it ever be switched over to let/var.

Likewise with let, in the few cases where it's used it draws others' attention to the use of block scoping or the avoidance of hoisting. It's rare that those things really come into play, so the few cases where it's present really stand out.

tl;dr Block scoping and constants are the exception, not the DEFAULT, so you should write code accordingly.

> If you're putting your variable declarations after your return statement

What I meant here is that people shouldn't keep using var just so they can continue writing bad code.


> There aren't frequent cases […] Since they do get switched so often

They don't. In fact they almost never do.

> tl;dr Block scoping and constants are the exception

That's literally the opposite of reality. Constant bindings (single-assignment) and block-scoped bindings are by far the most common state of affairs even if not formally stated.

> What I meant here is that people shouldn't keep using var just so they can continue writing bad code.

Maybe you should tell the you of two comments ago who's apparently arguing for exactly that?


What's with the hostility? I'm just trying to express my opinion. You can disagree and state your point without being insulting.

Sure, when I say frequent, I don't mean its happening all the time all over the place, I just means it can and does happen without consequence. Block scoping and constants, in the sense that it's important that they're block scoped and constant, are the exception. Most variables are single-assignment not out of necessity. And I bet most people think in function scope, regardless of how the compiler works.

It all still comes down to intent. If you're always defaulting to using const, your intention is not really showing through.


As an outside observer I have to say that they are not the one who came off as hostile.


I think a good case can be made that examples meant to illustrate a single new feature are better if the only new features they use are that one and any others that are necessary to make a reasonable example.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: