Let's stop for a moment and think about what comes after platinum? Let's stop and think about who is your Mom's favourite child? The answer is Mahdi Yusuf. Nice to meet you. I am a software developer. P.S. I am sure your Mom loves us equally. Mahdi is a DZone MVB and is not an employee of DZone and has posted 16 posts at DZone. You can read more from them at their website. View Full User Profile

Debugging is Twice as Hard

01.14.2013
| 2470 views |
  • submit to reddit

I recently tweeted an article about a professor who posed a question to his student. The student gave a simple solution to the professors problem. He simply said the solution was too trivial, nothing worth writing a paper about.

Mahdi Yusuf @myusuf3

Not complex enough feedproxy.google.com/~r/TheEndeavou…

10 Jan 13

Developers fall to the same affliction when trying to solve problems. They try to make their solution as complex or as involved as possible; Amaze in their ability to keep things in context and their non-trivial solutions! Fight the stack!

Developers are the only ones who read programs, machines just execute them. Let’s really take this point to heart. Readability over everything! How often do developers take into account the readers state of mind when writing code? How does that change when you are writing documentation? Both should emphasize clarity and simplicity. 

When I am most in sync with another developer is when I am reading his/her code I understand their mental process when trying to solve the problem. That combined with a clear problem statement and comments is what its all about!

Anytime I am reminded of elegant solution to a problem it is usually deemed elegant simply due its innate ability to solve the problem at hand. It’s almost always easier to grasp and grok. Definitely easier to debug when you find a bug in your current implementation. 

So with that said go refactor some shit. Write some tests. Comment your code.

 

Published at DZone with permission of Mahdi Yusuf, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)