< More Posts
Published 26 July 2020 at Yours, Kewbish. 1242 words. Subscribe via RSS.
Also published on Dev.to.
Finally, we’re getting into the more ‘application’ side on things - also known as the part where I’m more comfortable with. With my initial predictions, I’d predicted that Week 6 (where we are now) was where it’d get slightly easier. And I was right - Week 6 was a welcome week, an introduction to Python. I’m already somewhat decent at Python, so this week wasn’t such a struggle, and Week 7 was a great mix of new tech / familiar tech.
I was actually pretty surprised how ‘natural’ C already felt, and I caught myself trying to
printf("") instead of
I was also pleasantly surprised how intuitive SQL was to write - nearly like plain English1. SQL was one of those ‘I’ll learn it later eventually’ things that I used to keep putting off, but I’m happy I finally took the time to learn it. For database-y things in my projects that have required a backend, I’ve mostly used Firebase (and Mongo once, but that didn’t pan out very well), so relational databases were a refreshing new experience.
Notes: To be honest, 90% of the lecture was the basics of Python, which I’d already known, so have some Python regex notes instead!
\nare entered as a slash and a n
.denotes any character
.*denotes 0 or more characters
.+denotes 1 or more characters or matches
^denotes a start
$denotes the end of input
.searchtakes two+ arguments
yes, you could do something like ‘^y(es)?$’
Problems: Finally being able to write implementations of the C problems in Python (which is what I was mentally doing the problems in anyhow) was extremely refreshing. I could actually use list comprehensions and not the clunky 3+ line for loop syntax, and my ternary expressions actually worked! (Probably due to the fact I misordered something or other in C, but anyhow, I greatly prefer Python.) Python’s just a lot more concise and as someone once put it, it reads like pseudocode. That makes it a lot easier to translate my brainwaves into proper, functioning programs, unlike C, where I generally had to wrestle with pointers and such.
As a comparison, here are some of the line counts of the problems in problem set 6.
.schemato access the schema, or layout of the database
.import [file] [name]to import a CSV or similar file
*is a wildcard -> select all
%-> some characters
group by x
wherematches a specific condition
likematches substrings of text
joinjoins a second table to the first
onbit to compare two pieces of data
db = SQL('path')
The two problems were pretty intuitive to solve, and only minor Googling was needed. Definitely around as challenging as the Python bit.
We’re almost done with the main chunk of CS50. I’m pretty surprised how fast these first 7 weeks went by - only the track (which I’m greatly looking forward to) and the final project (which I have a good idea for) to go! These’ll probably take a while to complete as well, but I’m committed to writing a blog post a week describing my experiences.
Speaking of tracks, I’m planning on doing the Web track. I have experience with web technologies already, so this seemed like a logical choice. In past posts, people have commented that the Web track was a little outdated, so we’ll see about that. I’m excited to get more acquainted with Flask, as well. Like SQL, getting more experience with Python in the web has been a ‘one of those days’ things, and hopefully, this will be a good reintroduction.3 If I have time, I’m planning on working through parts of CS50 Web Programming as well - though I might skip the React bit, or take time to learn more Vue in place of it.
Haven’t been working on much in terms of side projects recently, which is unfortunate, but I have too much to do. Scree - if only we had more time. We all wish, hmm?
Which also, in a way, is technically true. ↩︎
At this point, I realized that this post was still really short, and I still had time in the week to work on SQL, so I guess here’s another combination post! ↩︎
I wrote exactly one Flask app in the past. Was a little confusing. Also the only time I tried Mongo, but then again, this was only a couple months ago. ↩︎
- Yours, Kewbish
< More Posts