This is like saying writing a great novel in English is easy. After all it only uses 26 characters to capture every word in the language. Just 26 characters.
@@NotEight that’s not a contrary statement to mine. Most programming languages are simple and have an easy to follow syntax. Programming is more about the problem you are trying to solve, not so much the language you write it in. Like you could write a compiler in many languages that are simple to read, but it is a complex problem. Or, a middle schooler can read, but could they comprehend an essay about theoretical physics? They can read the words probably, but the ideas wouldn’t sink in. It’s great that you’re learning more and more, keep going and keep building
Now explain to the newbs that puts() is for strings but if they want to print a variable they have to use printf(). I've been asked about that a few times over the years.
@@seremptos It's not useless because it's faster and also automatically adds newlines. In situations where you're not using any variables, it makes little sense to use printf. Although, every modern compiler I can think of will automatically convert simple printf statements into puts.
I now know enough C to write my own operating system. Just need a 60 second assembly course so I can switch from real to extended mode and create the TLB
Been a lot of years ago, but I wrote a bit of 8086/8088 ASM. In my course on Digital Computer Electronics, we did a few projects, the final project being a stop watch on an 8086 trainer. Outside of the class, I coded most of an ASM program to read a clock chip on a Leading Edge computer, and set the time in MSDOS 3.2. Funny thing though, they made enough changes in 3.3 that it didn't work. So I gave my classmate a copy of the code my instructor and I wrote. I don't know if they ever got it working on 3.3.
I've been there, and my solution was to steal some assembly code from random osdev projects :') You need to do interrupt table and shit, but at least you will get access to the keyboard, so hooray !
Huh.. you can write your OS in C? I mean the usable,not just boot with command line interface There's one of the Projects Mr.Dennis Ritchie himself head on development like Plan9,Inferno OS,Limbo (programming language) which are available in opensource Dennis Rotchie lead it as original intended way of creating C:portability,sharing with peers Until Java stole it with "write once,run anywhere" marketing catchphrase with chip industry growing & no cooperative plan to make ports for common purpose (thus leads to ever spewing "backward compatibility" curse that haunt the whole computer science industry) Some easy examples are Python,Java with their new versions simply outdating their own past versions (and they force it by stopped "support",No community or people be care like that) So back to the original convo,how could you (would you ever before actually?) Write OS without using Assembly & how 😳 Please share more info,you could check my channel too 😊 As sharing is what makes computer science one if the good communities leading the world 😅❤🌏🎉 Wish all be well 😃🌟✨🙌 25.07.2023 06:00/01 pm ist 4rea,25 like,1Ma
this is for the average smart person who has basically 0 experience with the concept of programming, so some context of how programs work and some general programming theory would probably be necessary for comprehension
Assuming you really have been programming with C since it’s creation in the early ‘70s, you have decades of experience with the language so clearly you’re not the target audience for the video. For anyone who hasn’t seen C code (or any code) before, this is a concise and thorough explanation of the very basics that other UA-cam videos would spend 10 minutes describing yet here is done in under a minute. I would like to say though that if you actually have been programming for 50 years that is pretty cool 👌
@@kevinyonan9666 it's because github copilot automatically filled it in, and large language models are inherently unreliable, especially with minimal context 🤦 he literally didn't write it, and you're ironically exposing how out of touch you are with modern AI developer tooling.
Alas, by the standard, main() returns an int value, not void. Ignoring the return value by using the void type is easy, but wrong, like assuming your micro-C will free() dynamic memory from alloc().
FYI Having the wrong logo and having that autocomplete (copilot?) turned on in this example makes this a lot less beginner-friendly. (Because it's confusing and gaslighty)
The letter “C” holds a distinctive place in the English alphabet, often recognized for its versatility and varied pronunciation. Its phonetic range allows it to represent different sounds, including the hard “k” sound as in “cat” or the soft “s” sound as in “cent.” This duality contributes to its widespread use in constructing words across various contexts, making it an essential component of language. In linguistics, “C” also plays a crucial role in understanding phonology and phonetics. It is classified as a consonant, which means it typically requires some obstruction of airflow to produce its sound. However, its flexibility extends beyond this traditional classification, as evidenced by its ability to mimic both consonantal and vowel-like qualities depending on its placement within a word. Beyond its phonetic significance, “C” holds cultural and historical significance. It has been part of numerous ancient scripts, evolving over time to its current form in the Latin alphabet. Throughout history, the letter “C” has been associated with various symbols and concepts, often representing notions like creation, continuity, or change in different cultures and mythologies. Moreover, “C” serves as a cornerstone in modern communication, appearing prominently in various fields such as literature, science, and technology. From composing compelling narratives to formulating complex mathematical equations, its presence is ubiquitous. Whether it’s in crafting elegant prose, deciphering scientific formulas, or navigating digital interfaces, the letter “C” remains an indispensable element of human expression and understanding. And yes this was ai generated
What always got me in multiple languages (until later) was - why “void”, or why “public static void main()” (Java) etc ? I just didn’t understand that void (or int or whatever) was the return type. To many, I was overthinking it while at the hello world stage, but I really think that understanding each part helped me reduce any fear / anxiety I had about individual languages or systems. When a language just does “print” it seems so much more accessible to a newbie than “public static void main”. But I got there… I love your channel, keep up the great work!!
@@erikkonstas The exit code of a Java application is not directly related to the return type of the main method. Instead, the exit code is determined by the status of the application upon termination. By default, if the application exits normally, it returns an exit code of 0. If there are any uncaught exceptions leading to abnormal termination, a non-zero exit code is returned. If you want to explicitly set an exit code, you can use the `System.exit(int statusCode)` method. For example, `System.exit(0)` indicates successful completion, and any non-zero value can indicate various error conditions. So, you don't need to change the main method to `public static int main`. The standard `void` return type is appropriate, and you can manage exit codes through `System.exit(int)` as needed.
I realised just now though you’re probably talking about C. I haven’t worked much with C tbh. And my reply mentioned “multiple languages”. I’m more familiar with Java. Sorry
ISO C99 and later do not support implicit function declarations and main should have a return type of int and specifying it as void may give you warnings or even compiler or linker errors (depending on the compiler)
From absolutely 0 knowledge about programming, I learned to program by looking at 2 short episodes of 10 from of a youtube tutorial about C programming around 10 years ago.
At college, my computer science teacher gave computers the acronym TOM CAT (Total Obedient Moron Can't Actually Think). It's worth remembering, even for that fancy AI stuff people keep going on about, it really is not thinking!
Just 2 small… well, maybe not mistakes, letʼs call them blemishes: As specified, both CheckTheWater() as well as main() will⁽¹⁾-‘void’ being missing-be recognized as variable argument functions (i.e. functions that can be called with any number of arguments [of any type]). Also ‘void main()’ should, if one wants to be standards-compatible, probably be typed as ‘int main(void)’… so that the application at hand can properly return its exit status code. Other than those small nitpicks: For 60 seconds? Nice video! ⁽¹⁾ At least until C23 is in wide use.
I’m coming at this without having much in way of computer education except from what I’ve picked up over the years. I’d really like to improve to the point where I can do more making my own shit. Unlike most of the comments, my dumb ass found this useful. Thanks.
Considering that I took what was supposed to be a C++ college course years ago, and all we wrote was C, but we interacted with some C++ code that the instructor gave us for one project near the end of the course. I also was active in a news group where the people that wrote C++ were regularly active, so the course was a bit confusing, when reading about how C++ should be coded.
Dave, I have a question. Why does windows X,Y values start in the top left instead of the bottom left of the hypothetical window graph like in classical mathematical notation?
I dunno but it's probably the fact that most 2D rendering stuff does that An actual reason could be because a rectangle is position and size and it renders starting at the topleft and ending at the position+size (i dunno probably not)
I may be wrong but it could be a sort of convention that was applied to crt monitors. As you may know this older system consists in a beam of electrons that travels from the first row to the last. The first point is in the top left and the last point is in the bottom right.
@@gabriel55ita And this is the correct reason. CRT was the main output for a long time. And it traditionally emits the image in the same order we read text in the western world. And most (not all) programming languages with graphics have the graphics arranged based on the memory order the data is output. But it's also the same when selecting row/column to output text.
Not sure if it has changed but last I checked, C has 32 reserved keywords. auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
... and now: passing pointers, values, and (de)references via function return types and type casting - but not before choosing malloc() vs alloc() ... 😶
@@erikkonstas it's another dynamic mem allocation function; not part of ansi c standard library. Some definitions do float around. I recall, some many years ago, confusing an include for alloc.h with other library's alloc() funtion and ended up including a 3rd party lib to get an alloc() - which seemed like it met the vauguly-explained assignment .... my original comment was intended to joke that 60 seconds covers neither the nuances of complexity, nor the scope of meaningfully leveraging the C language ... does that help you?
He says C but displays the C++ icon
And yet he's only used C in the examples
@@paulveitchand the autocomplete shown in the video is giving c++ code
He created Task Manager. He can display Python or JavaScript for all I care. He's earned it
Already a reason to skip
Easter Egg bro
Thanks. I can now finish my nuclear reactor’s cooling system.
😁😁
Writing something so sensitive in c sounds like an accident waiting to happen.
I would argue copilot would have been able to help too.
@@lret2070 you can't write that much complex systems with higher language btw.
I prefer Assembly
@@smallSphere69 Braindead comment, Linux kernal is written in c as a re microsoft and apple operating systems. Is that not complex?
Text: C in 60 seconds
Logo: *shows c++*
Thought I was about to get a music theory lesson. I hid my guitar…
Next step will be C# then
music theory is pog
This is like saying writing a great novel in English is easy. After all it only uses 26 characters to capture every word in the language. Just 26 characters.
Well, if english was a simpler language, it would be relatively easy, but it's 4/5 languages in a trenchcoat, and many don't stem off each other...
Languages are simple, programming is not
@@omara5079Ive been practicing C and its actually pretty simple, sure its not as simple as lua or python but its still mostly readable...
@@NotEight that’s not a contrary statement to mine. Most programming languages are simple and have an easy to follow syntax.
Programming is more about the problem you are trying to solve, not so much the language you write it in. Like you could write a compiler in many languages that are simple to read, but it is a complex problem.
Or, a middle schooler can read, but could they comprehend an essay about theoretical physics? They can read the words probably, but the ideas wouldn’t sink in.
It’s great that you’re learning more and more, keep going and keep building
@@omara5079 thanks for clearing that up, i understood your comment wrong, and also thanks for not getting mad like most people would
"Watch it again until it makes sense..." 😄
Congrats 🎉🎉🎉 everyone.
We learned c in just 60 sec.. 😂😂😂😂😂
Now explain to the newbs that puts() is for strings but if they want to print a variable they have to use printf(). I've been asked about that a few times over the years.
the f means format. they do different things.
So you mean that puts is useless, because printf can do exactly the same thing, but even more
@@seremptos It's not useless because it's faster and also automatically adds newlines.
In situations where you're not using any variables, it makes little sense to use printf.
Although, every modern compiler I can think of will automatically convert simple printf statements into puts.
@@mgord9518 oh yeah makes sense but like in school we only learn about the printf
@@mgord9518 It's not useless, as it is predictable. Eg if you feed it something that looks like a format string it will behave as expected.
It's also a `What is a programming language` instead of `Learn C`.
I now know enough C to write my own operating system. Just need a 60 second assembly course so I can switch from real to extended mode and create the TLB
Lol
Been a lot of years ago, but I wrote a bit of 8086/8088 ASM. In my course on Digital Computer Electronics, we did a few projects, the final project being a stop watch on an 8086 trainer. Outside of the class, I coded most of an ASM program to read a clock chip on a Leading Edge computer, and set the time in MSDOS 3.2. Funny thing though, they made enough changes in 3.3 that it didn't work. So I gave my classmate a copy of the code my instructor and I wrote. I don't know if they ever got it working on 3.3.
I've been there, and my solution was to steal some assembly code from random osdev projects :')
You need to do interrupt table and shit, but at least you will get access to the keyboard, so hooray !
Huh.. you can write your OS in C?
I mean the usable,not just boot with command line interface
There's one of the Projects Mr.Dennis Ritchie himself head on development like Plan9,Inferno OS,Limbo (programming language) which are available in opensource
Dennis Rotchie lead it as original intended way of creating C:portability,sharing with peers
Until Java stole it with "write once,run anywhere" marketing catchphrase with chip industry growing & no cooperative plan to make ports for common purpose (thus leads to ever spewing "backward compatibility" curse that haunt the whole computer science industry)
Some easy examples are Python,Java with their new versions simply outdating their own past versions (and they force it by stopped "support",No community or people be care like that)
So back to the original convo,how could you (would you ever before actually?) Write OS without using Assembly & how 😳
Please share more info,you could check my channel too 😊
As sharing is what makes computer science one if the good communities leading the world 😅❤🌏🎉
Wish all be well 😃🌟✨🙌
25.07.2023 06:00/01 pm ist
4rea,25 like,1Ma
Okay Terry Davis the second
As a fifty-year C programmer... just one question: Why did you take so long, it's Not that complicated? Love your stuff.
this is for the average smart person who has basically 0 experience with the concept of programming, so some context of how programs work and some general programming theory would probably be necessary for comprehension
Assuming you really have been programming with C since it’s creation in the early ‘70s, you have decades of experience with the language so clearly you’re not the target audience for the video.
For anyone who hasn’t seen C code (or any code) before, this is a concise and thorough explanation of the very basics that other UA-cam videos would spend 10 minutes describing yet here is done in under a minute.
I would like to say though that if you actually have been programming for 50 years that is pretty cool 👌
I think both of the other replies are missing the sarcasm in this comment.
@@bfi01youtube11 will see niuuthe
But Dave... you said nothing about pointers or dynamically allocated memory.
Why is the opening logo C++ if you're explaining C?
This is such a pointless video, but hopefully it was fun to make.
Because Dave is a boomer who prob thinks C and C++ are still the same language despite them separating since the 90s
@@kevinyonan9666 it's because github copilot automatically filled it in, and large language models are inherently unreliable, especially with minimal context
🤦
he literally didn't write it, and you're ironically exposing how out of touch you are with modern AI developer tooling.
@@john.dough. I'm strongly aware of the AI aspect and we're not talking about that. Go be a troll somewhere else
@@kevinyonan9666 c++ is just c with more stuff (kinda)
"If the function doesn't exist, you need to define it"
"Don't forget to clean your allocated values at the end"
Alas, by the standard, main() returns an int value, not void. Ignoring the return value by using the void type is easy, but wrong, like assuming your micro-C will free() dynamic memory from alloc().
“Average smart person” love that description
FYI Having the wrong logo and having that autocomplete (copilot?) turned on in this example makes this a lot less beginner-friendly. (Because it's confusing and gaslighty)
Why doesnt the hello world funtion not return 0?
Or better yet, why is main a void finction instead of an int function?
Also, (void ()()) is not a valid type for main, the valid ones are (int ()(void)) and (int ()(int, char**)).
Bro what is the name of the compiler used in the video
@@megharajm.h5642 Hm, IDK, but I've since unsubbed from this channel, too many erroneous videos in there.
Did he just made a function main with void ? XD (it works but dangs its not usual)
The letter “C” holds a distinctive place in the English alphabet, often recognized for its versatility and varied pronunciation. Its phonetic range allows it to represent different sounds, including the hard “k” sound as in “cat” or the soft “s” sound as in “cent.” This duality contributes to its widespread use in constructing words across various contexts, making it an essential component of language.
In linguistics, “C” also plays a crucial role in understanding phonology and phonetics. It is classified as a consonant, which means it typically requires some obstruction of airflow to produce its sound. However, its flexibility extends beyond this traditional classification, as evidenced by its ability to mimic both consonantal and vowel-like qualities depending on its placement within a word.
Beyond its phonetic significance, “C” holds cultural and historical significance. It has been part of numerous ancient scripts, evolving over time to its current form in the Latin alphabet. Throughout history, the letter “C” has been associated with various symbols and concepts, often representing notions like creation, continuity, or change in different cultures and mythologies.
Moreover, “C” serves as a cornerstone in modern communication, appearing prominently in various fields such as literature, science, and technology. From composing compelling narratives to formulating complex mathematical equations, its presence is ubiquitous. Whether it’s in crafting elegant prose, deciphering scientific formulas, or navigating digital interfaces, the letter “C” remains an indispensable element of human expression and understanding.
And yes this was ai generated
Thanks for making shorts for good and not for evil
It doesn't think, it doesn't know anything, it doesn't get happy, it doesn't get sad... It just runs programs!
To the average smart person. Now that's qualification!
"Can I explain C..." Nah man you don't even have the right syntax when even writing the basic "Hello World" XD!
I feel ready to write an optimal prime sieve
Why would you have a void main?
What's the auto-complete being used?
What always got me in multiple languages (until later) was - why “void”, or why “public static void main()” (Java) etc ? I just didn’t understand that void (or int or whatever) was the return type. To many, I was overthinking it while at the hello world stage, but I really think that understanding each part helped me reduce any fear / anxiety I had about individual languages or systems. When a language just does “print” it seems so much more accessible to a newbie than “public static void main”. But I got there…
I love your channel, keep up the great work!!
What’s wild is I’m understanding what you said quicker than I understood the video
void is also the wrong return type for main, which is supposed to return the exit code, the correct type is int.
@@erikkonstas The exit code of a Java application is not directly related to the return type of the main method. Instead, the exit code is determined by the status of the application upon termination. By default, if the application exits normally, it returns an exit code of 0. If there are any uncaught exceptions leading to abnormal termination, a non-zero exit code is returned.
If you want to explicitly set an exit code, you can use the `System.exit(int statusCode)` method. For example, `System.exit(0)` indicates successful completion, and any non-zero value can indicate various error conditions.
So, you don't need to change the main method to `public static int main`. The standard `void` return type is appropriate, and you can manage exit codes through `System.exit(int)` as needed.
I realised just now though you’re probably talking about C. I haven’t worked much with C tbh. And my reply mentioned “multiple languages”. I’m more familiar with Java. Sorry
ISO C99 and later do not support implicit function declarations and main should have a return type of int and specifying it as void may give you warnings or even compiler or linker errors (depending on the compiler)
what keyboard do you use please tell me
From absolutely 0 knowledge about programming, I learned to program by looking at 2 short episodes of 10 from of a youtube tutorial about C programming around 10 years ago.
At college, my computer science teacher gave computers the acronym TOM CAT (Total Obedient Moron Can't Actually Think).
It's worth remembering, even for that fancy AI stuff people keep going on about, it really is not thinking!
Oh my oh my ... Words of gold.
Which compiler do you use??
Thanks for teaching me c.
Awesome!
The main function MUSTt return int.
SUPER THANK YOU
What do you mean by 30 words ?
Just 2 small… well, maybe not mistakes, letʼs call them blemishes:
As specified, both CheckTheWater() as well as main() will⁽¹⁾-‘void’ being missing-be recognized as variable argument functions (i.e. functions that can be called with any number of arguments [of any type]).
Also ‘void main()’ should, if one wants to be standards-compatible, probably be typed as ‘int main(void)’… so that the application at hand can properly return its exit status code.
Other than those small nitpicks: For 60 seconds? Nice video!
⁽¹⁾ At least until C23 is in wide use.
now tell me how tf i was supposed to figure out that exercise
I’m coming at this without having much in way of computer education except from what I’ve picked up over the years. I’d really like to improve to the point where I can do more making my own shit. Unlike most of the comments, my dumb ass found this useful.
Thanks.
Now I can put it in my Resume😂
Starring Vin Diesel and Nicolas Cage
Why does he use void main instead of into main
Cool, but i'd recomend printf function wich comes from stdio and including a newline at the end of the string via
And where do you think puts comes from...?
@@erikkonstas stdio
How to code in pure C on windows with a Lightweight editor
Visual Code with the C extension. It's free and a great editor.
Yep this covers everything. If you watch this start applying for as many software engineering jobs as you can.
Thank you, dad 🥺
Thanks for this
Great job 😊
Why void function???
I learned ty
I want to learn C - + for quantum computers.
Sorry I could only teach you C**
I know it's a joke but if you're curious about how quantum computers are programmed then check out Q# by Microsoft
Thanks to this video I was able to dev a next gen video game.
C and C++ are not the same thing. You know that for sure. Why would you mix them up?
He didn't, it was autotype prediction. It was not ideal.
@@IshayuG In recent video he mix it too, he explain pure C concepts and used C++ library, not meeting using C++ logo on both this video.
Considering that I took what was supposed to be a C++ college course years ago, and all we wrote was C, but we interacted with some C++ code that the instructor gave us for one project near the end of the course. I also was active in a news group where the people that wrote C++ were regularly active, so the course was a bit confusing, when reading about how C++ should be coded.
Watch again until it makes sense
c : the DSL for memory management errors
Curly braces after the line
Pain for most programmers
You can explain it to the average person, but you can't make them write code that is correct and won't mess up things. Nobody can...... Nobody.
Dave, I have a question. Why does windows X,Y values start in the top left instead of the bottom left of the hypothetical window graph like in classical mathematical notation?
I dunno but it's probably the fact that most 2D rendering stuff does that
An actual reason could be because a rectangle is position and size and it renders starting at the topleft and ending at the position+size (i dunno probably not)
I may be wrong but it could be a sort of convention that was applied to crt monitors. As you may know this older system consists in a beam of electrons that travels from the first row to the last. The first point is in the top left and the last point is in the bottom right.
@@gabriel55ita that makes perfect sense
@@gabriel55ita And this is the correct reason. CRT was the main output for a long time. And it traditionally emits the image in the same order we read text in the western world.
And most (not all) programming languages with graphics have the graphics arranged based on the memory order the data is output.
But it's also the same when selecting row/column to output text.
Does it every say, "No, YOU puts!!!"
Now people can add c programming in their resume 😅
Man explaining C with C++ syntax
Std::println
Average smart person? Well, I am the average dumb person but I will try to learn anyway
30 words... Sounds like an over-simplification to me.
it really does not take much more than that ;)
Not sure if it has changed but last I checked, C has 32 reserved keywords.
auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while
Uh main should return an int and at least i like to use it woth argc and argv
C++ can handle most tasks for you if the hardware can follow the program.
... and now: passing pointers, values, and (de)references via function return types and type casting - but not before choosing malloc() vs alloc() ... 😶
Where is "alloc" a thing? 😂
@@erikkonstas oh, you don't use C libraries at all?
@@lazertroll702 I'm not aware of any libc with an "alloc" function...
@@erikkonstas it's another dynamic mem allocation function; not part of ansi c standard library. Some definitions do float around.
I recall, some many years ago, confusing an include for alloc.h with other library's alloc() funtion and ended up including a 3rd party lib to get an alloc() - which seemed like it met the vauguly-explained assignment ....
my original comment was intended to joke that 60 seconds covers neither the nuances of complexity, nor the scope of meaningfully leveraging the C language ... does that help you?
PascalCase?? Why??
Bro... Put int main not void main
30 words that can be used in endless complicated web
C is simple, but it does not deserve a 60 sec short …
Is bro using visual studio ⁉️⁉️🤨👊
He explained 1st 2 chaps main points of engineering 1st yr in 60 sec 😂😂
I am the average stupid person
When you want to teach somebody a language?
Zig
c progamming means cipicial
Where to learn pure C
No Duff's device. Instant fail.
Thanks. Now i can go to alien spaceship and hack the system
A bit simplified but good video!
@Dave What do you determine as a smart person?
Someone that doesn't have an opinion regarding which crayons taste the best?
Not watching this movie.
@@quetzalcoatl-pl not a movie
My laptop takes almost 10 minutes to open till than someone can learn c 20 times 😢
See, even he uses copilot
Hmm only 30 words nice info for beginner
c......++?
Not enough time. Maybe you should stretch it to 100 seconds.
So this with pointers… *🙏
What is that void?
A mistake.
Name of the editor?
I'm pretty sure it's just vscode with copilot
“Learn C in 60 Seconds”
Uses C++ and shows absolutely nothing about how to use that language
Ha! Now do hello world like it was for windows 3.12
That’s C++. Very different from C
An awkward question: Did you purchase a Copilot subscription or retired Microsoft employees get it for free?
Cold hard cash, same as my Github subscription!
>no seg faults
Hah, that ain't C.
Can someone explain the well joke to me pls 😊
im not smart 💀
SYS 64738
Wow I can go get a job at Google now
Umm this seems more like BCPL.