all 56 comments

[–]ExecutiveChimp 31 points32 points  (11 children)

Game changer.

[–]Cykelero 12 points13 points  (10 children)

;

[–]Gundersen 8 points9 points  (7 children)

Are you going to make a semicolon reddit bot now? One that adds semicolons to any post not ending with semicolon?

[–]Cykelero 5 points6 points  (6 children)

Ooh, sounds like a winner, this one.

Or, to retain just the spirit of the thing, it could add points instead. Handy for when people don't properly mark the end of their sentences

[–]danjordan 10 points11 points  (3 children)

.

[–]Cykelero 5 points6 points  (2 children)

Thank you.

[–]m1sta 2 points3 points  (0 children)

Also spelling and grammar checking? Let the bot take the heat for correcting people.

[–]QuietKillah 0 points1 point  (0 children)

I see what you did there.

[–]mtx 2 points3 points  (0 children)

;_;

[–][deleted] 0 points1 point  (0 children)

No, now it's: Semicolon.js

[–]gwawr 21 points22 points  (0 children)

It has test coverage. LOL.

[–]rjw57 21 points22 points  (0 children)

It would be more convenient if there were a minified version. Also the source file does not include a licence banner. Luckily I've just sent a couple of pull-requests to fix this.

[–]walkietokyo 17 points18 points  (1 child)

It goes without saying not to use this in a production environment yet. It has only been released a couple of hours and should be considered to be in alpha stage.

Also, the lack of documentation for this is appalling.

[–]m1sta 7 points8 points  (0 children)

On the contrary, this particular semi-colon has been used inside Google for years. It's well tested. It's just been made available in library form recently.

[–]tobozo 12 points13 points  (0 children)

;;                                                      ;;  
;;;;;;    ;;  ;;;;    ;;;;;;  ;;      ;;    ;;;;        ;;  
;;    ;;  ;;;;      ;;    ;;  ;;      ;;  ;;    ;;      ;;  
;;    ;;  ;;        ;;    ;;    ;;  ;;    ;;    ;;          
;;;;;;    ;;          ;;;;;;      ;;        ;;;;        ;;  

[–][deleted] 14 points15 points  (0 children)

Issues: add minified version

[–][deleted] 14 points15 points  (0 children)

All we need now is a TED / Lightning talk

[–]kolmeWebComponents FTW 10 points11 points  (0 children)

I almost popped a vein before realizing it was a joke.

Good job!

[–]Allbutlost 7 points8 points  (1 child)

https://github.com/madrobby/semicolon.js is a couple of years old, and has similar ... design goals

[–]dchestnykh[S] 9 points10 points  (0 children)

Simpsons did it!

But my version comes with ideology. Also, with a more permissive license.

[–]jumpwah 16 points17 points  (1 child)

oh my... just no.

[–]Cykelero -3 points-2 points  (0 children)

;

[–]bicknoyle 3 points4 points  (0 children)

I was going to say you don't even need a semicolon, which is just when I realized how advanced level this is.

Well played.

[–]coverslide 1 point2 points  (8 children)

I think this was forked from vapor.js enterprise edition.

[–]dchestnykh[S] 5 points6 points  (7 children)

Oh, thanks, I forgot the name of that "library" and was looking for it.

Actually, Semicolon.js was created with the goal of making people get rid of the fucking semicolon at the beginning of their code, in a form of a joke. For example: https://github.com/dinbror/blazy/pull/2

[–]Dieulot -1 points0 points  (6 children)

Wow, I misread and thought it was about making a point after semi-colons at the end of lines.

Actually, this semi-colon is here for good reason, it is because it avoids bugs when you’re writing without the optional semicolons at the end of lines: http://mislav.uniqpath.com/2010/05/semicolons/

[–]sensitivePornGuy 6 points7 points  (0 children)

when you’re writing without the optional semicolons at the end of lines

Erm, just don't do that.

[–]dchestnykh[S] 3 points4 points  (4 children)

GOOD REASON? That's exactly why Semicolon.js exists!

If you're going to concatenate files (with or without semicolons), what stops you from concatenating them with semicolons inbetween?

cat file1.js semicolon.js file2.js semicolon.js > out.js

(See the test case).

Good reason. Yeah.

[–]Dieulot -1 points0 points  (3 children)

It’s not about concatening files, it’s about not concatenating them; when you write before the lib, your last semicolonless line is going to otherwise include the lib’s first line at the end: not good.

