Programming Basics: Statements & Functions: Crash Course Computer Science #12

preview_player
Показать описание
Today, Carrie Anne is going to start our overview of the fundamental building blocks of programming languages. We’ll start by creating small programs for our very own video game to show how statements and functions work. We aren’t going to code in a specific language, but we’ll show you how conditional statements like IF and ELSE statements, WHILE loops, and FOR loops control the flow of programs in nearly all languages, and then we’ll finish by packaging up these instructions into functions that can be called by our game to perform more and more complex actions.

Want to know more about Carrie Anne?

Want to find Crash Course elsewhere on the internet?

Рекомендации по теме
Комментарии
Автор

> statements like "I want tea" or "It is raining"

Hello from the UK.

armorsmith
Автор

Tip from a software engineer in the industry: The names you choose for functions and variables have a *huge* impact on how good you're going to be at completing projects. Why? It lets you read, understand, and check your code much more efficiently and surely.

armorsmith
Автор

I applaud you, crash course. It must have taken a soul crushing level of work to make this complicated mess into something that made sense to me. This series is brilliant.

jacoblevine
Автор

Is it just me or is it really satisfying when there's a new level of abstraction?

ProfessorT_
Автор

I need to point this out because I know that beginners always get confused by this: *The equals sign does not mean equals!* It means: put the thing on the right into the thing on the left. So in this example (1:18) as stated it means "Put 5 in A."

It's much easier to understand when you don't think of the equals sign as equals. The video is still excellent! Looking forward to more programming vids :D

YeoYeo
Автор

I thought for British people it was more like

while True:
get_tea()

iAMwReckLesss
Автор

I love the series, and I feel a bit bad and spoiled for wanting to complain, but this might have been a bit too fast to follow. I've been a programmer for many years, and I am feeling sleepy at the moment, but I found this episode required more effort to follow along than I expected. I like the idea of a game where Amazing Grace squashes bugs, but it might not have been the best example. This way, you need to understand the game itself (which was presented in a very abstract and loosely defined way) AND understand the programming constructs themselves. It might have worked better with an example that didn't need explanation by itself, something that most of the audience would've been already very familiar with, video game or otherwise. Just felt a bit clumsy to me (but with the best intentions, I recognize that). Those were my two cents, thank you for your attention.

TehBurek
Автор

I want to say THANK YOU, this is better than what many CS professor teach in stupid programming courses in university.

drop
Автор

Thanks Carrie Anne and Crash Course, this series is excellent and you are all doing a phenomenal job.

syk
Автор

Before I always avoided computer science topics. I always felt overwhelmed even though I belong to the hard sciences. Didn't bother me, I mean, my career should be totally independent from this. But lately at work, I'm dealing with so much data gathering and excel won't cut out--it's an inefficient nightmare. After that, I just knew I had to do something. I'm so happy to at least consider making myself literate and in this journey, this crash course series has been so enjoyable, my younger self would be so surprised. Kudos to you miss and your whole team. The effect is surely exponential. To be honest, i think that education for computer literacy should be as important and free as reading and writing in the future.

mau
Автор

This really reminds me of my computer science degree --- examples in all the languages except the ones I wanted to learn!

cknife
Автор

I lost tons of points in my AP Computer Science Exam for using bushDid911 or drinkBleach as a boolean, using theFucksIGive for an integer and using battleship names for my doubles... the teacher was not pleased... but seriously...

boolean bushDid911 = true; <--- How do you resist the urge to write that?

renlin
Автор

THIS SERIES IS ONE OF THE HIGHLIGHTS OF MY WEEK

Danielevans
Автор

This series is exactly how programming should be introduced to kids (or anyone for that matter) 👍

lozD
Автор

This is great! I've been trying to learn how code games in C++ for the past 2 years at college, and I just do not get it. This video has explained some basic stuff to me in a way that actually makes some sense!

wanderingrandomer
Автор

i would like to say something about 3:36 an if statement does not use English to work. i think she meant the if statement as this if (energy < 20) { tea = true ) or if you wanted something else to happen when tea = false you could use an else statement which does not have a true or false condition instead it goes like this


if (energy < 20) {tea = true}
else {water = true}

Candlewaxeater
Автор

Someone please tell Carrie Anne I love her!! I have been trying to figure out functions and if/else statement for a week!!! The dots FINALLY connected!!! Crash Course it the bizness!! <3

dawntraci
Автор

this is excellent- I've been dabbling in program just shy of a year, and this perfectly encapsulates functions in a succinct and brilliant manner- thank you :)

GarrettBSettles
Автор

"In modern programming it's uncommon to see functions longer than around 100 lines of code"
*Deep breath*
God, I wish. I love you guys.

verdatum
Автор

5:03 I've found in computer science there are many times when reading from right to left makes more sense. I'm a mediocre "programmer" (I dare to use that word) at my absolute best but the reading right to left trick I eventually discovered late in life helps me quite a bit.

dg-hughes