Is it true that good programmers do not use “else”?

Good programmers use state-machines, in place of if-then-else declarations.

IF you do not know state-machines, THEN you are not a good programmer, ELSE you are deluding yourself.

If you are a good programmer, you use switch-case declarations.

If you are a good programmer, you know you are allowed to use if-then-else for simple cases.

But as a good programmer, you would also realise that refusal to use or ignorance of state-machines are the reason why you have little simple cases of if-then-else peppered all over your code.

As a good programmer you would use De Morgan to simplify your logic.

As a good programmer you would use Karnaugh mapping strategies to design your logic and your state-machine STORY BOARD.

As a good programmer, you are at least aware how and when event and subscription driven logic is helpful. Where you use on-event programming.

As a good programmer you would know and understand why all the methods I stated above will make your programming life simpler thro configuration values.

You would realise how easy it is to translate business behaviour into code. You would understand why UML is so useful. You would understand the meaning of behaviour driven development.

As a good programmer you would realise that your mesh of if-then-else peppered all over your code makes it hard to debug, makes code difficult to locate, makes it hard to because you have to yank out all your if-then-else when business rules change.

As a good programmer, you would use interfaces and then injection triggered deployment of implementation of those interfaces. Rather than a mesh of if-then-else. As a good programmer, you would actually understand the gobbledy-gook I had just written.

As a good programmer you would realise that if-then-else is truly unavoidable, but you would work towards using them only when absolutely necessary.

Sorry for the bad news, programmers.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s