Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think they made us write any unit tests in college. What wrong data structure are people using?


A dev I worked with though it would be a good idea to use an object in javascript to solve a problem. He made the first key 0, the second key 1, and so on. You can't use a number as a key, so there was extra logic to make sure it was cast properly into a number when needed.

I asked him why he didn't just use an array and he just kind of had a mind blown look on his face.


fun fact, all arrays in php are also associative. I once worked on code that managed to delete one of the array index keys. That was fun to debug


How much do you pay?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: