Hacker News new | comments | show | ask | jobs | submit login

There is something I find interesting about online discussions around performance issues (I am looking at you SO). The moment the question is asked, people try to gang up and out-compete each other in providing the cookie-cutter, patronizing, zero-information responses. Along the lines of (i) check whether it is actually the bottleneck, (ii) use a better algorithm, (iii) dont do it etc etc. Usually accompanied by (mis-attributed) quotes. Such advice would typically be the highest voted.

What galls me is that they assume, without any basis, that the person has not (a) benchmarked the code, (b) is obviously running an inferior algorithm and (c) just because they have not worked on an applications were speed mattered, the poster could not possibly be working on something where speed matters. If I were the one who asked the question I would be mighty pissed, given that just reading such comments as a third party irritates me enough.

The advice about premature optimization is valid. But it is a well assimilated folklore by now and I dont see how repeating that adds value. I think Hoare and Knuth's message was intended for a specific audience and the majority of the online crowd is not that audience.This message is often interpreted by enlightened newbies as an encouragement to be sloppy.

People would be better served if the discussion shifted to a different landscape, where people pointed out that particular construct that was typically more efficient among constructs of comparable clarity. Pointed out possible bottlenecks ahead of time, so that it is on the developers mind and he/she does not have to go through the process of coding a poor solution and discovering that it sucks.

Also regardless of the fact whether the code construct is actually a bottleneck in the application or not, it is always good to know what the more efficient alternatives are. It might not be the bottleneck in the current application, but it might well be in some other. Besides, there is something called intellectual curiosity.




I would complement this by noting that some people online, particularly at SO, cannot ask questions properly. Optimization problems are often about context, but context is seldom properly presented, if presented at all.

One can always ask for more information, so this is no excuse, of course. Perhaps the patronizing answers are the stupid mode of requesting clarifications.


The worst part is you can't tell them to fuck off because that would just be 'ungrateful.' They're only being patronising for your own good!


Well, on SO you can always downvote the answer. It would be more effective if it were the community norm to downvote the condescending answers, of course. It's not the case, unfortunately.


Condescending, presumptive no-info answers are often the top voted in my experience.


Well of course. If you say nothing, you can hardly be wrong :D




Applications are open for YC Winter 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: