Readit News logoReadit News
solomone · 10 years ago
I get that it's trying to be funny, but is it really no longer possible to create a website with a single arrow that doesn't have to pull down all this cruft ?

  <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="bower_components/bootstrap-social/bootstrap-social.css" rel="stylesheet">
  <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
  <link href="assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
  <link href="cover.css" rel="stylesheet">

  <script src="bower_components/jquery/dist/jquery.min.js"></script>
  <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
  <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> 
  <script src="assets/js/ie10-viewport-bug-workaround.js"></script>

wallacoloo · 10 years ago
Agreed. I was curious as to how the random numbers were being generated (math.random()? Something else?), so I went to look at the source code. I expected `assets/js/src/application.js` to be the main file (I mean, look at that name. What else would it be?)

I start reading the code, and pretty soon it starts messing with the clipboard, and it even pulls in Flash [1]:

> // Config ZeroClipboard

> ZeroClipboard.config({

> moviePath: '/assets/flash/ZeroClipboard.swf',

> hoverClass: 'btn-clipboard-hover'

> })

In all honesty, this website serves more as an indication of why the TSA spending this much money on such code may actually be justified, rather than effectively mocking the cost, which I think was its intent. How many security holes do you think this website is subject to? Can we know for certain that none of these dependencies are malicious or contain backdoors?

Security can't be taken lightly. And yes - for an app like this, it's much more important that it be secure than that it look good. I doubt a browser application is really the right approach anyway, given those concerns.

[1] https://github.com/arik-so/tsa/blob/master/assets/js/src/app...

echelon · 10 years ago
Javascript is getting freakishly absurd. What is wrong with the JS ecosystem? This feels like XML all over again.

I know not all engineers do this, but this crap is what caused me to buy a new laptop. I was fine with my existing tools and workflow, but websites have gotten so slow and ridiculous. It's largely Javascript's fault.

I used to get angry about walled garden app stores, but lately I find myself hating the web. I don't dislike it, but I think we went on a really lame detour.

As an aside, Javascript ads are worse than Flash ads ever were.

taylorbuley · 10 years ago
> I start reading the code, and pretty soon it starts messing with the clipboard, and it even pulls in Flash

I admit to thinking the dependency overkill for random arrows was part the joke. A la https://github.com/jezen/is-thirteen

downandout · 10 years ago
In this case a few lines of CSS and a few lines of JavaScript would have delivered the exact same result, including all necessary responsiveness. We have gotten so far away from bare bones, non-jquery based development that this kind of heft has become the standard starting point for all projects. It certainly isn't my style, but then I didn't go to Stanford and don't work for a unicorn, so perhaps I am the unenlightened one.

That said, I don't think it's necessary to criticize a satirical project like this on technical grounds. The idea is great; the developer probably just used his boilerplate frameworks that are usually used for much more complex projects in order to save time.

tcfunk · 10 years ago
Make a thing responsive, people bitch about how many plugins you're using.

Make a thing vanilla, people bitch about how it doesn't work on their phone.

manigandham · 10 years ago
None of that stuff is necessary to make things responsive. In fact HTML is responsive by default.
pori · 10 years ago
A few lines of CSS could have done the trick. Read:

http://bettermotherfuckingwebsite.com/

