Skip to content

cstrap/singlepath

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SinglePath

Can you get rid of all the IFs?

The game

Submit a snippet of code containing an if–then-else construct (or any other statements causing alternative paths of execution) and for which you believe the elimination of the conditional statement is impractical or too hard.

That is: send us a snippet of code that, in your opinion, must have an if-then-else.

The goal

Collectively refactor the code, with the manifest and deliberate goal of eliminating the conditional path.

Then, reflect on the result. Was it worth the effort?

Rules

Everyone can submit a snippet of code. Just open a pull request. Use the language you prefer: Java, C#, Python, what ever you want. Just provide enough tests in order to make your intents clear.

##Java

Run the tests

On *nix run

gradle test

On Windows

./gradlew test 

About

Can you get rid of all the IFs?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 77.8%
  • Groovy 22.2%