Prajwal Tuladhar’s Blog
 
programming, life and some random thoughts

Archive for April, 2009

Apr 27 2009

Vicious cycle of unsatisfactory code

Published by Prajwal Tuladhar under Programming, iSpeak

Software engineering and programming are such an inquisitive fields that there are always unexplained avenues for gaining improvement. I may not have proper authority to fully capitalize the previous statement because being relatively new to programming (couple of years or so of professional career), there are so many unexplored horizons of software development that I still need to explore.

But every time I write some code and after sometime, I personally feel that the code I wrote sometime ago is really awful and dirty. I have to admit that most of my personal projects that I did alone was kinda failure and/or bizarre and no doubt they have taught me lessons I will never ever forget in my life.

I reviewed the code I wrote just few months ago and I was able to extract so many mistakes and would be bugs that I wrote that code again. And may be after few months, I will do same again. But this cycle of writing bad code and after certain time getting to feel how erroneous me and my code does make me quite happy and I can make self comparison how am I improving as a programmer that does not just code but write clean and testable code :) . But I am really loving this vicious cycle of unsatisfactory code.

If you are new and kinda enthusiastic programmer then, I guess you have also experience similar and/or related cycle of dissatisfaction and are always searching to learn and implement something new. It would be really nice if you can share your experience too.


Comments

Apr 26 2009

Four rules of simple design

Published by Prajwal Tuladhar under Patterns, Programming

Yeah again I am quoting some interesting text from Clean Code :)

It’s about four simple rules by Kent Beck on simple design:

  • Runs all the tests
  • Contains no duplications
  • Expresses the intent of the programmers
  • Minimizes the number of classes and methods

I agree with al the three rules but the fourth one seems little difficult to follow especially if you are also following the Single Responsibility Principle. But since its is listed in the last, I assume it should be given less priority. What do you think?


Comments

Apr 22 2009

Differentiating OO and Structured Code

Published by Prajwal Tuladhar under Patterns

I know we have have hearing, learning and reading so many things about OO and procedural code from the day we are onto the world of OO. But I just figured out one nice point differentiating between them found in the book Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin aka Uncle Bob.

Procedural code (code using data structures) makes it easy to add new features without changing the existing data structures. OO code, on the other hand, makes it easy to add new classes without changing existing features.

I think above single statement is more than enough if one wants to know the real difference between OO and procedural code. And again you gotta to have some OO experience in order to understand the depth of the statement.

So far, I have been satisfied with the book (completed around 10 chapters) and if you are interested in making your code clean (in the sense of usability and design), then I strongly recommend the book.


Comments

RSS Feed
Subscribe by email
Follow me @ Twitter