x5n1 · 10 years ago
Make 300k off a website and people make a competitor to mock the value you delivered. People are stupid and you can't win. They will always try to force everyone to race to the bottom, because if they can't have it why should you?
bogidon · 10 years ago
But the app only needs to work on Mobile Safari (let's say 8 or higher?). Not rocket science to make it vanilla.
calsy · 10 years ago
width and floats dont need plugins.
barbs · 10 years ago
I'd love to see a ridiculously over-engineered version. Something like a website running in a browser in Windows 95 running in a javascript DOSBOX emulator.
LoSboccacc · 10 years ago
Saw a company running a thick client in a browser with a remote desktop plugin irl, and a propietary one at that (nx something)
true_religion · 10 years ago
They are probably just using a quickstart file that has all of those things included as defaults.

I have a repo I clone for my one-off projects with all the boilerplate I could possibly need for a weekend project. None of the projects actually end up using all of that stuff, but I'm not bothered by the lack of professional optimization in my "for fun only" projects.

wwweston · 10 years ago
Yes.

But it will hurt your career. How will people know if you keep up with modern development techniques?

fleitz · 10 years ago
Does anyone really give a shit that PG (or whoever makes HN now) is still using tables in 2016?
zappo2938 · 10 years ago
13. Rule of Economy: Programming time is expensive; conserve it in preference to machine time.

15. Rule of Optimization: Prototype before polishing. Get it working before you optimize it.[1]

[1] https://www.slingcode.com/ref/ProgrammingPhilosophies.pdf

jrockway · 10 years ago
Is programming time expensive?

Let's say you have a mobile app used by 1 billion people every day. It sounds crazy, but I bet a fair number of people in this forum contribute to such an application.

Imagine you want to make an optimization that increases battery life by 1%. Assume a 30Wh battery and that it's charged once per day. Over the two year lifetime of the phone, at $0.10 per KWh, that change would save your users 21.9 million dollars in aggregate. Even with a team of 40 people making $500,000 per year working for a year, you still increase the efficiency of society with that change!

(I know, this ignores the opportunity cost of adding a new feature before your competitor, or focusing on something that will bring more user happiness, or the externality that users don't notice the $0.00003 they're paying to supply your app with electricity. But the point is, we have a lot of power, and our time is much cheaper when multiplied proportionally to that impact.)

Dead Comment

whitehat2k9 · 10 years ago
Meh, it's probably still less overengineered than the actual TSA app.
krapp · 10 years ago
Of course it's possible - it's just that no one will take it or the resume of the person who wrote it seriously.

Web app engineers display complexity like peacocks displaying their plumage.

thekevan · 10 years ago
I think what your actual objection is that it's so easy to make a simple website with all that cruft. Much or all of that stuff comes in one of the easiest to find and download "starter packs" from Bootstrap. You can take the time to figure out what everything does and slim it down or just ship it.
tomhschmidt · 10 years ago
Gotta be #responsive
arik-so · 10 years ago
Exactly! My first attempt was just 10 lines of HTML code, but it was a real pain to do the vertical centering on iOS. So I tried a Bootstrap template, saw that even they didn't do the centering on iOS, but was too lazy to change it back.
emrekzd · 10 years ago
Lol. Please. Let's avoid a discussion about how a useless site could be built better.
ojr · 10 years ago
I see this as a polyfill for import statements which are not implemented in the browser
pw · 10 years ago
I feel like HN's nerd rage at stuff like this (the TSA expenditure) is the same reason many (if not most) engineers make less than they could. It's a very willful denial of a fact of how the world works (large organizations routinely pay large sums for seemingly very simple work).
Turing_Machine · 10 years ago
"Nerd rage"?

Try "taxpayer rage".

kough · 10 years ago
Exactly. Where's @patio11 with some contract negotiation advice?
patio11 · 10 years ago
At Microconf, giving it to people running software businesses.
throweway · 10 years ago
No different to the difference between the landed cost of whatever crap you buy and the retail price of the same crap.
Gratsby · 10 years ago
I have a cheaper alternative. Get rid of TSA altogether. Travelling was a whole heck of a lot more fun in 1975. Since then it's been overreaction upon overreaction. Nobody is going to hijack a plane in this day and age because of the simple fact that the passengers will immediately revolt.
aurelius12 · 10 years ago
It's been all of one week since a plane was hijacked.

http://www.cnn.com/2016/03/29/europe/hijacked-egypt-air-jet/

wingless · 10 years ago
According to Wikipedia there have been 6 notable hijackings in the last 5 years. https://en.wikipedia.org/wiki/List_of_aircraft_hijackings#20...

There are roughly 100k commercial flights per day, 36m flights per year.

Therefore, the probability of your flight being hijacked is 1 in 30 million, which is an absurdly low number. Note that only one of the 6 hijackings resulted in casualties, so the mortality rate even lower.

djsumdog · 10 years ago
..and yet airport security didn't stop this.
deelowe · 10 years ago
I imagine that things are a bit different in Egypt (eg cockpit doors arent locked and bullet proof)
djsumdog · 10 years ago
It's all security theatre. The TSA has stopped a dangerous person NEVER. I've lived around the world and airport security is bad everywhere. Australia's is terrible, German's is pretty bad, but the worst; the absolutely fucking worst is America's. I knew people who would pay more to fly through Canada to avoid American airports.
bbanyc · 10 years ago
The pre-2001 airport security apparatus did a good job of keeping guns off planes, eliminating the most common hijacking scenario. Almost everything since then has been increased hassle for diminishing returns, with the most effective improvement being one of the least visible - hardening the cockpit doors.
dwd · 10 years ago
Which introduced a different issue allowing incidents such as the Germanwings and EgyptAir crashes and maybe even Malaysian MH-370.
kough · 10 years ago
What a new and interesting opinion! I'm sure there are many Hacker News readers who hold the opposite viewpoint /s
wcummings · 10 years ago
It's a jobs program. IMHO we should put them to work building gaudy monuments of Obama.
sdenton4 · 10 years ago
Don't you mean Bush II? He started the jobs program, after all...
toomuchtodo · 10 years ago
http://arstechnica.com/tech-policy/2016/04/tsa-spent-47000-o...

"According to Mashable, the Transportation Security Administration apparently spent $47,000 on an app that is essentially a random number generator—it was briefly used to assign travelers to left or right lanes at airports.

As the website reported: “The app was used by TSA agents to randomly assign passengers to different pre-check lines as part of a now-discontinued program called ‘managed inclusion.’”

Such an app is widely viewed to be an extremely simple program to write. Many are questioning why a government agency overpaid for the app.

The revelation was published Sunday evening by Kevin Burke, a San Francisco-based developer, who received TSA documents in response to a Freedom of Information Act Request. The documents showed a $1.4 million price tag. However, the TSA has clarified that figure, stating that the app actually cost $47,000."

mikestew · 10 years ago
Such an app is widely viewed to be an extremely simple program to write.

Writing the app, as anyone who has done any consulting work would know, is often the easiest, least time-intensive part of a project. Anyone saying to themselves, "$47K? I could do it in ten lines of code!" should stick to coding and let the contract procurement folks do their job.

(I'm merely the messenger; hate-game disclaimers apply.)

nmrm2 · 10 years ago
Nail, meet head.

That said, 47k still seems crazy high. I've never done Gov't consulting though. One hopes hardware was included in the contract?

morgante · 10 years ago
$47k actually seems kind of reasonable, when you consider the overhead (much of which is fixed price) of any government contract.
hockley · 10 years ago
Gotta pay the testers, trainers, contracts team, and sales commission.
cevaris · 10 years ago
Lets be practical, I am sure the actual app - Works without network connection - Metrics (offline syncronization) - User logins - Includes price of iPads themselves? - Involved government and IBM personal

300K sounds about right

Deleted Comment

blr246 · 10 years ago
The UI looks nice, but there is more to this than a UI.

This should be implemented using a cryptographically secure random number generator. Presumably, the TSA requirements would specify some defense against an attacker being able to predict program outputs.

reedloden · 10 years ago
https://developer.mozilla.org/en-US/docs/Web/API/RandomSourc... solves that. Just need to tweak the code.

I submitted https://github.com/arik-so/tsa/issues/4 about this issue.

rajington · 10 years ago
I actually have a solution that costs exactly $0.01, per employee. It also works on any platform.
tacostakohashi · 10 years ago
If you're alluding to a penny, I think you'll find that they cost more that $0.01. Probably a far better example wasteful government procurement than this app.
thekevan · 10 years ago
" Probably a far better example wasteful government procurement than this app."

Not really. If you were flipping the penny to get heads or tails and lost it, you could easily replace that penny with a coin, a washer, a stick from outside, a book...hundreds of things already around your home or office, many with no use or value. You can't look around you and find a replacement for the penny as a currency.

striking · 10 years ago
Right, considering that pennies actually take about $0.02 to make.

Very big change in cost, considering the actual price of the TSA app.

bobbles · 10 years ago
What if that platform happens to be a steel grate and you drop the solution?
rajington · 10 years ago
Hi, I work for the TSA, would you like to do QA for us?
armandososa · 10 years ago
This left me thinking what could be the simplest implementation I could do, while keeping a good UX. I came up with this in 10mins: https://jsbin.com/xidefopuqe

It was a fun experiment and felt very old school.

russellbeattie · 10 years ago
Nice - you saved me the effort. But after I wouldn't have been able to resist the idea of tweaking the randomness and ended up spending the rest of the evening trying to perfect something that felt more random than random - including forays into Wikipedia and other searches to find prior examples... So really you've saved me hours of work!
voiper1 · 10 years ago
Much more straightforward code. Kudos!