News for hackers. Stuff that matters.

rgrannell1

This is a really terrific app. In many ways is nicer than siting back and listening to music, as it makes you think more about the flow and melody of a piece. I enjoyed this very much.
Re:Sixth DNA base discovered? on Tuesday May 05, 2015 @12:41AM (#9490870)
This is very interesting, given that ScienceDaily reported the discovery of the seventh and eighth bases in 2011! Did they forget how to count, or do they just republish press releases without any understanding of the subject matter or actual journalism?

Source: http://sandwalk.blogspot.ie/2011/07/stop-press-scientists-di...

Re:Ask HN: What code do you frequently read? on Friday March 06, 2015 @04:51AM (#9156365)
I read lodash's source to get a feel for how to write fast, high-level, bug-avoiding js. There are a few good ideas in it, like aliasing base methods like 'Array.splice' to a function 'splice' to prevent someone breaking your code by cloberring/overriding these methods.
Re:The infernal semicolon (2012) on Thursday March 05, 2015 @08:38PM (#9155083)
I see the bug as JSLint's problem, not the code in question (though admittedly that was bad code). I agree that if your tooling requires semicolons you should be pragmatic and include them, but the reality is that parsers/minifiers are mostly built with the assumption that users won't always include semicolons, so that's a largely hypothetical situation.

I definitely agree that you should code defensively, but I'm just not seeing why adding semicolons where ASI kicks in is a practical thing to do. I don't agree semicolons make the code more readable, but if there was such a case you should definitely add them. And everyone - not just people who omit non-ASI'ed semicolons - will forget to include them where needed eventually, but that's not even an especially painful bug.

There are in my opinion more dangerous style choices that are ignored, like daisy-chained declarations. Writing

var x = 1,

y = 2,

z = 3

is a pretty lousy idea, as it unnecessarily couples the meaning of several lines of code together, and makes code harder to edit. If you unthinkingly truncate the first line you get

    y = 2,
    z = 3
a pair of global assignments! That could be a really pernicious bug if you have supposedly 'local' variables sharing the name with an existing global object. It's better to be defensive and write

var x = 1 var y = 2 var z = 3

if only for editability.

My point is that the strong feeling on 'Semicolons' vs 'No Semicolons' is largely a product of focusing bias (http://en.wikipedia.org/wiki/Anchoring); to the extent that it is a problem either way it is a minor one, evidenced by the fact that similar stylistic dangers (see above) are either unfairly ignored or rightly not fretted over.

tl;dr I don't see a practically valuable reason to use them where ASI does the work for you, semicolon vs semicolon is barely a practical issue either way.

Re:The infernal semicolon (2012) on Thursday March 05, 2015 @12:35PM (#9152307)
Not using semicolons has never be a problem for me.

Just like everyone else I put them where they are needed. I don't put them where they aren't needed, because they aren't needed and adding pointless syntax noise is dumb. If I forget to put them in somewhere they are needed, as anyone might do, I add them. No problems.

Re:Preorder your very own cold fusion reactor on Thursday November 28, 2013 @08:59AM (#6814487)
Hacker News + science is often a very bad mix. Any evidence this is actually a fusion device, not a chemical energy converter or a brick?
Re:Anonymous Pro – a fixed-width font designed for coders on Tuesday September 10, 2013 @09:37AM (#6359909)
I like this font; it's pretty nice for small font sizes (a little like terminus).
Re:Poll: What is your primary programming language? on Wednesday June 26, 2013 @05:27AM (#5944976)
R, since I'm developing libraries for that language.

- 80% R - 20% JS

Re:The Onion releases fartscroll.js on Thursday May 09, 2013 @10:12AM (#5680505)
this needs to be combined with raptorize.js...