A little bit of code that needs critiquing
View Single Post
10-15-2008, 10:36 PM
La Vida es Sueño
Join Date: Sep 2007
The first thing that strikes me is that code is awfully difficult to read. I dislike the actual layout of the code, and there's a lack of commenting. I fear it would take me a while to understand what's going on there, and whilst you may think that's not such a bad thing, because perhaps you're the only person who's working on it. What happens if you neglect it and then come back to it in 6 month's time? Do you think you'll still understand what is going on?
I think the best approach is probably to separate out the difficult tasks to other classes. That way one class only has one responsibility, and that responsibility can be clearly detailed by yourself. So when you do come back to the code in 6 month's time, you'll be able to read the comments in which you wrote down, and begin working on the classes again within, hopefully, 5 minutes or so.
In addition to that, I think placing the curly brackets on new lines -- lines of their own, really does help in readability, but that's merely a personal preference.
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
View Public Profile
Send a private message to Wildhoney
Visit Wildhoney's homepage!
Find More Posts by Wildhoney