Smelly code and Magic Numbers
Patreon ➤ https://www.patreon.com/jacobsorber
Courses ➤ https://jacobsorber.thinkific.com
Website ➤ https://www.jacobsorber.com
---
Code Smells — issues with the style of your code that makes your code harder to read, understand, and maintain. They are super common, especially in student code. So, this is the first in a series of videos about code smells. Hope it helps you produce better code.
Today's smell: Magic numbers. In short, don't stick numerical constants throughout your code unless it's painfully obvious what they do and your code wouldn't be easier to maintain with a symbolic representation (variable, macro, etc).
***
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:
https://people.cs.clemson.edu/~jsorber/
http://persist.cs.clemson.edu/ Note that any Amazon links in my video descriptions are generated by Amazon. If you click one of them and then buy something it helps support this channel. Thanks.
***
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:
https://www.jacobsorber.com
https://people.cs.clemson.edu/~jsorber/
http://persist.cs.clemson.edu/
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [https://www.patreon.com/jacobsorber]
+ rep the channel with nerdy merch --- [https://teespring.com/stores/jacob-sorbers-store]
Source code is also available to Patreon supporters. --- [https://jsorber-youtube-source.herokuapp.com/]
Want me to review your code?
Email the code to js.reviews.code@gmail.com. Code should be simple and in one of the following languages: C, C++, python, java, ruby. You must be the author of the code and have rights to post it. Please include the following statement in your email: "I attest that this is my code, and I hereby give Jacob Sorber the right to use, review, post, comment on, and modify this code on his videos."
You can also find more info about code reviews here.
https://www.youtube.com/watch?v=k2K2HVg4Arc
Видео Smelly code and Magic Numbers канала Jacob Sorber
Courses ➤ https://jacobsorber.thinkific.com
Website ➤ https://www.jacobsorber.com
---
Code Smells — issues with the style of your code that makes your code harder to read, understand, and maintain. They are super common, especially in student code. So, this is the first in a series of videos about code smells. Hope it helps you produce better code.
Today's smell: Magic numbers. In short, don't stick numerical constants throughout your code unless it's painfully obvious what they do and your code wouldn't be easier to maintain with a symbolic representation (variable, macro, etc).
***
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:
https://people.cs.clemson.edu/~jsorber/
http://persist.cs.clemson.edu/ Note that any Amazon links in my video descriptions are generated by Amazon. If you click one of them and then buy something it helps support this channel. Thanks.
***
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:
https://www.jacobsorber.com
https://people.cs.clemson.edu/~jsorber/
http://persist.cs.clemson.edu/
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [https://www.patreon.com/jacobsorber]
+ rep the channel with nerdy merch --- [https://teespring.com/stores/jacob-sorbers-store]
Source code is also available to Patreon supporters. --- [https://jsorber-youtube-source.herokuapp.com/]
Want me to review your code?
Email the code to js.reviews.code@gmail.com. Code should be simple and in one of the following languages: C, C++, python, java, ruby. You must be the author of the code and have rights to post it. Please include the following statement in your email: "I attest that this is my code, and I hereby give Jacob Sorber the right to use, review, post, comment on, and modify this code on his videos."
You can also find more info about code reviews here.
https://www.youtube.com/watch?v=k2K2HVg4Arc
Видео Smelly code and Magic Numbers канала Jacob Sorber
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Does it matter what programming language you use?Debugging with Macros (-g3,-ggdb)Learn CS like a new language (Happy New Year from Cambodia)Lego MoriaHow to wire-up and program a button. (digital inputs, microcontrollers)Fixing our "better" hash table's memory leaks (in c)Sorting in C: Why the double pointers when sorting pointers? (qsort)How to Debug Shims and Set Environment Variables in GDBHow do I Set, Clear, and Toggle a Single Bit?Comments and Commenting in CCPU Scheduling BasicsHow to Automatically Run a Function When My Program Exits. (atexit)Making forked clones more useful with exec()!How to Intercept and Modify Library Calls with Shims.What about Pointer Arithmetic with Void Pointers?How to get an IP address from a host name? (Example in C)The Ternary Operator (examples in C and C++)They're Just Bits! Types and Structuring Memory in C.Does it matter how I write my infinite loops? (for vs. while?)How do I make multiple concurrent progress bars in the terminal? (tutorial in C)Make your own 50k YouTube Play Button (C / curses tutorial)