Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That "explanation of why", when you take the trouble of reading it, is just an explanation of how. The article ends with:

Conclusion - Using the comma trick to do { }-less indentation is far from viable. However this may still be useful for debugging and overall it is fun to try new coding styles!



Reading the article and the comments made it more clear to me. Twitter is using some minification tool (maybe Google Closure) which attempts to reduce the number of characters used. Using commas you can reduce two characters by avoiding some brackets.

    if(true){dothis();dothat();}

    if(true)dothis(),dothat();




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

Search: