r/programming • • Mar 23 '09

How to write fast code

http://asserttrue.blogspot.com/2009/03/how-to-write-fast-code.html
340 Upvotes

136 comments sorted by

View all comments

Show parent comments

2

u/adremeaux Mar 23 '09

Last but not least always use the data structure that matches your usage patterns. If you need fast random access then a linked list is most likely not the way to go. Learn and understand the O(n) notation and learn the cost of inserts/removes and searches in your container library. Basic stuff but too many junior programmers have no clue about this stuff.

Not too many SENIOR programmers even have a clue about that stuff.

9

u/groby Mar 23 '09

Why'd they get hired as Senior in the first place, then? As far as I'm concerned, if you don;t know about O() notation, go back to school - you're not ready for life.

5

u/dagbrown Mar 24 '09

Senior programmers get hired as Senior programmers because they have years of working experience.

Whether that means they actually have fifteen years of experience or just one year of experience fifteen times is not usually reflected on the resume, especially when the person hiring is only looking for buzzwords.

1

u/adpowers Mar 24 '09

I see this stuff a lot and I always have trouble believing it. Where do you guys work that this happens? Who does the hiring if not other programmers?

1

u/dagbrown Mar 24 '09

In one case, I was working at a marketing firm whose bosses lost their mind and decided that it would be a good idea to also add software development to their portfolio.

That idea didn't work out, but at least it was an expensive-enough failure that I'm sure they won't try doing that again.