Friyay
Week 1 ✓
Wow, I cannot believe that it has already been a week working at Clean Coders! Time flew by so quickly for me, and I’m afraid that the next five months are also going to be gone just like that. Hmmm it seems like when you are enjoying yourself time does tend to move quickly 😄 Not that I am counting down the days or anything but there are 140 days until October 1st, 2021. Considering that I started my apprenticeship on May 10, 2021 roughly ~five months from now should get me to October (psst the apprenticeship is for five months). Somehow converting the number of months to days gives me a better idea of how much time I have before the conclusion of the apprenticeship and while 140 days is a long time, I want to squeeze the most I can out of every single day. The one thing that disappoints me the most is when I have a day where I was not giving my best and I let myself get lazy and complacent. But anyways, I am glad that I finished the Clojure Koans yesterday AND I made it through my first week of my apprenticeship!
Today’s Tasks:
- Just for my own benefit, I am going over the Clojure Koans one more time to solidfy what I have learned & also to double check my understanding. Plan is to work through koans #1 - 9.
- Solve some euler problems. (Plan is to figure out how many I want to get done on a daily basis.)
- Get some preliminary work done on Bowling Game Kata
- Start reading through Programming Clojure (Goal is to take my time & absorb the material.)
Challenges
- Getting enough sleep! I think this is my first challenge that is not strictly code/work related. I have been trying to wake up early in the morning (5ish AM) and head to the office to get an early start on my day. However, I have been going to sleep around 11PM/12AM so I have not been giving myself adequate sleep. The goal is to commit to a healthy sleep schedule where I get the sleep that I need and be able to wake up early.
TIL
- The difference between a seq and a list
- Getting the length of a seq can be costly
- A list always holds a record of its own length. So, the operation of counting a list is
O(1)
, i.e. constant time - On the other hand, a seq needs to first traverse itself to get its
count
- A list always holds a record of its own length. So, the operation of counting a list is
- seqs can be lazy, whereas lists cannot
- seqs can be infinite, thus uncountable; whereas, lists are always countable
- Getting the length of a seq can be costly
- The difference between functions cons(seq) and a conj(list)
- The # of arguments each function takes
conj
accepts any number of arguments to insert into a collectioncons
, on the other hand, only takes one argument
- Class of the returned value
(class (**conj** '(1 2 3) 4))
returnsclojure.lang.PersistentList
(class (**cons** 4 '(1 2 3)))
returnsclojure.lang.Cons
- The generalized usage of
cons
is defined to be: construct a record of some type or other to hold a number of values together.
- The generalized usage of
- The two types of returned classes are not interchangeable.
clojure.lang.Cons
does not implementclojure.lang.Counted
count
onclojure.lang.Cons
is no longer a constant time operation.
- An interesting tidbit on the names cons and conj
cons
means to cons(truct a seq)conj
means to conj(oin an item into a collection)
- The # of arguments each function takes
- Roughly speaking, a
PersistentArrayMap
will be turned into aPersistentHashMap
as soon as it grows beyond 9 entries.
The Weekend and Week 2 Expectations
My plan over the weekend is to go night time hiking at Piestewa with my mom and brother on Saturday and on Sunday hang out with a couple of friends at snakes and latte. I’m looking forward to two of my favorite activities which are hanging out my friends & getting in some good exercise. After my meeting with Micah yesterday, what stood out to me was when Micah was telling me that he is looking for teammates, not employees. He wants someone who is proactive and has a desire to grow and improve. His sentiment resonated with me, and now I have a solid understanding of why everything seems laid-back and hands-off. That’s because it is up to me to decide what I am going to do with my time instead of having someone micro-manage me. What a great opportunity for me to rise to the occasion and do the best that I can. Looking ahead to week 2 I am even more determined and excited to bring my A-game for that week.