News for hackers. Stuff that matters.
Re:Ask HN: What horrifying and/or terrible things have you s... by vijayaggarwal on Friday June 20, 2014 @10:14PM (#7923889)
I've seen many things in my 10+ years of coding, Here are some favourites:

* No authentication check on any page after login page. (You could type in any URL in browser address bar and gain access).

* GET request updating home page related content in database. (A few of these GET request was picked up by Alexa bot and we hard our home page content change randomly for many days. We had a real hard time troubleshooting this one).

* Use of mysql_query() in PHP. (Deprecated mote than 10 years ago. Opens doors for SQL injection).

* Use of loop variables i,j,k,l,m for 5-level nested loop. (Too error prone and difficult to read).

* Unit testing applied to a highly monolithic code. (The hacks for isolating code units produced more garbage than the code itself). It was a legacy code and the management blindly ordered writing of unit tests when a few bugs were caught in production.

Re:Ask HN: What horrifying and/or terrible things have you s... by robflynn on Monday June 23, 2014 @12:50PM (#7932966)
I have seen some similar code. After authentication, a parameter was passed into the URL. Basically, if you had that token, you were logged in. Some user posted a link to their page on some site and included that token.

Later, the user complained about all of their photos constantly being deleted.

Photo deletes were GET-based and did not have no-follow. Google eventually indexed their logged-in link and was happily deleting all of their photos daily.

Fun times tracking that one down. (It was a code base that I inherited.)

Re:Ask HN: What horrifying and/or terrible things have you s... by shoo on Sunday June 22, 2014 @02:21AM (#7927069)
> Unit testing applied to a highly monolithic code

Do you (or indeed anyone else reading) have suggestions for getting other forms of testing in place around legacy monolithic code?

Perhaps this is a fairly ill-posed question without more context.

Re:Ask HN: What horrifying and/or terrible things have you s... by vijayaggarwal on Sunday June 22, 2014 @05:04AM (#7927306)
You can still do Integration Testing with the system as a whole, although it is supposed to be done after Unit Testing. The disadvantage due to absence of Unit Testing will be that it will be difficult it isolate bugs found during Integration Testing. For websites, we use Selenium all the time.