Hacker News new | ask | show | jobs
Why does healthcare.gov use “if ('en' === 'en')“? (i.imgur.com)
7 points by kvprashant 4616 days ago
8 comments

I reckon one of the strings is server generated. I used to do similar things when I just stared coding.
On of the 'en's its generated by backend, so this is not always true as users may be from different country.
Related: hilarious geeky musings on healthcare.gov "features" http://sfy.co/tGfF
And worse, that particular mess is commented out, yet downloaded to everyone's browser.

But below, in live code, they have the same thing.

Go to healthcare.gov/es and the condition is if('es' == 'en'){} That's all ...
If I go there it takes me to cuidadodesalud.gov/es. If I go to cuidadodesalud.gov/en it takes me to cuidadodesalud.gov/es/en which gives an error 404 saying it cannot find the page 'https://cuidadodesalud.gov/es/en' in HealthCare.gov. It doesn't make much sense to redirect to a different domain name and append the '/es'
The best of the terrible js code's I have ever encountered.
Maybe its a place holder for future implementations
that is just their way of telling the client-side javascript about 'en' or 'es' etc . Bad design I guess.
No etc. If 'en' is not 'en' then it's assumed to be 'es_MX'