News for hackers. Stuff that matters.
Re:One Sure-Fire Way to Improve Your Coding by j_baker on Thursday May 27, 2010 @11:56AM (#1384012)
I don't recommend reading code for an exercise (at least not by itself). I do recommend modifying code as an exercise though. There are lots of pieces of code that are deceptively complex: they look simple, but come to a grinding halt when you make the slightest change. Thus, it's important to know that there's a difference between what code is doing and what it looks like it's doing.

This teaches a few things:

1. How to read code

2. How to write code

3. How not to write code. When you encounter the grinding halt effect I mentioned above, there's a good chance that's how not to write code (but maybe not, some code is naturally tricky).

Re:One Sure-Fire Way to Improve Your Coding by sant0sk1 on Thursday May 27, 2010 @12:33PM (#1384154)
Good point. In the article I also point out that you should not be reading code passively. You should be running the tests, executing the code, breaking stuff, and trying to fix it.
Re:One Sure-Fire Way to Improve Your Coding by j_baker on Thursday May 27, 2010 @01:32PM (#1384343)
I noticed that. Perhaps my point is more of a semantic one. It still seems to me that the article seems to focus more on the reading than the modifying though.
Re:One Sure-Fire Way to Improve Your Coding by dhimes on Thursday May 27, 2010 @04:24PM (#1384847)
This is also a great exercise to improve your writing of prose, if anybody is interested. Take a well-written couple of paragraphs (Hemingway, etc.), and try to write it better. It's a short exercise that teaches you the importance of the subtleties of style.
Re:One Sure-Fire Way to Improve Your Coding by lanstein on Thursday May 27, 2010 @02:18PM (#1384492)
That reminds me of a line of code I wrote the other day:

  $result->RetrieveResult->DynamicEntity = clone $result->RetrieveResult->DynamicEntity;
it's to get around a PHP bug where the SoapClient returns a half-baked object. At least I preceded it with a comment.