CS50 - Week 1: Wednesday - Getting started with C, introduction to tools, bugs

Today I watched Week 1, lecture 1. In this lecture, we got acquainted with the programming environment for students (the CS50 appliance), the simple code editor, and began to make the leap from the graphic programming Scratch to the word-based programming language C.

We learned the "quirks" of getting started programming, which largely seem to boil down to the fact that computers only do what you tell them to do. By that, I mean that a missed comma is important, as the computer follows very rigid rules about how it processes its input. When I write an email to a friend, the same rules don't apply! Similarly, if I try to bake a cake, and I mess up the ingredients or the method slightly, I will likely wind up with something that, by and large, is a cake, or at least cake like.

There is another side to this argument, though, which is that in the event of a mistake, my oven will return me no do overs, no data about what went wrong, and a ruined cake. Once one learns to understand the errors, the program will return garbage, but a chance to start over with low costs. (Note: it is true that an experienced chef will know from the output what the initial errors are, so please excuse me the poor parallel.)

The several times I've tried to get started programming previously, I've run into the intimidating error problem the teacher discusses briefly: you make a small beginners mistake, and the computer throws 20 lines of uninterpretable errors! Obviously to the trained eye, these errors mean things, but it makes being a beginner very hard. As the teacher points out, these errors actually do have meanings, and if you aren't intimidated you can figure out what they mean and how to fix your program.

I already know that there are all kinds of sophisticated tools and code editors that are built to help programmers not make these errors, as well as conventions of formatting, commenting, and naming, but again, these are things that don't help true novices immediately.

So, today we learned how to make a program in C that prints "Hello World" on the screen, and then another program that asks for your name, and then says "Hello (name)". We even learned how to write a program that loops, and counts. Nothing shocking, but it's a start.

Note by Daniel Hirschberg
5 years, 9 months ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Sort by:

Top Newest

I have watched both the lectures of week 1 and I loved them. But the CS50 appliance is well over 1GB in size. That sucks:( ! I've asked one of my friends who has unlimited internet data usage [and is taking the course with me] to download it.

Mursalin Habib - 5 years, 9 months ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...