background preloader

The Principles of Good Programming

The Principles of Good Programming
Heron-Centric: Ruminations of a Language DesignerThe Principles of Good Programmingby Christopher DigginsJuly 24, 2011 Today's post is a lightly edited repost from my blog at The Area, a web-site dedicated to users of Autodesk media and entertainment products. I came up with this list of principles to help with a recent C# training I gave, and I thought that members of the Artima.com community could appreciate these principles and have some interesting insights to share. The principles of good programming are closely related to principles of good design and engineering. DRY - Don’t repeat yourself - This is probably the single most fundamental tenet in programming is to avoid repetition. KISS (Keep it simple, stupid!) Avoid Creating a YAGNI (You aren’t going to need it) - You should try not to add functionality until you need it. Avoid Premature Optimization - Don’t even think about optimization unless your code is working, but slower than you want.

Semantic Versioning Dean Wampler How do you handle your Project Manager - Programmers - Stack Exchange Bruce Eckel's MindView, Inc. ::: Exceptional Learning Experiences Normal Stuff - API Design Principles English Русском One of Qt’s most reputed merits is its consistent, easy-to-learn, powerful API. This document tries to summarize the know-how we’ve accumulated on designing Qt-style APIs. Although these guidelines are aimed primarily at public APIs, you are encouraged to use the same techniques when designing internal APIs, as a courtesy to your fellow developers. You may also be interested to read Jasmin Blanchette’s Little Manual of API Design [.in.tum.de] or its predecessor Designing Qt-Style C++ APIs [doc.qt.digia.com] by Matthias Ettrich. Six Characteristics of Good APIs An API is to the programmer what a GUI is to the end-user. In his Qt Quarterly 13 article about API design [doc.qt.nokia.com], Matthias tells us he believes that APIs should be minimal and complete, have clear and simple semantics, be intuitive, be easy to memorize, and lead to readable code. Be minimal A minimal API is one that has as few public members per class and as few classes as possible. Be complete Be intuitive

Code refactoring By continuously improving the design of code, we make it easier and easier to work with. This is in sharp contrast to what typically happens: little refactoring and a great deal of attention paid to expediently adding new features. If you get into the hygienic habit of refactoring continuously, you'll find that it is easier to extend and maintain code.—Joshua Kerievsky, Refactoring to Patterns[1] Overview[edit] Refactoring is usually motivated by noticing a code smell.[2] For example the method at hand may be very long, or it may be a near duplicate of another nearby method. There are two general categories of benefits to the activity of refactoring. Maintainability. Before applying a refactoring to a section of code, a solid set of automatic unit tests is needed. The process is then an iterative cycle of making a small program transformation, testing it to ensure correctness, and making another small transformation. List of refactoring techniques[edit] Hardware refactoring[edit]

Normal Stuff - Personal names around the world Background People who create web forms, databases, or ontologies are often unaware how different people’s names can be in other countries. They build their forms or databases in a way that assumes too much on the part of foreign users. This article will first introduce you to some of the different styles used for personal names, and then some of the possible implications for handling those on the Web. This article doesn't provide all the answers – the best answer will vary according to the needs of the application, and in most cases, it may be difficult to find a 'perfect' solution. Scenarios There are a couple of key scenarios to consider. You are designing a form in a single language (let’s assume English) that people from around the world will be filling in. In reality, you will probably not be able to localize for every different culture, so even if you rely on approach 2, some people will still use a form that is not intended specifically for their culture. Examples of differences .

The Mozart Programming System Application structure: Concepts & Features I spoke about this topic quite a bit in ALT.Net Seattle. This is mostly relating to application architecture and how you structure your application. This is the logical result of applying the Open Closed and Single Responsibility Principles. Feature may not be as overloaded a term in our industry as a service, but it still important to define exactly what I mean. A feature creation may not involve any design activity. That is probably something that would raise a few eyebrows, but the idea is very simple. Let us take NH Prof as a good example. Session & statements Stack trace Loaded entities Reports Alerts Filtering That is it. As for features? Remember that a feature involves no design? We can get to this situation by paying attention to friction points, applying the Open Close Principle and utilizing conventions. A real world example would be NH Prof’s alerts. Let us say that we want to give an alert about too many joins. Adding this class means that NH Prof will: That is almost it.

styleguide - Project Hosting on Google Code You are NOT a Software Engineer! - chrisaitchison.com You are not a Software Engineer. You do not build skyscrapers. You do not build bridges. You grow gardens. You are a Software Gardener. Do you try to plan your gardens in such detail that you know where each leaf will be positioned before you plant a single seed? You probably have a good idea of what your garden should look like a week into the future. If you were building a bridge or a skyscraper and you told me, before you began, that you knew exactly how it would look when it was finished – I would believe you. So why do so many gardens fail, yet so many skyscrapers succeed? Remember that time when someone in your company unsuccessfully used an Agile gardening methodology, and then went around saying that it was horse shit that doesn’t work? Unlike a skyscraper, your garden will grow weeds. In most countries, Engineers need a license to build a bridge. I am a Software Gardener. So are you.

Related: