Open in app
Alonso Del Arte
166 Followers
About

Sign in

166 Followers
About
Open in app
Alonso Del Arte

Alonso Del Arte

·Nov 22, 2020

Let's say I'm a complete C# beginner, but let's say I've been taught about If-Else and Switch. Why would I choose If-Else instead of Switch for `getMonthName( )`?

It’s no real issue yet. You can easily turn this into a bunch of if-else statements — or a switch — and never look back. You’d perhaps implement it like this below.

Replacing Logical Statements With Table Driven Methods
578
8

Nicklas Millard

More from Alonso Del Arte

is a composer and photographer from Detroit, Michigan. He has been working on a Java program to display certain mathematical diagrams.

More From Medium

A quick little primer on Javadoc

Alonso Del Arte in CodeX

The Basics of Singleton Objects in Scala

Alonso Del Arte in The Startup

Java access modifiers: which to choose when, and why

Alonso Del Arte

A couple of notes about exceptions and interfaces in Java

Alonso Del Arte in Level Up Coding

Java access modifiers: examples from a game

Alonso Del Arte in Dev Genius

Watch out for nulls from Java’s collections

Alonso Del Arte in Level Up Coding

Syntax Highlighting Can Be a Crutch and a Gate

Alonso Del Arte in The Startup

The basics of Java access modifiers

Alonso Del Arte

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store