Skip to main content

Home/ OCG developers/ Group items tagged BestPractices

Rss Feed Group items tagged

Steven van Dijk

Expressive Code: Good Variable Names Instead Of Magic Values And Calculations | Thought... - 0 views

  •  
    "It's good habit to get back to basics and really understand why you hold principles so that you can judge whether or not they are appropriate in the circumstances you are in. Today's little nugget of principle is to write expressive code and avoid magic values in your code."
Steven van Dijk

Abstraction: The Rule Of Three - 0 views

  •  
    "I often hear people say something like "if you need it once, build it. If you need it twice, abstract it." People often say then in the context of the "DRY" - or Don't Repeat Yourself - principle. [..] The idea of DRY needs to be tempered with YAGNI - "You Aint Gonna Need It". With that, we end up with The Rule Of Three, and it clearly says that code can be copied once but the third time you need it, you should abstract it."
Steven van Dijk

That's Not Yours | 8th Light - 0 views

  •  
    "The book Growing Object Oriented Software, Guided by Tests states that you should never mock interfaces that you don't own. When I read that it caught me off guard. After all faking third party libraries that talk to databases or the network is the primary use case of a mock object right?"
Steven van Dijk

Code Smells - 0 views

  •  
    "the most important guideline is to watch for warning signs in your own code-- so called "code smells". Developing your "code nose" is something that happens early in your programming career, if it's going to happen at all. I combined all the documented code smells I could find into this reference; most of these smells should be familiar to you."
1 - 4 of 4
Showing 20 items per page