clean-code

Clean Code: Readable Dependency Injection suggestions?

I have a project that adds elements to an AutoCad drawing. I noticed that I was starting to write the same ten lines of code in multiple methods (only showing two for simplicity). Initial Implementation: You will notice that the only thing that really changes is adding a Line instead of a Circle. [CommandMethod("Test", CommandFlags....

Strategy Pattern with no 'switch' statements?

I've been doing some reading on the Strategy Pattern, and have a question. I have implemented a very basic Console Application below to explain what I'm asking. I have read that having 'switch' statements is a red flag when implementing the strategy pattern. However, I can't seem to get away from having a switch statement in this exam...

Examples of beautiful Javascript

A good way to improve as a developer is to look at well-written code. What examples of beautiful, well-architected Javascript have you encountered? Note that I am not looking for a debate about the language itself. It has good parts and bad parts; some like it, and many hate it. Let's leave that discussion to other threads. ...

How do you respond to the argument "No time to test/develop clean code, because of the deadline"?

Ok, I think this question is at the wrong place and I'll head over to http://programmers.stackexchange.com/ to read/ask about it. Thanks all for your answers up to this point. :) apologies ;) I'm sorry if this question is a little bit subjective, but I can not come up with a better title. I'll correct it if you know something better. ...

Method naming conventions. Should the method be named getX(), if the there's no corresponding setX() ?

Say I got an Employee class that has a hire date data member. This member only get set one time only and it is constant too. So it'll get initialised when the object is created. If I want the class to have a method that returns the hire date, what's better: getHireDate(); Or just: hireDate(); Am I thinking too much :D ? ...