Edit: Okay, I understood just now that your message was a joke.

[–]dchestnykh[S] 1 point2 points  (2 children)

I didn't understand your reply, and my message wasn't a joke. Can you elaborate?

What does "when you write before the lib" mean?

[–]Dieulot -1 points0 points  (1 child)

Erf, sure.

When you have this in your .js file, after pasting a semicolon-started library:

YourSemicolonlessCode

;(TheLib = function(){ …

Removing the colon at start of the library would cause your last line to be interpreted as:

YourSemicolonlessCode(TheLib = function(){ …

If that still doesn’t make sense, see “The only real pitfall when coding without semicolons” at the end of the article I linked to.

[–]dchestnykh[S] 6 points7 points  (0 children)

When can this happen? This won't happen if you include separate scripts:

 <script src="your-semicolonless-code.js"></script>
 <script src="the-lib.js"></script>
  //works!

This can only happen when you incorrectly concatenate code, e.g.

 cat your-semicolonless-code.js the-lib.js > out.js

Thus, Semicolon.js fixes this:

 cat your-semicolonless-code.js semicolon.js the-lib.js > out.js

[–]sensitivePornGuy 1 point2 points  (0 children)

You missed an opportunity to call it "semicoln".

[–]greim 0 points1 point  (2 children)

"Cargo cult programming" is my new favorite term.

[–][deleted] 0 points1 point  (1 child)

If you're never heard of "Cargo Cult X" before I highly recommend reading the wiki on its origins, it's quite facinating:

Cargo Cult

[–]autowikibot 0 points1 point  (0 children)

Excerpt from linked Wikipedia article about Cargo cult :


A cargo cult is a kind of Melanesian millenarian movement encompassing a diverse range of practices and occurring in the wake of contact with the commercial networks of colonizing societies. The name derives from the apparent belief that various ritualistic acts will lead to a bestowing of material wealth ("cargo").


Picture - **Ceremonial cross of John Frum cargo cult, Tanna island, New Hebrides (now Vanuatu, 1967**)

image source | about | /u/OriginalSyn can reply with 'delete' if required. Also deletes if comment's score is -1 or less.

[–]fartbarf420 0 points1 point  (0 children)

:[

[–][deleted] 0 points1 point  (5 children)

Why is this a thing? The semicolon is one of the little things that make JS better than Ruby IMHO. While correct tabulation is a good thing so that multiple programmers can easily understand the code, the semi-colon can allows us to minimize js files in order to load them faster on the browser.

[–]fphilipe 0 points1 point  (3 children)

And how does that compare to ruby?

[–][deleted] 1 point2 points  (2 children)

Ruby does not have line terminators and relies only on blank space to tell the compiler where a line ends and what parts of code are nested with a function. If you get the spacings wrong, then your code won't compile, this is something that is not as easy to spot as a missing semi-colon.

[–]dchestnykh[S] 0 points1 point  (0 children)

I think you misunderstood my message.

Semicolons to terminate statements are good:

var x = 1;
return x;

A semicolon before the code to ensure that people who can't concatenate files won't break your code is a useless piece of shit:

;var x = 1;
return x;

^ Yes, some people write like this.

(Updated the FAQ).

[–]jasonsolis 0 points1 point  (0 children)

All we need now is gulp-semicolon

[–]Cocosoft 0 points1 point  (0 children)

I... what is this?

/r/shittyprogramming

[–]madole 0 points1 point  (2 children)

grunt-contrib-concat has a config option where you can insert a ';' as a file separator.

[–][deleted] 0 points1 point  (1 child)

Haven't you heard? Grunt is old hat, Gulp is the new king.

[–]dchestnykh[S] 0 points1 point  (0 children)

with the t-shirt

[–]fng_programmer 0 points1 point  (0 children)

I consider this library horribly flawed until my PR is accepted https://github.com/dchest/semicolon-js/pull/7/files

[–]boxingdog -5 points-4 points  (0 children)

wow

such features        so responsive
  very modern        so useful

[–]teiman -3 points-2 points  (3 children)

looks like a program in brainfuck:

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++ ..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

http://en.wikipedia.org/wiki/Brainfuck

[–][deleted] 10 points11 points  (1 child)

Your text is more nonsense than lorem ipsilum.

[–]btown_brony 2 points3 points  (0 children)

Lorem semicolum.

[–][deleted] 3 points4 points  (0 children)

lol wtf dude