CS50's Web Programming with Python and JavaScript: Hello, World!

Ross P. Coron
5 min readJun 21, 2019

--

This is part zero of a six-part series following my progress through Harvard University’s CS50W (Web Programming with Python and JavaScript) programming course.

This entry describes my experience with CS50 and motivation to study CS50W. For a video walkthrough of my CS50 final project click HERE. The next entry in this series (HTML, CSS, Git, and the Search PSET) can be found HERE.

Hello, World! Like many others in the UK, I grew up in the slightly fuzzy glow of two computers: my parents’ TRS-80 and the ubiquitous — almost obligatory — BBC Micro system owned by my local primary school. Both computers allowed users to program in BASIC. In the absence of any resources on how to learn or utilise the language, I was restricted to highly efficient three-line programs (four if you count the RUN command) extolling my virtues / my brother’s lack of virtues depending on the audience.

An example of my prodigious childhood programming output.

As a molecular biology / biochemistry PhD student and in subsequent postdoctoral research positions, I was increasingly performing and analysing large ‘omics’ experiments. Aware that programming would likely be a highly useful tool, I downloaded a text editor; printed ‘Hello, World!’ in Python; learned about for loops; and then proceeded to do nothing more with the subject.

After leaving the laboratory for a career in health policy, I decided to make an effort (this time a relatively serious effort) to learn programming — to move beyond for loops and perhaps even study the highly exotic while loop. This decision was driven by three primary factors: a sustained interest in the topic; an unresolved frustration at my previous efforts; and to apply programming techniques to fields outside of computer science and traditional STEM subjects. For example, I had been frustrated at a London health policy conference when an attendee confidently claimed that there was no space for technology or innovation in the field — I was suspicious at the time that this was incorrect; I am now confident the statement was entirely wrong.

After searching for programming courses online (and completing what I now view to be a valuable but inferior Stanford course, Computer Science 101), I began Harvard University’s online offering of CS50, ‘CS50x: Introduction to Computer Science’ in mid-2018. Towards the start of 2019, I completed the course. I found it to be a hugely generous, well-designed, and robust introduction to computer science and programming; teaching me how to solve problems efficiently and algorithmically.

I agree fully with the words of the course organisers who described CS50 as “demanding, but definitely doable. Social, but educational. A focused topic, but broadly applicable skills. …[a] quintessential Harvard (and Yale!) course.”

Course topics included abstraction, algorithms, data structures, resource management, and web development, and utilised a wide range of programming languages such as C, Python, and JavaScript. In addition to nine extensive and professionally produced lectures and accompanying shorts (short, topic-specific videos covering standalone subjects such as recursion, CSS, and singly-linked lists), most weeks ended with a graded problem set (PSET) inspired by real-world domains such as cryptography, music, web design, and finance. Starting with a simple ‘Hello, World!’ program written in C, the course culminated in a final project — an opportunity to utilise the skills learned in previous weeks to design and implement a custom piece of software.

My final project (GPS50) was a simple online GPS viewer. Users could upload a GPS file to a website and see their activity superimposed over a Google Maps overlay alongside activity data (time, pace, etc.) ala Strava. The program (a web application) was written primarily in Python using the Flask web framework and JavaScript for error-checking, displaying a Google Maps interface, and rendering GPS activities. SQLite was used for user registration / login and for saving previous activities. If nothing else, the project demonstrated that I had progressed well beyond simple for loops, earning me a course completion certificate.

GPS50 front end showing a GPS activity rendered over an embedded Google Maps overlay…
…and the back end: a Python ‘application’ file (left) responsible for reading an uploaded GPS file, calculating paces, etc.

At some point I will publish my thoughts on CS50 (including a 10-part series about my frustrations implementing a spell checker in C using an array of pointers — see image below). In brief, I am borderline evangelical about the course and was saddened to hear my final “This is CS50!” sign-off. However (like many others presumably), my skills currently sit at a frustrating level: I know enough programming to realise how much is possible in theory but also recognise just how limited my knowledge is. This potential also feels somewhat overwhelming: if I can apply programming to almost any field, where is a good place to start? Essentially, I have come to the conclusion that I need a little more structured guidance before I start implementing my own ideas and projects.

My (normally neat) notes descending into chaos trying to implement the CS50 Speller PSET using an array of pointers.

Fortuitously, CS50 now offers two follow up courses: Web Programming with Python and JavaScript, and Introduction to Game Development. As someone who likes computer games and dislikes JavaScript, CSS, HTML, and Bootstrap, I have made the masochistic choice to pursue the web programming option, my thinking being that my dislike for web programming stems from a poor understanding of the utilised techniques and that my personal project ambitions would be better served by the course over studying the mechanics of Flappy Bird (with apologies to the (likely multi-millionaire) creator of Flappy Bird).

Much has been written about CS50; less about CS50’s Web Programming with Python and JavaScript. This Medium series will follow my progression through the course — from my first Git pull request(?) to my final project; sharing my frustrations (likely), successes (hopefully), and thoughts (unstructured).

printf(“Right, let's get started…\n”);

--

--

Ross P. Coron

Rehabilitated academic. I enjoy solving complex problems with pipettes, programming, and policy. Twitter: @Ross_Coron; LinkedIn: www.linkedin.com/in/ross-coron/