Skip to content

Instantly share code, notes, and snippets.

@scottgonzalez
Created April 16, 2012 18:02
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save scottgonzalez/6d635e9001b92215266a to your computer and use it in GitHub Desktop.
Save scottgonzalez/6d635e9001b92215266a to your computer and use it in GitHub Desktop.
; var http = require('http')
; var fork = require('child_process').fork
; function fib(n) {
; ; if (n < 2) {
; ; ; return 1
; ; } else {
; ; ; return fib(n - 2) + fib(n - 1)
; ; }
; }
; if (process.argv[2] == 'fib') {
; ; var r = fib(40)
; ; process.send({ result: r })
; ; process.exit(0)
; } else {
; ; var server = http.createServer(function(req, res) {
; ; ; var child = fork(__filename, [ 'fib' ])
; ; ; child.on('message', function(m) {
; ; ; ; res.writeHead(200)
; ; ; ; res.end(m.result + "\n")
; ; ; })
; ; })
; ; server.listen(8000)
; ; console.log("server online at http://localhost:8000/")
; }
@nonken
Copy link

nonken commented Apr 17, 2012

WIN: I love how easy it is to read

; if (foo) {
; ; // do something
; ; if (bar) {
; ; }
; } else {
; ; // do something
; }

It's all becoming curly braces :)

@sovcn
Copy link

sovcn commented Apr 17, 2012

It seems to me that this could potentially make the code slower by making the interpreter think it has to parse additional expressions. Depends on how it was designed I think.

@kswedberg
Copy link

Hey folks, sorry to spoil the party, but this is a joke. In other words, it wasn't intended to be taken seriously.

@idbentley
Copy link

@sovcn - That's an implementation detail up to the browsers to fix. We should be writing idiomatic js, optimized for style, not performance.

@wayneashleyberry
Copy link

★★★★★

@midu
Copy link

midu commented Apr 17, 2012

@jakobo omg, you're so right! This is not only super readable but it brings syntax consistency to large teams!

@danheberden
Copy link

@kswedberg nice try trying to mislead us - this is totes for reals

@kswedberg
Copy link

@danheberden think of the children!

@eliperelman
Copy link

I'm currently in the process of writing a build tool that will help you convert your old code to this new convention. Don't worry, help is on the way!

@danheberden
Copy link

Thank god for the soldiers of the web such as yourself - may the spirit of the semicolon cause your cup of success to overflow.

@anddoutoi
Copy link

"The" semicolon is strong with this one.

@cowboy
Copy link

cowboy commented Apr 17, 2012

The best part is that it looks like the code I already write!! Because my text editor puts the vertical lines in for me already

see

awesome code example

this is from a new aplication im building called "process-content.php"

@alfeg
Copy link

alfeg commented Apr 18, 2012

@cowboy sweet line numbers ^_^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment