Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
c3r38r170162232dWhile I understand what you meant, not all "clever" code is unreadable. And if it is, the clever programmer will make use of one of those things called comments.
-
@c3r38r170 And there's performance and safety to factor in.
Yeah "premature optimization is evil", but PREEMTIVE optimization isn't always evil.
High throughput sorting & transforming/reducing is an example where optimizing preemptively can pay off.
For example when you have a system which handles billing, and you know up front that it's going to need to calculate taxes and merge certain amounts, and sort line items by date for a billion invoices, introducing some smart indexing/caching system could pay off. You know the requirements and tradeoffs, so you can probably already build some performance increasing mechanisms into the service.
Also, if readable code increases the chance of bugs, well fuck that.
A great example of that is race conditions: Not locking data resources is of course easier to read — but writing fixes to repair corrupted data is much worse than building data safety into your code. -
IntrusionCM470732dReadability is important.
Cleverness is sometimes point of view.
It's hard to tell. I know people who still don't understand that maayyyybeee a generator makes more sense than that convoluted if else dramalama thingie trying to build an array ;)
Fuck favoring cleverness over readability
rant
readable code > clever code