DEV Community

Discussion on: Self Documenting code isn't

Collapse
 
dpasi314 profile image
Dante Pasionek

Although I'm still in university, they really drill us to comment our code in academia (obviously for good reason so we know what we're doing). Three years into this degree though, I find myself using comments only when I'm writing something that's too complex to speak for itself. For example, just recently in my Object Oriented design class, we're told that making variable and function names that are verbose (i.e in Java: IndexOutOfBoundsException; There's really no need to comment on what that exception is. Sure it might be a little longer than what's maybe seen as typical length, but it's to the point!) I find myself frequently looking at this example when I'm writing code.

That being said, I recently had an interview where a potential employer saw some of the code I've wrote in the past and specifically mentioned on my lack of comments, and I told him what I had just explained above. He responded by telling me that it's not about me, it's about the people after me.

I'm not sure, as a community, developers will ever create a universal standard for commenting, but one day we can only hope.