Today we learnt about what constitutes Quality Code:
We also learnt about rails model associations, how a join table helps join two tables/models’ data for a many-to-many relationship. In teams of two, we drew a diagram called an entity relationship diagram and also used Trello (an online kan ban board) to plot our user stories/app features. We will be working on a twitter app for the next 2-3 weeks.
One of our assignments was to do a kata at Code Wars – Sum with Highest and Lowest .
I tried it and although i passed the tests, i couldn’t pass the null/empty? test. I was annoyed because I just couldn’t figure out what was wrong when i clearly wrote it correctly (if .null? or .empty?) but then in a fit of what-the-heck, I took out the .empty? method, and rerun the tests again, and this time, the code passed. I guessed the question was worded wrongly, It should just be null, not empty, since null != empty.
So lesson here – just write enough to pass the test. And sometimes the questions are wrong. And i nearly gave up actually, I thought there’s no way to pass even if you got the code correct, but then yeah, I guess I got to keep trying.