Program JavaZone

Foredrag Onsdag 2. september

Snake in 10 Lines: Learning More by Coding Less

Room 2

Engelsk 1 t Kotlin clean code gamification concise coding

Guus de Wit

Guus is a Java/Kotlin developer at adesso Netherlands. With a passion for puzzles and a background in science, he strives for elegant solutions to complex problems. In his spare time, he likes to over-optimize the simple tasks of today, to hopefully live a lazy life tomorrow

Can you create a complete game with just 10 lines of code? That was the quest I set myself when recreating the classic game Snake in as few lines as possible. Let me tell you: I was not ready for the types of challenges I would face. For example, just registering button presses was not as straightforward as I had hoped.

Through live coding, I will show you how I overcame these obstacles and distilled Snake to its absolute essence. What key elements make this game instantly recognizable? By combining Kotlin and Swing, we will end up with a minimal code base and if not award-winning, at least a playable version of Snake.

Striving for conciseness led me to a deeper understanding of the code. I will show how constraints push us to think outside the box and lead to more creative solutions. Moreover, my approach can be applied to any problem. Sometimes the best way to understand code is by seeing how little of it you actually need!

This session is suitable for all audiences, regardless of experience level. You will learn concise coding techniques. The demos are done in Kotlin, but no prior experience is necessary.

  1. Hacking i "gamle" dager - røverhistorier fra 80- og 90-tallet Room 1
  2. How Are We Doing? Practical Metrics that Matter Room 3
  3. Secure-by-Inclusion: Preventing Accessibility Barriers from Becoming Security Vulnerabilities Room 4
  4. Let's Dance! - Teaching your Robot some Moves with Reinforcement Learning Room 5