Skip to content

Start working on COR notes#35

Open
tekknolagi wants to merge 23 commits into
mainfrom
mb-cor-4
Open

Start working on COR notes#35
tekknolagi wants to merge 23 commits into
mainfrom
mb-cor-4

Conversation

@tekknolagi
Copy link
Copy Markdown
Owner

  • Some edits for lecture 1
  • Add Falsehoods
  • wip

Comment thread lecture-notes/4-cor.md Outdated
Comment thread lecture-notes/4-cor.md
have received, injuring several people and killing several people.

On a less serious note, bugs can lead to revenue loss, or wasting people's
On a less serious note, bugs can lead to data loss, or revenue loss, or wasting people's
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line wrap

Comment thread lecture-notes/4-cor.md
happy little accidents. You won't always be writing code for small projects,
though.
though. You might be writing video game software and [accidentally delete
people's home
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of code is hard to test so I wonder if it is worth writing a "don't just look where the light is" kind of suggestion here... but I don't know what the point is

Comment thread lecture-notes/4-cor.md
directories](https://github.com/valvesoftware/steam-for-linux/issues/3671).
That would be a huge problem.

So let's assume we want to reduce the quantity of bugs as much as possible. The
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"want to end up with as few bugs as possible" flows better, I think.

Comment thread lecture-notes/4-cor.md

Some time ago, Patrick McKenzie wrote a blog post called [Falsehoods
Programmers Believe About
Names](https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: make this (and the one below) named links so they don't disrupt text flow?

Comment thread lecture-notes/4-cor.md
Names](https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/).
In it, he lists common but false assumptions about names that lead to bugs in
software. Bad name handling is especially tricky because it can disenfranchise
entire classes of people. Imagine not being able to sign up for a service
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
entire classes of people. Imagine not being able to sign up for a service
entire groups of people. Imagine not being able to sign up for a service

Comment thread lecture-notes/4-cor.md
Comment on lines +163 to +166
of domains and common problems in software. While they are probably not all
worth reading and understanding in totality, it is certainly worth becoming
more mindful about the assumptions you bring to the table and accidentally bake
into software.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be shortened and made more direct, but I'm struggling to suggest how. Will come back to it.

Comment thread lecture-notes/4-cor.md
}
```

This function alone had several cases: the node is `NULL`; the root has the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/had several cases/must tolerate several different inputs/ or something? I think we should be more precise about what we mean by a "case".

Comment thread lecture-notes/4-cor.md
expected value; the node has no children; the node has one child; the node has
two children. Even though you probably should write unit tests, that's a
manageable number of cases to test manually.
manageable number of cases to test manually... for now. Are you going to
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace "Even though…" with "It might be tempting to test those inputs manually: there aren't that many, and writing tests takes time. But are you going …"? Just rewording to flow better, no technical complaints with existing wording.

Comment thread lecture-notes/4-cor.md
all*[^tdd-orthodoxy]. What do you type first?

[^tdd-orthodoxy]: This is what the Test Driven Development orthodoxy preaches.
I have my personal opinions about that---I think starting test first
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
I have my personal opinions about that---I think starting test first
I have my personal opinions about that---I think starting test-first

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh. really?

Comment thread lecture-notes/4-cor.md

### What even is a specification?

We're probably going to start some fights by saying this, but a *specification*
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you say it'll start fights, you should explain why.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fight me

Comment thread lecture-notes/4-cor.md
Neat. The tests passed. But what does that *mean*?

Ignore the particulars of the syntax and the names of things for a moment.
Focus on the function calls to `isEven`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Focus on the function calls to `isEven`.
Focus on the function calls to `isEven()`.

I tend to use parens to disambiguation function names from symbol names, but feel free to ignore if that's not your precedent here.

Comment thread lecture-notes/4-cor.md
standard that allows the two compilers to implement a behavior differently.
of writing code, the world changes. Time passes, bits rot, and people die, no
matter how much we try to stop it. Take a moment to call your loved ones and
tell them how much they mean to you.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ominous

Comment thread lecture-notes/4-cor.md

## Lecture 4.5

### Strategies for isolating units
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we talk about mocking here, let's speak critically about it. It has its uses, but it's not a magic bullet---and in Tom's opinion, most real-world implementations are quite lacking and often require the programmer to make non-test code harder to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants