Quantcast
Channel: Coding style – Schneide Blog
Browsing all 27 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Separate your code domains

When you develop software, you most likely have to think in two target domains at the same time. One domain will be the world of your stakeholder. He might talk about business rules and business...

View Article



Image may be NSFW.
Clik here to view.

Readability of Boolean Expressions

Following up on various previous posts on code readability and style I want to provide two more examples today – this time under the common theme of “handling of boolean values”. Consider this (1a):...

View Article

Image may be NSFW.
Clik here to view.

Readable Code Needs Time and Care

A few weeks ago I was about to write an acceptance test involving socket communication. Since I was only interested in a particular sequence of exchanged data, I needed to wait for the start command...

View Article

Image may be NSFW.
Clik here to view.

Class names with verbs enforce the Single Responsibility Principle (SRP)

I’m experimenting with fluent code for a while now. Fluent code is code that everybody can read out loud and understand immediately. I’ve blogged on this topic already and it’s not big news, but I’ve...

View Article

Image may be NSFW.
Clik here to view.

Solutions to common Java enum problems

Say, you have an enum representing a state: enum State { A, B, C, D; } And you want to know if a state is a final state. In our example C and D should be final. An initial attempt might be to use a...

View Article


Image may be NSFW.
Clik here to view.

Designing an API? Good luck!

If you’ve developed software to some extent, you’ve probably used dozens if not hundreds of APIs, so called Application Programming Interfaces. In short, APIs are the visible part of a library or...

View Article

Image may be NSFW.
Clik here to view.

Object Calisthenics: Change the way you think

Some time ago I spoke with my colleague about skill sharpening and training the brain to come up with new solutions. He proposed a two hour session at the weekend implementing a small game using object...

View Article

Image may be NSFW.
Clik here to view.

From ugly to pretty – Three steps is all it takes

I hold lectures in software engineering for over a decade now. One major topic is testing, specifically unit tests. Other corner stones are refactorings and code readability. So whenever I have the...

View Article


Image may be NSFW.
Clik here to view.

Should I test this?

Writing software is hard, writing correct software is even harder. So everything that helps you writing better or more correct software should be used to your advantage. But does every test help? And...

View Article


Image may be NSFW.
Clik here to view.

Don’t ever not avoid negative logic

I start this post with a confession: I’m not able to discern true from false. I wasn’t born with this inability, it got worse over time. The first time I knew I have this problem was in driver’s school...

View Article

Image may be NSFW.
Clik here to view.

TANGO device server architecture

In my previous post I explained the basics of TANGO and why you probably want to use TANGO for development of a distributed system. Now I would like to explain how to build and design a TANGO device...

View Article

Image may be NSFW.
Clik here to view.

Managing C++’s complexity or learning to enjoy C++

Disclaimer I have never been a big fan of C++ coming from C and Java. C is a nice little language and yet offers many means of code structuring. Java offers many object-oriented features and makes the...

View Article

Image may be NSFW.
Clik here to view.

The typography of source code

Take a look at the following source code, can you guess which language this is written in? It’s CSS. CSS has a typical layout with a minimal indentation depth where a group of selectors embraces lines...

View Article


Image may be NSFW.
Clik here to view.

Software development is code organization

The biggest problem in developing and maintaining software is understanding code. Software developers should get good training in crafting code which can be understood. To make sense of the mess we...

View Article

Image may be NSFW.
Clik here to view.

Physical Quantities in C#

Scientific applications usually perform lots of calculations with physical quantities. If you do not represent them properly in your code you run the risk of mixing them up. For example, it’s easy to...

View Article


Image may be NSFW.
Clik here to view.

Quantities in C++ and User Defined Literals

Some weeks ago one of my colleagues wrote about the use and implementation of physical quantities in C#. If you are writing an application in the technical or scientific domain chances are high that...

View Article

Image may be NSFW.
Clik here to view.

Meet my Expectations!

A while ago I came across a particulary irritating piece of code in a somewhat harmlessly looking mathematical vector class. C++’s rare feature of operator overloading makes it a good fit for...

View Article


Image may be NSFW.
Clik here to view.

Simple C++11 – Part II – Class declarations

In the previous part, I’ve shown my guidelines for setting up compilation units. When writing simple application code with C++11, either classes or free-functions should be your main building blocks....

View Article

Image may be NSFW.
Clik here to view.

Explicit types – and when to use them

Many modern programming languages offer a way declare variables without an explicit type if the type can be inferred, either dynamically or statically. Many also allow for variables to be explicitly...

View Article

Image may be NSFW.
Clik here to view.

Every time you write a getter, a function dies

Don’t be too alarmed by the title. Functions are immortal concepts and there’s nothing wrong with a getter method. Except when you write code under the rules of the Object Calisthenics (rule number 9...

View Article
Browsing all 27 articles
Browse latest View live




Latest Images