Find bugs faster using assertions.

preview_player
Показать описание
---

***

Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.

About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.

More about me and what I do:

In case you want more information about asserts.

In C.

Java.

Python

Ruby



***

Welcome! I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. My goal is to help you get under-the-hood and better understand how computers work and how you can use them to become stronger students and more capable professional developers.

About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. I teach systems and networking courses at Clemson University, where I also lead the PERSIST research lab.

More about me and what I do:

To Support the Channel:
+ like, subscribe, spread the word

Want me to review your code?

You can also find more info about code reviews here.
Рекомендации по теме
Комментарии
Автор

I just program in dark mode. Light attracts bugs.

heefbrz
Автор

Working on a new project, whose code lends itself to assertions. Assertions everywhere! Everythings working, I'm solving problems, until bang, a really old assertion fails! Worked exactly liked it should! Looking forward to tomorrow to see why it failed! Good video!

zrodger
Автор

That was very informative. Thanks, quality content.

ryszardsinius
Автор

fantastic explanation, thanks so much!

conorc
Автор

Wow! I needed this. A few days ago I was thinking if I should use an assertion to check for something and catch that AssertionError (it was Python), or should I raise another error. But after a few minutes of thinking, I left the assertion and the handling for that assertion without thinking that when I freeze the program with optimization (-O or -OO), I won't have that assertion which was needed for some error checking. I just corrected that by raising instead a RunTimeError and catching that.
I just subscribed, because I saw many of your videos and I like them.

simonmaracine
Автор

What books do you recommend for defensive C++ programming?

founderofisis
Автор

Thanks for the informative stuff on C !

Can you have 2 version of your source code ? One with assertions and one without ? You would accomplish this by just deleting the assertion statement lines all together no ? or can you just use undefine on library functions as well

steinmil
Автор

Thank you so much for the video. I have a question which I couldn't find an answer for it. I didn't study computer science, but I love programming. Actually, in my field, not knowing programming leads you to trouble. I learned to programme by myself. My question is that how can I gain a complete knowledge of programming (concepts and principles)? I have this question because although I've been doing programming, but I recently realized about the assertions :( . Do you have any suggestion about how can I get the hang of programming (i.e. knowing all concepts and principles)?

mohammadeshghi
Автор

To be more technical, assert() never works if and only if the macro NDEBUG is defined.
Certain compiler options #undef this macro hence breaking any assertion statements.Thus assertions should never be used in release code.

anthonynjoroge
Автор

I'm a little confused... If assertions should not be used to ensure code runs correctly, then when should they be used? Are they only inserted to be used for testing?

rebecca.jennifer
Автор

In a world that didn't have YouTube... Imagine the sentence "If you liked the video, please consider liking it"

casperes
Автор

Yep, I have a segment fault in code and I don't know where it is.

andreadws
Автор

In my opinion, it's simpler to write your own assert macro (e.g. #define Assert(expr) if(!(expr)){ int *x = NULL; x[10]=10; }).

Ignas_
Автор

You disturbingly look like Clint from the Corridor Crew mixed with Matthew McConaughey

MAP
Автор

As someone who needs quiet to really focus and take in information, the background music when you were talking made it nearly impossible for me to take this in. Maybe this is good for some people, I don't know.

amyej
Автор

Better use a language that has built-in data types like vectors or lists.

OlliS
Автор

assert checks won't be in production.. So all you've done is covered up errors that can still exist in your prod deployment.. asserts suck.

eyesopen
Автор

afl-fuzz: ../Program.cpp:254: static Program* Program::deserialize(uint8_t*, uint32_t): Assertion `pos == len' failed.
Aborted How to fix such error message>

UniverseGames