6 min read

Days 36-40: Code with Benny

๐Ÿ‘‰
Welcome to Days 36-40 of my 100 days of coding challenge! Glad you're here ๐Ÿ™‚

Check out my last two posts: Days 26-30, Days 31-35

If you're curious what this is all about: Introduction to Code with Benny.

Follow me on twitter! All of these daily logs are posted there in short-form ๐Ÿ™‚

What I've done so far:

This week, I'm still in ๐Ÿ“Cambodia ๐Ÿ˜„ Between coding and marathon training, I'm filling my time with exploring temples (Angkor Wat!), learning how to wakeboard, and meeting other travelers. Loving it here.

๐Ÿ’ก
Check out my Notion Learnings Database for details on what I'm learning. I log all my notes there - daily!

Day 36 (April 18th, 2023)

What I covered/did

Almost all of the second half of Week 2 lecture of Harvard's CS50!

  • Arrays in C
  • Strings - writing a function to find the length of a strength, convert strings to lowercase, and more
  • Command Line Arguments

Resources I used

Thoughts

Hectic day in Cambodia today. Lots of fun learning a new sport (wakeboarding!), and enjoying our new airbnb. It's an amazing place - they use the money from the airbnb room rentals to fund a small community school on the property. Lovely people.

On the coding front: I'm slowly learning more nuances around the various data types that the Replit Python course covered mostly from a functional, here-is-how-to-use-this standpoint. CS50, on the other hand, is clearly going for a more complete education in computer science for its audience. I think that's really enjoyable, but I'm not convinced yet that all of this would be useful to know given my goal of moving as quickly as possible to using the most modern tools to build web apps.

But while I'm traveling, I'm enjoying this slower, more comprehensive study of computer science concepts. Will reevaluate once I'm back in Bali at the end of this week.

Day 37

What I covered/did

Finished out Week 2 of Harvard's CS50, including skimming through the Week 2 problem sets, lab and practice problems.

  • Exit Status
  • Cryptography
  • "Coleman-Liau" formula for determining readability of a piece of writing

Resources I used

Thoughts

The practice problems didn't seem like useful exercises (and I could implement the solutions more easily using Python), so I decided not to build the solutions. Same for the lab and problem sets. Readability seemed interesting because of the โ€œColeman-Liauโ€ formula for determining how hard a piece of writing is in terms of reading grade level, but I donโ€™t think too difficult to implement.

Moving on to Week 3! Algorithms - quite excited for this.

Day 38

What I covered/did

First half of Week 3 of Harvard's CS50!

  • Algorithms!
  • Linear and Binary Search
  • Data Structures in C
  • Sorting algorithms (selection, bubble)

Resources I used

Thoughts

Was quite excited to cover this lesson in CS50. I think I've had surface level understanding of various algorithms for a long time (stemming from high school computer science), but have always wanted to understand how I could make use of algorithms for more efficient coding, and how they may or may not be useful in my indie hacking journey.

I really enjoyed learning how you can invent a new data structure in C for use elsewhere in your code. The Python equivalent seems to be dictionaries allowing for key/value pairings of many different data types. This basically allows you to get past having to define a data type, and instead of that, you can just create an array that includes all kinds of different types that you desire. That being said, I've heard of Python concepts like sets and tuples that I haven't covered yet, and these might be more relevant to the data structure concept in C.

Also: today I experienced some of the hottest weather I have ever experienced in my life:

That's 98.6ยฐF with a real feel of 113ยฐF for my fellow Americans

Which was accompanied by this Bloomberg headline:

I was sweating down my back within 2 minutes of walking outside. The heat was oppressive and exhausting - I spent four hours exploring temples around Angkor Wat this morning, and felt like A/C was heaven afterwards.

Day 39

What I covered/did

Second half of Week 3 of Harvard's CS50, as well as skimming through the Week 3 problem sets, lab and practice problems!

  • Recursion
  • Merge sort

Resources I used

Thoughts

One of the examples for recursion that the course ran through gave me quite a bit of confusion. With some help from ChatGPT and the debug program in the VSCode Browser IDE, I figured out what was going on - essentially, the recursion example creates a "to-do list" (known as a "call stack") of sorts for the computer, where you are initially calling the same program multiple times, checking for an "if" condition, and if each run through the program passes the if condition each time, then each of those runs gets added to the call stack. Then, the call stack is unraveled in reverse order (last in, first out), executing the part of the code further down in the function right after the line that caused the program to loop back to the "if" condition check. Pretty interesting - not sure if this made written sense, but feel free to check out my more detailed notes on this here.

This was a challenging day to follow the logic of recursion and merge sort. I wanted to learn it thoroughly and feel good about my understanding here, but definitely had to make some unexpected mental jumps. Good stuff CS50 ๐Ÿ˜Š

While I'm not usually working through the problem sets/labs/practice problems, I do read through the setup and any code provided to gauge my understanding of the problem. I love that CS50 always uses interesting problem prompts that go deep into some nuanced system. In the case of problem set 3, tideman, they discussed ranked choice voting and different ways to interpret different ballot outcomes under that voting system. Really enjoyed reading through this. I think I'd consider circling back to understand the implementation of the solution and try to solve it myself later on.

Day 40

What I covered/did

First half of Week 4 of Harvard's CS50!

  • Hexadecimal review for me
  • Addresses & Pointers
  • Strings and memory

Resources I used

Thoughts

I'm now understanding why C is described as a language that will help you understand how computers work. Today's work with memory and how C uses pointers to work with memory addresses was pretty interesting and got a bit logically messy at the end of my learning today.

Enjoyed CS50 stuff this week a lot. Today I wrap up my 2 weeks of work-travel and head back to Bali for a bit of routine, which I'm very excited for. Getting close to being halfway done with the 100 Days! I've repeated this ad nauseam but I think I want the second half of my 100 Days to be much heavier on the project-building side of things (and less travel-heavy! Although looking ahead, I might have to wait for the last 30 days of the challenge for that. The marathon is May 20, and until then, the travel and training itinerary is looking pretty full).

Now, for some fun pictures of Angkor Wat as well as surrounding temples Bayon Temple and Ta Prohm Temple. Enjoy :)

Not a temple, but our beautiful airbnb that uses the money from the room rental to fun a small community school called "The Community School of Hope"

That's all for this week - thanks for reading. 60 days left ๐Ÿ˜Š

๐Ÿ’ก
Don't forget to follow me on twitter - all of these daily logs are posted there in short-form ๐Ÿ™‚