5 ms·
Thanks for drawing my attention to this. Currently, I maintain a separate branch simply for adding the missing semicolons so that I can link the individual boot
by Rajiv_N 15y ago
Thanks for drawing my attention to this. Currently, I maintain a separate branch simply for adding the missing semicolons so that I can link the individual bootstrap files with my project. It's been quite annoying and I now know that the annoyance may not go away anytime soon.
I hate these ideologues. But this is the trouble with JS I guess. I actually love javascript because of the highly dynamic nature of it. But that dynamism also lends itself to these kind of problems. I don't know of any other language where people can CHOOSE to follow syntax. Part of the problem is the awkward interpreter specs I guess. But also, with JS seems like everyone has an opinion :)
- willvarfar 15y agoYour branch can become the new public useful one perhaps?
- Rajiv_N 15y agoYeah, I've been thinking about doing this. I was kinda hoping that the missing semicolons were just an oversight on the bootstrap teams part. Now that I know there is some demand for a branch of this sort, I'll share it ASAP. EDIT: the repo is at https://github.com/rajivnavada/bootstrap https://github.com/rajivnavada/bootstrap
- oscardelben 15y agoYou can do it in Ruby and lots of other languages
- TomasSedovic 15y agoRuby, Python, Go, JavaScript, Bash, even Clojure -- kinda. https://gist.github.com/1815639 https://gist.github.com/1815639 Of course, unless you're the sole writer and reader of the code, it's generally good to follow the common practices that evolved around the particular language.
- mjwalshe 15y agoJust becuse it is in the language spec does not mean that you should use it - Arithmetic IF's in Fortran are a good example.
- freshhawk 15y agoRelying on multiple different parser's implementation of the "auto semicolon insertion guesser" feature seems insane to me. I'm a python/haskell guy too, I hate semicolons. But I'll put up with them because javascript needs them, it doesn't enforce them, but to write sane, maintainable code it really needs them. Javascript is enough of a mess, this kind of thing just throws gas on the fire. Have you published your branch? I think it would be very useful.
- spicyj 15y agoJavaScript doesn't need them any more than Python does; they're used almost always simply because people don't know the (simple) rules of when statements end.
- nostrademons 15y agoOr because people simply don't want to have to think about when statements end. I know the semicolon insertion rules, because I'm obsessive-compulsive like that. In any team I lead, any software I write, and any open-source project I maintain, the coding standard will be "Terminate all your statements with semicolons." Why? Because my job is to make less work for people, not more. I could give them a list of 4 rules, often each having a list of a half dozen+ tokens, and say "memorize these, or you're not a professional JavaScript programmer". Or I could say "Terminate your statements with semicolons", and there's one rule, the same as in many other languages, for them to memorize. Other projects are free to do whatever they want with their coding standards, and if they want to make things complicated to show how 1337 they are or just because they think it looks pretty, fine. But of all the things you need to worry about to be a good frontend engineer, where to put the semicolons seems like the stupidest possible one.
- koningrobot 15y agoPlease read http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding http://blog.izs.me/post/2353458699/an-open-letter-to-javascr... again, especially the restricted production part. Using semicolons everywhere doesn't cover your ass in those cases. Granted, I've never ever encountered these, but still -- it's not as simple as you make it out to be.
- rplnt 15y agoYou can use semicolons in python. You have to use them if you want multiple statements in one line..
- Tichy 15y agoAdding semicolons is also an ideology.
- Deestan 15y ago> I don't know of any other language where people can CHOOSE to follow syntax. Your argument is incorrect. :) Omitting semicolons is perfectly valid and correct syntax. The spec is explicit about it being allowed and how the code shall be interpreted: http://es5.github.com/ http://es5.github.com/ It may be a good rule of thumb to use the semicolons, because you have to be careful without them, but in the end it's a choice based on team preference. If you are a very pertinent and careful type of person, and you don't have any rabid illiterates on your team, going without semicolons makes perfect sense.
- Rajiv_N 15y agoThe spec has provisions for automatic semicolon insertion that need to be considered carefully before deciding to completely ignore them. Now consider that http://twitter.github.com/bootstrap/index.html http://twitter.github.com/bootstrap/index.html says the following: "Bootstrap is designed to help people of all skill level—designer or developer, huge nerd or early beginner. Use it as a complete kit or use to start something more complex." So: 1. "illiterates" are welcome to use it. 2. If the goals are to be met, do not assume anything that can be interpreted differently by different players.
- zbuc 15y ago> If you are a very pertinent and careful type of person, and you don't have any rabid illiterates on your team, going without semicolons makes perfect sense. Why does it make perfect sense? There's nothing wrong with including them, and I find it reduces the amount of thinking you need to do. JavaScript has C-like syntax; it should end its lines with semicolons and it's a mistake that it doesn't always require them.
- maaku 15y ago> I don't know of any other language where people can CHOOSE to follow syntax. You should check out Lisp macros ;)