Courses & Documentary

Professor Answers Coding Questions

UC Berkeley Computer Science Professor Sarah Chasons, in a comprehensive segment for WIRED, offered clarity on the fundamental concepts of coding, from its earliest history to the challenges and future of AI-assisted programming. Chasons reassured novices that deep mathematics knowledge is not a prerequisite for the field, stating definitively, "No, you can absolutely get into programming, get really good at programming without being into math". She added that programming is like any learned skill, such as riding a bike or playing guitar, where certain actions become automatic over time.

The evolution of computing, Chasons explained, is built on simple principles. The first website, created by Tim Berners-Lee in the early 90s to describe the worldwide web, is still available and "displays in a totally readable and manageable manner" in modern browsers like Safari. Early computers, such as the ENIAC, were programmed by physically plugging together wires, much like "old school telephone switchboards," requiring humans to write out the ones and zeros. This painstaking process led the "amazing early computing pioneer" Grace Hopper to develop the term and concept of the compiler. Hopper invented the tool A0, the predecessor to the modern compiler, with the idea of having a program on the machine handle the compilation. The modern compiler process involves four key stages for a simple program like (1 + 2) + 4: first is lexing or tokenizing, where components are recognized as separate "tokens"; next, these tokens are structured into a tree to understand the program’s flow; this is followed by code generation, turning the structure into processor instructions like move and add; and finally, these instructions are converted into ones and zeros.

 

Related article - Uphorial Shopify 

Professor Answers Coding Questions | Tech Support | WIRED

Chasons detailed how programming languages differ largely in how much they "have your back" against bugs. C offers minimal protection, telling the programmer "You're on your own," while Python balances safety by trying to catch some bugs without demanding a lot of extra input. Rust, on the other hand, demands "extra information" from the programmer, forcing them to "work harder," but in exchange catches far more bugs, making it "one of the most exciting newish programming languages".

Chasons advised that while C++ is necessary for engaging with existing codebases, those starting a new project should look into Rust. The difficulty of fixing code, known as debugging, is inherently harder than writing it because debugging means the programmer’s "mental model of what the program is doing" has "diverged" from what the program is actually doing. This is even harder when reading code written by someone else, as one must build the mental model from scratch.

Addressing the rise of Generative AI, Chasons confirmed that tools like ChatGPT are built on Large Language Models (LLMs), which are fundamentally programs for "putting together words that look good together". LLMs are trained by playing a continuous "fill-in-the-blank game" on vast collections of human-generated documents, a process that can take about "300 400 years of compute time" when measured linearly. Chasons stressed that deep coding knowledge is still essential to effectively use these tools, as programmers must first be trained to "decompose programming problems" into small, manageable chunks. She recommended breaking a problem down to an ideal size of about "fiveish lines of code," describing the steps in pseudocode, and only then feeding it to the AI tool. Crucially, users must have a concrete plan to verify the output, such as running "20 tests". Relying on "vibe coding"—using an LLM to generate a program—only works for "rewriting something that has already been written many times before," and one study found that using an LLM-backed tool actually made users 20% slower, even though they perceived it made them 20% faster.

Finally, Chasons addressed the foundational question of why computers use binary (zeros and ones, or base two). While the ENIAC used base ten, binary is inherently more reliable because distinguishing between two positions of electrical flow (low or high) is much easier and more reliable than trying to differentiate between ten precise positions, as one might on a dimmer switch.

site_map