3 ms·
It's better for everyone who will use/reuse/maintain/improve that code in the future (including the person who wrote it). But of course it's not easy, and takes
by shurcooL 13y ago
It's better for everyone who will use/reuse/maintain/improve that code in the future (including the person who wrote it). But of course it's not easy, and takes extra time.
Personally, at this time, I feel a lot more satisfaction when I'm able to truly understand the problem I'm working with, and refactor complicated/hacky/duplicated code into a functionally equivalent but simple and elegant code. Smart/complex code that works is a great intermediate step though, it's way better than no code. :)
Rob Pike has a very relevant article [1] on this topic.
[1] http://commandcenter.blogspot.com.au/2012/06/less-is-exponentially-more.html http://commandcenter.blogspot.com.au/2012/06/less-is-exponen...
- stcredzero 13y ago> Smart/complex code that works is a great intermediate step though, it's way better than no code. :) I'm totally with you on that. Often, the way to solve a problem is to first solve it wrong. In the process of doing that, you can see the way to solve it right. Trying to reach the endpoint in one fell swoop of envisioning and coding is actually another beginner move I've seen a bit. What I'm totally not down with is complexity as an end goal. And yes, I've seen this mentality in programming.