National (JavaScript) Security Agency
nsa.gov
nsa.gov
Which one of us would want a code review by people who did not understand the requirements given by "the client" done on the front page of HN?
In my core projects I'll use Ember or React+Redux, but where I just need a couple hundred lines of one-off code for e.g. a marketing site... why not some hackish jQuery?
That's some properly documented code !
// end comment block
// title update
try {
titleUpdate();
} catch(e) {}
// titleUpdate()
//update title to include " - NSA.gov" on all subpages
function titleUpdate() { ... }https://xgrommx.github.io/rx-book/content/getting_started_wi...
I feel like it's basically impossible to write JS and have 10 or more people with 3-5+ years go "Yeah, I can't improve this at all and it's extremely clean".
Not open source, so no demo, but it's definitely possible to create good JS.
// analytics disable if url contains underscore try { if(window.location.href.indexOf('_') > 0) {window['ga-disable-UA-20753548-1'] = true;} } catch(e) {} });
A regex on location.pathname would sure be a lot clearer to read, though.
/*
Smarter than that stuff?
Come work for us.
*/I smell rails
Try-catch jungle, ad-hoc URL manipulation, lack of caching, writing/constructing HTML in strange places, weak comparison operators in dangerous places (string vs lunch), etc.
if (!undeclaredVariable) { var undeclaredVariable = false; }
To be fair asking them to build apps that don't require JS is like the old man yelling to get off their lawn :)
It's hard maintaining two ways of doing things and it's not always easy to make them both use the same avenue. I'm getting to the point where I honestly don't care either way.