Setup Tips for Your Next Programming Project

  Рет қаралды 28,749

Jacob Sorber

Jacob Sorber

3 жыл бұрын

Patreon ➤ / jacobsorber
Courses ➤ jacobsorber.thinkific.com
Website ➤ www.jacobsorber.com
---
Setup Tips for Your Next Programming Project // Student programmers often forget to setup their programming projects. Instead, they just dive right into the code and miss opportunities to save themselves valuable time and energy. This video gives two recommendations (about version control and build systems) for making your next project a more pleasant experience.
Make videos: • Learn make in 60 seconds.
***
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:
www.jacobsorber.com
people.cs.clemson.edu/~jsorber/
persist.cs.clemson.edu/
To Support the Channel:
+ like, subscribe, spread the word
+ contribute via Patreon --- [ / jacobsorber ]
Source code is also available to Patreon supporters. --- [jsorber-youtube-source.heroku...]

Пікірлер: 130
@dkbikerides6123
@dkbikerides6123 3 жыл бұрын
Dang dude, I work as a software engineer writing fpga NIC drivers in C and I gotta say your content is legit. I have not seen any other content like yours, keep it up!
@EidosGaming
@EidosGaming 3 жыл бұрын
I saw this video after taking a few days setting up CMake, git, all the dependencies before writing anything. Kinda reassuring :D
@JacobSorber
@JacobSorber 3 жыл бұрын
Glad I could reassure you. Your project setup will get quicker over time.
@EidosGaming
@EidosGaming 3 жыл бұрын
@artsi0m ; actually I find that cmake is not that bad, meson is a bit painful on windows and most IDEs
@mimmyjau
@mimmyjau 3 жыл бұрын
love these videos. advice is gold. 0:59 Don't jump straight into coding 4:04 Tip: Do the hardest things first 4:39 1) Create a git repo (or any version control) 5:24 2) Setup build system (e.g. makefile) 6:05 Example makefile 8:54 Why a build system is important 10:32 Automate anything repetitive My own requests / suggestions / ideas for videos: - How do you organize header files / source code when working on medium to larger projects? - What is your philosophy around commenting your code? - How do you think about having the "right" data structure for a project? - How do you write tests for projects? - How do you "jump into" a larger code base and start to slowly understand / contribute code? - What are common anti-patterns you see in C that students (or those new to C) often make? - What are some best practices for working in a team (e.g. how long do you struggle with a problem before asking for help, how do you ask for help, etc.)? - Things we can easily implement to make our C code more secure? Thanks!
@JacobSorber
@JacobSorber 3 жыл бұрын
Great suggestions. Thanks! I'll add them to the list and see what I can do.
@dontaskme1625
@dontaskme1625 3 жыл бұрын
@@JacobSorber please put the timestamps in the description for chapter makers :)
@goutgueule9197
@goutgueule9197 Жыл бұрын
4:04 What if you’re french ?
@cernejr
@cernejr 3 жыл бұрын
Related: Directory structure. Separate dirs for debug and release builds. I have worked on years-old production code lacking these - very painful and inefficient.
@glowiever
@glowiever 3 жыл бұрын
I just copy msvc dir structure
@JacobSorber
@JacobSorber 3 жыл бұрын
Agreed. I guess I need a follow on video that provides a few more steps. Thanks!
@cernejr
@cernejr 3 жыл бұрын
@@JacobSorber If you do, please mention cmake.
@mockingbird3809
@mockingbird3809 3 жыл бұрын
I would love to see a video on malloc and free implementation in future :)
@JacobSorber
@JacobSorber 3 жыл бұрын
Ok. I'll see what I can do. I'll have to be a little careful, since that's something I do as an assignment/project in my operating systems class. But, I'll see what I can do without giving them too much help. 🤔
@albertoheras7684
@albertoheras7684 3 жыл бұрын
YES!
@mikelong3444
@mikelong3444 3 жыл бұрын
This information is GOLD. Thanks for sharing your advice with the world and the ones of us whom care.
@EmbeddedHackster
@EmbeddedHackster 3 жыл бұрын
I wish there was more people like you doing this kind of videos, helped me a lot as an emb dev. I got a question, tho: as most (if not all) the IDEs I've used make and compile your files automatically, what are the advantages of doing it manually? I've personally never had any problems with the automatic approach for my projects (adding 10+ custom drivers/files and counting), but I'm still curious about this method. Again, thank you for your good work and keep it up!
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
If you don't use an IDE you'll need to know how, and if you change IDE's you may have to reconfigure things and knowing how it's done at a basic level can make it easier to finagle IDE settings.
@aabdev
@aabdev 3 жыл бұрын
Dear Jacob Sorber, I would add some extra steps: a) Write unit tests just inside the code. Use Test Driven Development (TDD). b) Install locally Jenkins build server and maintain "on the float" different builds simultaneously c) For MCU project implement Bash-like UART console to launch unit tests, diagnostic and manual device control d) Implement bootloader for MCU device Regards, AB
@eddydecolombia
@eddydecolombia 3 жыл бұрын
This video will change many lives. Thank You for the quality. 👏 . Remember to commit often!! REmember to Remember
@tiltedfate9188
@tiltedfate9188 3 жыл бұрын
Just want to say thank you for making these videos! They’re much appreciated :)
@JacobSorber
@JacobSorber 3 жыл бұрын
My pleasure!
@francomontenegro
@francomontenegro 3 жыл бұрын
Jacob your videos are awesome, thank you so much! Please do find some time to talk about building a custom allocator, that would be very interesting
@papasmurf9146
@papasmurf9146 2 жыл бұрын
As a developer for longer than I care to admit, I completely agree. I also carry around a Perl script (which predates cmake) that creates the Makefile for me from a directory full of source code. I also carry around a unit-test framework to formalize the unit-test which is probably the best way to ferret out bugs long term (with a Perl scrip that takes a .h file and generates a unit-test skeleton .h/.cpp files)
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
This is great advice. Something that everyone should learn starting out.
@benprishtina153
@benprishtina153 4 ай бұрын
right on, I endorse this, however I do those things in opposite order: 1. set up build environment 2. set up repository
@CodingNuggets
@CodingNuggets 3 жыл бұрын
Super tips. For anyone starting out, this is a great way to begin. I highly suggest you listen if you are a beginner. See you soon!
@dynpallomah5918
@dynpallomah5918 2 жыл бұрын
i always write shell script to build & test stuff cuz i dont wanna learn make lol. i use './b' for building and './c' for testing, and for building + testing it's './bc'. the thing is that u just use whatever ur most comfortable with
@tordjarv3802
@tordjarv3802 3 жыл бұрын
I have a tip: I reasently created a set of functions in my .zshrc that allows me to automatically create new projects, or jump in to an existing one. The function that creates a new project initializes git, copies an appropriate makefile (I have one per programming language that I want to use) creates a README file and forces me to write an initial commit message. This saves me a ton of time when I want to start a new project and allows me to standardize things.
@JacobSorber
@JacobSorber 3 жыл бұрын
Cool. Thanks. I do things like this for managing my courses. It's amazing how much time it can save.
@prakhargupta2960
@prakhargupta2960 3 жыл бұрын
I love these videos as a student
@AceAufWand
@AceAufWand 3 жыл бұрын
Another useful think when starting a new project, make test.
@JacobSorber
@JacobSorber 3 жыл бұрын
Absolutely. Thanks!
@nicopad2260
@nicopad2260 3 жыл бұрын
you just gave me motivation to finish my project off, thanks
@JacobSorber
@JacobSorber 3 жыл бұрын
Glad to hear it! Good luck.
@pasettodavide
@pasettodavide 3 жыл бұрын
Nice tips! That's why Cargo is so awesome
@pierreabbat6157
@pierreabbat6157 3 жыл бұрын
What happens when the crates the cargo is packed in get rusty?
@rick_er2481
@rick_er2481 3 жыл бұрын
Great video!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks. Glad you enjoyed it.
@shekharmaela2308
@shekharmaela2308 3 жыл бұрын
I like your longer vids keep em coming
@JacobSorber
@JacobSorber 3 жыл бұрын
Me too. They take longer to edit, which is a problem, but I like being able to dig a bit deeper.
@rafaelcoelho5226
@rafaelcoelho5226 3 жыл бұрын
Good tips
@jenselstner5527
@jenselstner5527 2 жыл бұрын
All your videos an especially this one, told me to start with make files. And as you said it, it makes your life much easier. ;o)
@EnkoVlog
@EnkoVlog 3 жыл бұрын
Thanks for great video! Are you goin to make a video how to use cmake, google test?
@greatbullet7372
@greatbullet7372 3 жыл бұрын
I NEVER ATTEMPTED TO LEARN MAKE ^^ Visual Studio just does everything for me xD my make is pressing F5. Mental Energy is limited thats for sure Mark Twain is right
@alefratat4018
@alefratat4018 Жыл бұрын
Until the day you need to develop on a Linux platform ;)
@TheKelor
@TheKelor 2 жыл бұрын
To summarise... "eat frogs" 🐸 Joke aside, that was really good advices.
@TheCocoaDaddy
@TheCocoaDaddy 3 жыл бұрын
Awesome video. I wish I had seen this when I was in school. lol I remember completing an assignment, printing out the hard copy source listing to turn in, and after I had the hard copy, I DELETED the source files. Fortunately, I didn't need to make any changes because if I did, I would have needed to re-type EVERYTHING from the printed copy. lol *sigh* Thanks for posting this very valuable advice!!!!!
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks!
@wChris_
@wChris_ 3 жыл бұрын
you should add 'clean' and 'submit' to .PHONY so they get automatically created even if there is a file called 'clean' or 'submit'
@Vaaaaadim
@Vaaaaadim 3 жыл бұрын
I had no idea that's what .PHONY was for, thanks for the tip
@blazkowicz666
@blazkowicz666 3 жыл бұрын
I'm currently a Python dev coming into a complex C/C++ project. I have taken many C++ classes back in college, however, none of them prepared me to handle this project like your videos did. It's still hard going, but this made the experience a little less painful
@JacobSorber
@JacobSorber 3 жыл бұрын
Thanks for letting me know. I'm glad they've been helpful.
@kosodrzewinka
@kosodrzewinka Жыл бұрын
Would be cool to see more on integration between Makefiles and VSCode :)
@PSNGuyWithHair102
@PSNGuyWithHair102 3 жыл бұрын
I would LOVE. a video on how to make your own malloc and free PLEASE PLEASE PLEASE
@glowiever
@glowiever 3 жыл бұрын
the game programming gems book has one chapter about it, forgot which series. it's a must in console game programming.
@JacobSorber
@JacobSorber 3 жыл бұрын
Ok. Thanks. I'll see what I can do.
@srijanpaul
@srijanpaul 3 жыл бұрын
+1, would love it. Thought it would probably be a 2-3 part video.
@johnkeubler2927
@johnkeubler2927 3 жыл бұрын
i am writing my own operating system and i would need to know how to do this too.
@BluesManPeich
@BluesManPeich 2 жыл бұрын
8:40 That's exactly what I keep telling myself.
@wilfreddv
@wilfreddv 3 жыл бұрын
Pro tip: eat the frog first and make a utility that creates your makefile, folder structure and version control for you.
@JacobSorber
@JacobSorber 3 жыл бұрын
Definitely. Great tip. Or just make a template empty project and copy it over. You can usually make one that will work with minor tweaks for most small-to-medium sized projects.
@maskettaman1488
@maskettaman1488 3 жыл бұрын
Or use a proper IDE like everyone else
@frozentomatoman3422
@frozentomatoman3422 3 жыл бұрын
@@maskettaman1488 fuck IDEs. I would like to build stuff and control on my own
@snacksy7754
@snacksy7754 3 жыл бұрын
@@maskettaman1488 They didn't like what he had to say, because he spoke the truth.
@sailendragautam3736
@sailendragautam3736 Жыл бұрын
Really great video to level up but sir it wluld have been better if you could explain it in short the setup of the makefile as it isn't able to recognise the path and the keyword
@EnkoVlog
@EnkoVlog 3 жыл бұрын
There are plugging (C/C++) for VSC that allows to build and debug.
@faranahmadk7401
@faranahmadk7401 3 жыл бұрын
heavy guy.
@rtzstvn
@rtzstvn 3 жыл бұрын
my junior design project desperately needed a git repo but i just didn’t have the experience that i have now. it would have saved me a ton of time with getting features done. i knew about git repos and i tried to set one up. but after i was like what now lol
@zorochii
@zorochii 2 жыл бұрын
Do you have videos about different build systems/configurations/generators and their strengths? Things like meson, cmake, ninja, etc.
@jacobkoziej
@jacobkoziej 3 жыл бұрын
Hi Dr. Sorber I was wondering if you could consider making a future video about more advanced Makefiles? In a recent project I was attempting to create separate src and obj directories but I couldn't figure out how to write the proper make rules. I desperately tried looking through make's documentation, KZfaq, and other sites to no avail so I ended up with a less than ideal solution where I run a mv command to move my objects to my obj directory.
@nunyobiznez875
@nunyobiznez875 3 жыл бұрын
I think it would be great if he did an advanced make video. In the mean time however, I'm not sure which documentation you've already checked, but if you aren't already aware, "info make" will provide much more detailed documentation for make than the man page does, and it should provide detailed examples for what it sounds like you are trying to achieve. You might check there if you haven't already. The GNU website also has a lot of documentation as well, though there you have to hunt for it. Also, both No Starch Press and O'Reilly have entire books dedicated just for make, which are both great resources for learning make as well. I seem to recall one of them was free from the publisher, and I believe it's the one from O'Reilly, but don't quote me on that. But if I am correctly understanding what you are trying to achieve, it sounds like you probably just need to include the folder in the name ./src/source.c and ./obj/foo, or use ../obj/foo if you are trying to use the makefile from src. You can also use multiple makefiles, one in each directory, called from a main makefile and there are detailed examples for that in the make info page, for that as well, if that's what you're trying to do.
@jacobkoziej
@jacobkoziej 3 жыл бұрын
@@nunyobiznez875 wow I did not expect a response like this but thank you so much! But to answer your question I read through the man page and skimmed through the online manual, unfortunately I couldn't understand, but maybe I will now? Nonetheless, thank you so much for pointing me towards some resources! I really appreciate it :)
@nunyobiznez875
@nunyobiznez875 3 жыл бұрын
@@jacobkoziej Glad to help, and yes, I think you'll find the info page much more helpful than the man page. Also, it is the O'Reilly book that's free. It's called Managing Projects with GNU Make. It's under the GNU free documentation license and is available to read on the oreilly website, though you may need to google it, as it's hard to find there. They want to sell you the paper copy lol.
@cozycactus
@cozycactus 2 жыл бұрын
Cmake + Ninja = ❤️
@nekoill
@nekoill 3 жыл бұрын
Wait, the mistakes you mention are actually common? Damn, I guess I chose really decent workshops and courses then, because I was taught to do things (almost?) exactly the way you teach. Even when I was still using Windows, I cd'd into my projects folder, created a folder for a new project, set up a repository and run my code editor from that folder, and then when I got tired of coding I'd add changes, commit and push them to the respective repo. I honestly thought that was how everyone does this.
@lucasgasparino6141
@lucasgasparino6141 2 жыл бұрын
Little personal experience: I started a project a year ago that was supposed to be a pet project... The original cmake system I designed was very shoddy. Ling story short, had to spend the last 2 weeks revising the thing to make it compatible with multiple external libraries and languages (Fortran and c++). Now the whole thing is a template in a git repo that 8 just reuse every time I start a new project :) incidentally, mind doing a series on CMake? The documentation is confusing AF, but I think it's a great solution for gigantic and complex projects.
@pierreabbat6157
@pierreabbat6157 3 жыл бұрын
For C++ projects, I use CMake with an out-of-source build (source is in ~/src/foo/, binary is in ~/build/foo/bar where bar is the build type). How do you set up a Haskell project?
@anon_y_mousse
@anon_y_mousse 2 жыл бұрын
There's nothing to prevent you from doing that with `make`. Both the out-of-source build and using Haskell. Give it a try by adding to the Makefile, have it `mkdir build` and add build/ before the output "file name".
@airjuri
@airjuri 2 жыл бұрын
Heh, nowadays i use git for everything straight from the start. Even on my C64 assembler projects :D
@wumi2419
@wumi2419 3 жыл бұрын
Make part reminded me: Which compiler flags are important during compiling .o file and which are used only by linker (obviously all the -l are linker-specific, but i had questions about -g, -W... etc). I was able to find an answer, but not as fast as i'd like and i might have missed something (it all led to compiler manual, in which flags are separated by sections and stage on which certain flags are used is unclear). Also, is it harmful to have more flags than you need (when you have less flags, code won't compile, but do redundant flags change something).
@eruptic6503
@eruptic6503 3 жыл бұрын
Rumour has it that Jacob's daughter's first words said were Hello World.
@Jumaax
@Jumaax 3 жыл бұрын
I’m coding a queue system simulation and I kinda struggle to understand it because there are too many information about it and it’s really vague to me would you please give some tips, make a video or direct me in a certain website. I would really appreciate that. Thanks in advance
@whosgonnacarrythelogsndboats
@whosgonnacarrythelogsndboats 3 жыл бұрын
Can you please make a video on clang Vs gcc? This has been bugging me for a while!!!👐👐
@JacobSorber
@JacobSorber 3 жыл бұрын
I talked a little bit about it in my recent "Answering your Questions" video. Didn't go super deep, though. Let me know if you want a deeper more nuanced comparison.
@ycombinator765
@ycombinator765 Жыл бұрын
my 2023 resolution!
@xmoex6393
@xmoex6393 2 жыл бұрын
I agree with your advice but I wouldn't bother to write the makefiles myself and use CMake instead. I can understand how it makes sense do know how it is done for educational purposes but I really like to rely on CMake doing the job better than me for production environments.
@xmoex6393
@xmoex6393 2 жыл бұрын
and: out of source builds!
@activelivingchallenger4298
@activelivingchallenger4298 3 жыл бұрын
Pen and paper so i know where I'm going and what states I need.
@paullemmermann5993
@paullemmermann5993 3 жыл бұрын
struct idea *from_dr_sorber = rethink(how_you_start_projects);
@MineKaikks
@MineKaikks 3 жыл бұрын
Hey Matthew, can you make a vídeo about starting with basics arduino? I have a project in my list that is build a bluetooth rgb light that i can control with my phone, but i really dont know how to even start, any advice? :)
@JacobSorber
@JacobSorber 3 жыл бұрын
Not sure who Matthew is, but you could check out my embedded systems videos and see if they help. And, of course, let me know what specific topics you think I'm missing.
@stomah9832
@stomah9832 2 жыл бұрын
someone should create a project manager that does all these things automatically
@frozentomatoman3422
@frozentomatoman3422 3 жыл бұрын
Proud to be the 128th like. 2 to the power of 6.
@JacobSorber
@JacobSorber 3 жыл бұрын
Excellent! Thanks!
@amos660
@amos660 2 жыл бұрын
is the $(RM) variable created automatically in clang?
@chrono393
@chrono393 3 жыл бұрын
Hey where can I buy that shirt?
@JacobSorber
@JacobSorber 3 жыл бұрын
teespring.com/stores/jacob-sorbers-store
@messengerofiexist2139
@messengerofiexist2139 3 жыл бұрын
Do you take bad stackexchange code examples and show how to debug the errors and warnings? As a beginner I expect code examples to function and not provide errors or warnings, something I can extend the functionality of. Building on a foundation that someone else has laid is difficult when you can’t identify when the foundation is in need of repairs first. Can you walk through some internet code examples and show how you would diagnose them? I was looking at Programming ascii art in C, I don’t understand the errors and warnings clang is raising.
@JacobSorber
@JacobSorber 3 жыл бұрын
Maybe. Do you mind pointing me at the particular resource you had difficulty with?
@messengerofiexist2139
@messengerofiexist2139 3 жыл бұрын
@@JacobSorber stackoverflow.com/a/8587004 I am looking for a code I can play in. Something that has a basic structure I can alter attributes of while the foundation remains. The code this person contributed is full of errors and incomplete, so is nonfunctional.
@JaycenGiga
@JaycenGiga 3 жыл бұрын
I use Rust for my everyday coding, which comes with a build system and version control from the get-go. Why am I even watching this?
@diarmaidmac2149
@diarmaidmac2149 3 жыл бұрын
Yes, Rust and Cargo are amazing. I thought I loved C++ until I discovered Rust. Now, I would only touch C++ as a last resort.
@johnkeubler2927
@johnkeubler2927 3 жыл бұрын
Yes but some people still like to use C and C++ for fun and it is best for writing operating systems.
@JaycenGiga
@JaycenGiga 3 жыл бұрын
@@johnkeubler2927 Sure, if they like to use them, they are free to do it. But I think that Rust is a good contender for operating systems. Actually, there already *is* an OS, completely written in Rust. Thing is, that (according to Microsoft) about 70 % of all bugs arise due to memory issues of one form or another. And that is something that simply cannot happen in safe Rust. I don't want to start a religious war, C and C++ are definitely still useful, but Rust is catching up very quickly.
@johnkeubler2927
@johnkeubler2927 3 жыл бұрын
Yes I have seen the articles on os development with rust and it looks pretty cool. The os probably would be better if written in rust. How about Googles Go programming language?? It seems pretty cool too.
@JaycenGiga
@JaycenGiga 3 жыл бұрын
@@johnkeubler2927 I haven't really used Go, but to my understanding, it has quite a large runtime and is garbage collected. So it is probably not so good for an OS, even though it's neat for other systems programming cases due to the strong parallelization.
@jonconigliaro1
@jonconigliaro1 3 жыл бұрын
Why do people run code through a terminal? Like in visual studios all i need to do is hit run, but Ive seen many people on youtube using a terminal?
@johngibson4874
@johngibson4874 3 жыл бұрын
Some programmers dont rely as much on IDEs like visual studio. Preferring instead to use the terminal and a text editor. In this video, he actually is using an IDE (VSCode I think) with an embedded terminal. It is just a matter of what is comfortable and fast for you.
@JacobSorber
@JacobSorber 3 жыл бұрын
I've talked a bit about this in some of my older videos. In short, I think it's a good thing for beginning programmers to understand what they're actually doing when compiling and linking and debugging - IDEs often hide a lot of that from you, and when you're just getting started that can lead to significant problems in your understanding. Once you know what you're doing, I think it becomes more a matter of preference.
@johnkeubler5586
@johnkeubler5586 3 жыл бұрын
Why did this code fail?? I tried this same code on my phone with Online Compiler using only 1 C file, no linking, etc. and I got the same error. It happens at *p = 45;
@petertolgyesi6125
@petertolgyesi6125 3 жыл бұрын
Because the malloc function was not implemented so it tries to write 45 to an unallocated page, most likely the NULL address.
@johnkeubler5586
@johnkeubler5586 3 жыл бұрын
Once I thought about it I came to the same conclusion. He still should of mentioned why it failed.
@messiweltmeista
@messiweltmeista 3 жыл бұрын
He is assigning the value 45 to an unallocated memory address (NULL in this case)
@md.al-aminpatwoary3984
@md.al-aminpatwoary3984 Жыл бұрын
Hey Jacob Sorber, Would you please create a discord server?
@tanmaydeshpande
@tanmaydeshpande 3 жыл бұрын
Me who codes in python and just makes cli apps: 😔
@tanmaydeshpande
@tanmaydeshpande 3 жыл бұрын
@artsi0m ; just fine! I made a terminal function to create a new venv with my preferred choice of python version
@baruchben-david4196
@baruchben-david4196 2 жыл бұрын
Eat a live frog in the morning, and nothing worse will happen to you for the rest of the day... or to the frog...
@johnkeubler5586
@johnkeubler5586 3 жыл бұрын
Actually I thought about it and came to the same conclusion. To make it work for testing purposes without any real code, i got this to work. // global variable. int a = 2; // function. void *malloc2 (size_t size) { return &a; // return NULL; } // main. int main() { // sizeof(*p) int *p = malloc2(sizeof *p); // int *p = NULL; // p = malloc2(sizeof *p); printf("%p ", p); printf("%d ", *p); *p = 45; printf("%p ", p); printf("%d ", *p); return 0; } // prints out. 0x601030 2 0x601030 45 you can't use malloc() , free() because they are already built-in functions and you get warnings and wierd behavior.
@HimanshuSharma-sd5gk
@HimanshuSharma-sd5gk 3 жыл бұрын
Plz plz answer this question sir.. For passing multidimentional array to function how valid is to use void function(int x, int y, int array[x][y]); This worked fine on my system. I am himanshu sharma from india
@thedoublehelix5661
@thedoublehelix5661 3 жыл бұрын
lol I thought this was obvious
@JacobSorber
@JacobSorber 3 жыл бұрын
Many things are obvious once you understand them.
@MichaelGarcia-tb6pm
@MichaelGarcia-tb6pm 3 жыл бұрын
first haha
@zxuiji
@zxuiji 2 жыл бұрын
paused at 10:32 because that "%.o" is bugging me, that's a REALLY bad thing to do, can't tell you how many times I've done that and regretted it later after spending hours trying to find out why make is trying to compile my makefiles into objects too only to then finally remember "oh right, make adds makefiles into goals against all that is sane" at which point I have to go change my "%.o: %" to "%.c.o: %.c" && "%.cpp.o: %.cpp" all because make recognises "%.o" as special goal instead of just matching it the dependencies given to it, it does not give a flying toss if that will f**k with your output and give you a false negative
@AnuAnu-gy9df
@AnuAnu-gy9df 3 жыл бұрын
love these videos. advice is gold. 0:59 Don't jump straight into coding 4:04 Tip: Do the hardest things first 4:39 1) Create a git repo (or any version control) 5:24 2) Setup build system (e.g. makefile) 6:05 Example makefile 8:54 Why a build system is important 10:32 Automate anything repetitive My own requests / suggestions / ideas for videos: - How do you organize header files / source code when working on medium to larger projects? - What is your philosophy around commenting your code? - How do you think about having the "right" data structure for a project? - How do you write tests for projects? - How do you "jump into" a larger code base and start to slowly understand / contribute code? - What are common anti-patterns you see in C that students (or those new to C) often make? - What are some best practices for working in a team (e.g. how long do you struggle with a problem before asking for help, how do you ask for help, etc.)? - Things we can easily implement to make our C code more secure?
How to Return Two Things from a C or C++ Function
10:44
Jacob Sorber
Рет қаралды 37 М.
لقد سرقت حلوى القطن بشكل خفي لأصنع مصاصة🤫😎
00:33
Cool Tool SHORTS Arabic
Рет қаралды 22 МЛН
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 35 МЛН
How I Plan My Coding Projects
7:39
Jacob Sucks At Code
Рет қаралды 22 М.
Can I Handle Exceptions with Try Catch in C? (setjmp, longjmp)
11:13
Fixed and Variable Length Arrays in C and C++
20:24
Jacob Sorber
Рет қаралды 43 М.
Make your Data Type more Abstract with Opaque Types in C
13:41
Jacob Sorber
Рет қаралды 49 М.
2 Years Of Learning C | Prime Reacts
22:24
ThePrimeTime
Рет қаралды 263 М.
How to Check Your Pointers at Runtime
14:12
Jacob Sorber
Рет қаралды 31 М.
Writing My Own Database From Scratch
42:00
Tony Saro
Рет қаралды 195 М.
20 Advanced Coding Tips For Big Unity Projects
22:23
Tesseract
Рет қаралды 171 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
The Inline Keyword in C.
16:18
Jacob Sorber
Рет қаралды 57 М.