Live data from Hacker News

How true hackers write JavaScript

news.ycombinator.com

11–20 of 342 posts

Re: How true hackers write JavaScript

#11
This is neat (how the up/downvote onclick handler sends the info to the server).

    new Image().src = el.href;
Where href looks like this:

    vote?id=xxxxxxxx&how=up&auth=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy&goto=item%3Fid%3Dzzzzzzzz#wwwwwwww

Re: How true hackers write JavaScript

#12

https://twitter.com/triskweline/status/798443082740023296 > Valve's Steam Store renders on the server, uses ancient jQuery 1.8, loads 12 unminified JavaScripts. > It moved 3.5 billion dollars in 2015.

And burned 3.5 trillion developer brain cells just this january. Sensationalist metrics like this belong in the same trash bin as 'js is objectively bad and non-serious' bs.

Re: How true hackers write JavaScript

#15
Either run it through a minifier or have the whole thing unminified, these single lined functions look horrific, and are saving characters for the sake of it.

Terrible naming, e.g. 'vis' -> reading the function it means toggle visibility, so it should be called 'toggleVisibility', you shouldn't have to read what the function is doing to understand what it will do.

You ever get a bug in your code, It's not fun to look back at badly maintained code and go 'oh, shit, what does this do again?'.

Re: How true hackers write JavaScript

#16

https://twitter.com/triskweline/status/798443082740023296 > Valve's Steam Store renders on the server, uses ancient jQuery 1.8, loads 12 unminified JavaScripts. > It moved 3.5 billion dollars in 2015.

And burned 3.5 trillion developer brain cells just this january. Sensationalist metrics like this belong in the same trash bin as 'js is objectively bad and non-serious' bs.

so actual information is bad and "3.5 trillion brain cells burned" is good? Hrm....yeah, I'm going to Steam approach and focus on features that matter to the user rather than pedantic code which serves nothing but the developers ego in a vast majority of cases.

Re: How true hackers write JavaScript

#17

Earlier quoted context omitted.

And burned 3.5 trillion developer brain cells just this january. Sensationalist metrics like this belong in the same trash bin as 'js is objectively bad and non-serious' bs.

so actual information is bad and "3.5 trillion brain cells burned" is good? Hrm....yeah, I'm going to Steam approach and focus on features that matter to the user rather than pedantic code which serves nothing but the developers ego in a vast majority of cases.

your choice, it's your cells :) I would not want to dot that to my sanity.

Re: How true hackers write JavaScript

#19
Hacker News also works pretty well without JavaScript at all, which is really nice. Not something that I use often, but it comes in handy when you want to post a comment from your potato device that can't handle the modern web.

Re: How true hackers write JavaScript

#20
post #4

That might be one of the most readable pieces of code that I've ever read.

Really? Plenty of needlessly abbreviated function names IMO. At a quick glance is it immediately obvious what posf or arem are without looking into the context in which they're being used? Don't get me wrong it's a nice piece of code but super-readable it isn't.
Post reply on HN