More garbage ycombinator hero worship. 'True Hackers' ? Grow up!
And yeah, this playful attitude to "just do it" tends to goes away when people become adults.
So in my book, it is better to grow down!
91–100 of 342 posts
More garbage ycombinator hero worship. 'True Hackers' ? Grow up!
And yeah, this playful attitude to "just do it" tends to goes away when people become adults.
So in my book, it is better to grow down!
function onready () { recoll(); } document.addEventListener("DOMContentLoaded", onready); Just attach recoll() directly. There's no benefit of going via onready().
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
Not all that impressive, considering non-consistent code style and the like. Also not a fan of unnecessarily cryptic variable names.
function hidestory (ev, el, id) { for (var i=0; i That 3 there is the problem with “simple” JS. It’s tightly coupled to the HTML but they live in completely different places. On a side note this 3 should be at least assigned to a variable with a meaningful name.
hidestory() is not even used anywhere ; why is it here for? Debugging?
I've written uglier code and gotten paid for it. ¯\_(ツ)_/¯
It does what it's designed to do, and fills a specific need for one website. It's not there as a teaching aid, nor is it meant to be shared for other people to use elsewhere.
Not everything has to be gold-standard code full of perfect variable names, extensive comments and good whitespacing. If you have a day job that isn't primarily writing code, and/or you are likely to be the only person ever working on that code, who cares if it's not up to the standard that people around here seem to expect of every project?
As long as the code works, anything else is just gravy. If you were to peel back the layers on all the major websites out there, I'm sure you'd find less than stellar code everywhere.
function hidestory (ev, el, id) { for (var i=0; i That 3 there is the problem with “simple” JS. It’s tightly coupled to the HTML but they live in completely different places. On a side note this 3 should be at least assigned to a variable with a meaningful name.
hidestory() is not even used anywhere ; why is it here for? Debugging?
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…
But it doesn't toggle visibility. It sets visibility.