April 23
- decided to practice basic Java, TDD, and baby steps by doing http://codingdojo.org/kata/FizzBuzz/ on my own from scratch (did parts of it in mobs already quite some time ago)
- decided to install the latest stable Java version: https://jdk.java.net/
- create new Java project from scratch, see https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html --> learned new shortcut: Alt+Insert to generate new item
- set up the project as very simple starting point to go baby steps and practice TDD on my own
- added license, readme, gitignore files
- pushed to GitHub
April 24
- changed setup a bit to better suit the purpose
- wrote test for second case, then wrote code to make it pass
- agreed with myself that I will commit frequently, at least every time a new test is passing
- had to remember to run test first, see it fail, then implement, run the test again, see it pass
- baby steps and frequent commits (trying not to care about how elegant the solution is in the beginning as long as it's working) really helped get myself into a flow! Feeling I accomplish something and am on the right track
- first implementation fulfilling requirements was done very quickly
- personal observation: though doing quick commits (even when small) was at first still strange, it now felt a lot more natural to just create a repo and make several commits to it; was so scary in the beginning!!! A lot less already, can be proud :)
- TODO: decide on what else to do, like reduce to required tests
- TODO: finish challenge and seek the next one, this was meant to be a very small and short one
April 25
- removed superfluous tests; checked for code coverage; decided to keep two tests for the same branch, for cases 1 and 2 as the case for 1 is often handled in a special way
- figured that the original implementation also works for 0 and negative values which might be fine or not, not explicitly covered in requirements; would start a conversation about this
- decided to limit the implementation to the number range 1-100; any number out of range should return a related message
- discovered that one of my current coworkers commented on the kata! :D http://codingdojo.org/kata/FizzBuzz/
- I assumed I solved the problem in a very easy and not elegant way; looked for alternative solutions for the problem
- interesting JavaScript solutions: https://ditam.github.io/posts/fizzbuzz/ (oh my, I still have a long way to go understand even only half of them) & https://codeburst.io/javascript-breaking-down-the-shortest-possible-fizzbuzz-answer-94a0ad9d128a & https://www.codecademy.com/en/forum_questions/52ae8600631fe92cc000a168
- Java solutions: https://codereview.stackexchange.com/questions/74443/fizzbuzz-problem-solution & https://javarevisited.blogspot.com/2015/04/fizzbuzz-solution-in-java-8.html (really liked the Java8 solution using Java 8 Optional, map and Stream map() function) & https://howtodoinjava.com/puzzles/fizzbuzz-solution-java/
- decided to not extend the challenge by extending or changing requirements (at least not on my own ;))
- I'm already eager to move on to the next small challenge!
No comments:
Post a Comment