Live data from Hacker News

Bootstrap's maintainer hates the semicolon

github.com

101–110 of 137 posts

Re: Bootstrap's maintainer hates the semicolon

#101

Earlier quoted context omitted.

Maybe this kind of reasoning explains why their API is such garbage.

I agree. As some-one who has just finished with a large-ish project using bootstrap, I can say that one of the worst parts of it is its js api.

I almost regret my incendiary comment above. I made it first thing upon waking up... However, I was referring to the actual Twitter API, which seems to have frequent issues. If the Twitter engineering culture is based on a bunch of "because I like it this way" solutions rather than "because this is the right way to do it," it may explain some of what I perceive to be their shortcomings.

One should be self-expressive, but I don't think syntax is an opportunity to be so. Regardless of whether it works a certain way, there's very likely an objectively right way for it to be done.

Re: Bootstrap's maintainer hates the semicolon

#102
post #96
post #92

Earlier quoted context omitted.

It's probably less expensive to maintain, because programmers' brain reading the code while not having to parse the extra image information - which semicolons are, and they add a lot of clutter - gets less tired and in turn is less prone to make errors in other coding areas. I see two camps here - people who fear the unknown or come from semicolon-mandatory languages and can't get used to the semicolon-less style, an…

I try to assume good faith with HN comments, but this smells like a troll. In JavaScript, semicolons reduce ambiguity. Whether you know the semicolon rules in the language or not is immaterial to reducing ambiguity, similar to how defensive parenthesization is helpful regardless of whether you know the order of operations of a given language by heart. This is why the prevailing wisdom is to always use semicolons: pri…

> Do better.

exactly. be an evangelist, not a brogrammer.

Re: Bootstrap's maintainer hates the semicolon

#103
post #92
post #83

Earlier quoted context omitted.

And is therefore more expensive to maintain.

It's probably less expensive to maintain, because programmers' brain reading the code while not having to parse the extra image information - which semicolons are, and they add a lot of clutter - gets less tired and in turn is less prone to make errors in other coding areas. I see two camps here - people who fear the unknown or come from semicolon-mandatory languages and can't get used to the semicolon-less style, an…

It's probably less expensive to maintain, because programmers' brain reading the code while not having to parse the extra image information

In your estimation, is there a difference in experience between those JS coders who are knowledgeable of ASI and those who aren't?

Re: Bootstrap's maintainer hates the semicolon

#104
post #71

Earlier quoted context omitted.

This is utterly stupid. And the example he cites for why he prefers an odd function syntax doesn't cause errors..... if you use semicolons . JavaScript interpreters insert semicolons. If you abuse this, you'll end up with unpredictable results like his function example.

The results aren't unpredictable - they're specified exactly, which makes it safe to omit semicolons except where necessary. You might not know that the return statement is a restricted production, but you do know when you shouldn't immediately follow it with a linebreak. Similarly, if you see a line beginning with ( or [ which isn't a continuation of the statement on the previous line, stick a semicolon in front of…

Yes, it's specified, but you can avoid any confusion and make easier to read code by just using semicolons. It's what's called a "best practice".

Re: Bootstrap's maintainer hates the semicolon

#105
post #96
post #92

Earlier quoted context omitted.

It's probably less expensive to maintain, because programmers' brain reading the code while not having to parse the extra image information - which semicolons are, and they add a lot of clutter - gets less tired and in turn is less prone to make errors in other coding areas. I see two camps here - people who fear the unknown or come from semicolon-mandatory languages and can't get used to the semicolon-less style, an…

I try to assume good faith with HN comments, but this smells like a troll. In JavaScript, semicolons reduce ambiguity. Whether you know the semicolon rules in the language or not is immaterial to reducing ambiguity, similar to how defensive parenthesization is helpful regardless of whether you know the order of operations of a given language by heart. This is why the prevailing wisdom is to always use semicolons: pri…

Yes, anything you can do to reduce ambiguity in the code will not only make it easier for the people who come after you, but it will reduce ambiguity between your mind and the implementation you're coding.

Re: Bootstrap's maintainer hates the semicolon

#106
I want top point out that this shows how it is very very tricky to build a good team. Just imagine that one of your co-workers (very smart, the best, but refuses to understand 'principle of least surprise') is refusing to add semicolons and claiming we now need to change mimifier and change a way how we use 3rd party js dynamic loaders. And that can cause quite unpleased dynamic in the team.

This is one of reasons why companies have strict coding-style guides but that is overhead for a very small company (you don't need coding-style you just need developers which know that code needs to be written with understanding it will also used and maintained by other people in your team).

Re: Bootstrap's maintainer hates the semicolon

#107

Earlier quoted context omitted.

I agree. As some-one who has just finished with a large-ish project using bootstrap, I can say that one of the worst parts of it is its js api.

I almost regret my incendiary comment above. I made it first thing upon waking up... However, I was referring to the actual Twitter API, which seems to have frequent issues. If the Twitter engineering culture is based on a bunch of "because I like it this way" solutions rather than "because this is the right way to do it," it may explain some of what I perceive to be their shortcomings. One should be self-expressive,…

One should be self-expressive, but I don't think syntax is an opportunity to be so.

Sure it is. Textual expression is a function of both form (syntax) and content (characters). Not only that, but TMTOWTDI enforces overlap between the right way to do something and the coding preferences of the implementor.

Re: Bootstrap's maintainer hates the semicolon

#108

Earlier quoted context omitted.

It's just embracing the ASI. Nothing wrong with it. On the contrary, the understanding necessary to use it implies good knowledge of the language.

The point of programming is not to show off how well you know the language, else we'd be writing our C in trigrams and our JS in []()+!: http://discogscounter.getfreehosting.co.uk/js-noalnum.php

Reductio ad absurdum.

The intention is to make code easier to read and type. The mental effort is the same.

Re: Bootstrap's maintainer hates the semicolon

#109
post #96
post #92

Earlier quoted context omitted.

It's probably less expensive to maintain, because programmers' brain reading the code while not having to parse the extra image information - which semicolons are, and they add a lot of clutter - gets less tired and in turn is less prone to make errors in other coding areas. I see two camps here - people who fear the unknown or come from semicolon-mandatory languages and can't get used to the semicolon-less style, an…

I try to assume good faith with HN comments, but this smells like a troll. In JavaScript, semicolons reduce ambiguity. Whether you know the semicolon rules in the language or not is immaterial to reducing ambiguity, similar to how defensive parenthesization is helpful regardless of whether you know the order of operations of a given language by heart. This is why the prevailing wisdom is to always use semicolons: pri…

That's exactly the approach of no-semicolon javascript - only use them where they are needed to avoid ambiguity.

Re: Bootstrap's maintainer hates the semicolon

#110

Earlier quoted context omitted.

I almost regret my incendiary comment above. I made it first thing upon waking up... However, I was referring to the actual Twitter API, which seems to have frequent issues. If the Twitter engineering culture is based on a bunch of "because I like it this way" solutions rather than "because this is the right way to do it," it may explain some of what I perceive to be their shortcomings. One should be self-expressive,…

One should be self-expressive, but I don't think syntax is an opportunity to be so. Sure it is. Textual expression is a function of both form (syntax) and content (characters). Not only that, but TMTOWTDI enforces overlap between the right way to do something and the coding preferences of the implementor.

Okay, fine. It's some form of self expressions; but it's petty self expression. Writing in all lowercase is unlikely to establish you among the classics, even if your readers can still understand all of your sentences. That sort of "creative syntax" would be expected in graffiti, not Hemingway.
Post reply on HN