C is The MOST Beautiful Language!

  Рет қаралды 7,656

Emez Labs

Emez Labs

Күн бұрын

Пікірлер: 65
@tuxorizon
@tuxorizon 3 ай бұрын
I'm an absolute beginner in C programming, watching your video gave me the impetus I need to learn C language upto becoming a master. Thank you and have a felicitous intellectual journey ahead!
@matgla95
@matgla95 3 ай бұрын
Thanks! let's do it! Keeping fingers crossed!
@natam1616
@natam1616 3 ай бұрын
But it is defined as 'undefined behaviour' the part of the code >>k++*k/2
@matgla95
@matgla95 3 ай бұрын
Sure! Good point and that one is even reported by GCC, when using the -Wall flag :) but the goal of that exercise is to abuse whatever you can in the provided compiler to achieve the smallest possible source code
@a.v7998
@a.v7998 3 ай бұрын
My First Programming language was python, then I moved to C. When I was Learning python i struggled with logic building. But After learning C im getting better with Logic, and Also Better at JavaScript.
@matgla95
@matgla95 3 ай бұрын
Yup, different languages due to different paradigms enforce to improve the skill set and it seems you have a win-win outcome :)
@cyrusol
@cyrusol 3 ай бұрын
Erlang, any ML, any Lisp and Haskell are beautiful. If someone finds C beautiful they also find spoiled foods yummy.
@matgla95
@matgla95 3 ай бұрын
I think beauty is subjective and depends on context. Here I used it a little bit ironically, since you can still do things that should not be allowed, at least by default. Hopefully compilers are evolving and, i.e. GCC 14 rejects such code by default which is good in my opinion!
@stefanalecu9532
@stefanalecu9532 Ай бұрын
You know, the more I watch this video, the more I'm grateful I'm a Pascal/Delphi and Ada dev, this is wild, I feel pity for C devs 💀
@matgla95
@matgla95 Ай бұрын
To be honest, me too. C can't be substituted in some environments. But whenever it could be I think it should be. I mostly use C++, but I am looking for tools that can improve or even replace it into safer language transpilers ( like cppfront ), where other compilers like (i.e rust are not fitting). But I really hope that the standardization committee will resolve most of the problems some day.
@telotawa
@telotawa 3 ай бұрын
imagine not knowing how long your integer primitives are because it depends on the platform nice elegance bud
@matgla95
@matgla95 3 ай бұрын
thanks, It's even worse when types promotion come to case when you have different type sizes on different platforms.
@redcrafterlppa303
@redcrafterlppa303 3 ай бұрын
stdint.h... Anyone not using them is just stupid or has an old codebase.
@tiranito2834
@tiranito2834 2 ай бұрын
Ah yes, because we sure do love writing non portable code! are we forgetting about the fact that C is a systems language? if you need code specific to a certain platform, then use stdint.h types, if you need portable code that works between platforms where you don't know what the width will be, then use standard integer types. I thought this was figured out like 50 years ago, we can't have devolved that much, right...?
@redcrafterlppa303
@redcrafterlppa303 2 ай бұрын
@@tiranito2834 why should normal ints be more portable? There is no real point in using normal ints over standard int. Platform dependent types are only necessary for system level interfaces and working with pointers. And in most cases the explicitly platform dependent size_t is all you need. Having the possibility that your int might be "arbitrarily" long depending on the platform might even cause bugs in form of unexpected integer overflow or compile errors in case of to large literals. Tldr always use stdint.h if possible. It makes the code more stable and compatible and portable.
@hugoandres5937
@hugoandres5937 3 ай бұрын
Answering your question about what languages I want to learn are: I've been trying to learn Rust for months, I took courses and read books but I haven't made any progress, I feel stuck, my goal with Rust is the backend, even in the same book it tells you that before that you must know C++. My biggest dream is to master Rust and then C++. that's why I started following your channel, thanks
@matgla95
@matgla95 3 ай бұрын
Yes, Rust/C++ require a lot of time invest. They are really hard to master, but still you can write good code without mastering each piece of a particular language.
@hugoandres5937
@hugoandres5937 3 ай бұрын
very thanks, greatings saludos desde Bolivia, querido amigo.
@unknownguywholovespizza
@unknownguywholovespizza 3 ай бұрын
There are better languages for backend
@hugoandres5937
@hugoandres5937 3 ай бұрын
@@unknownguywholovespizza For the niche I am aspiring to, they are the fastest and what I need to learn. Thanks for your comment, greetings
@ethical-not-evil
@ethical-not-evil 2 ай бұрын
it will works cuz of gcc it set variables and funcs to type int as default
@matgla95
@matgla95 2 ай бұрын
Yes, but it uses more than that :)
@Shnaypur
@Shnaypur 3 ай бұрын
Swietny material. Wiecej tego sortu filmikow :) Jakbys jeszcze tylko wrzucal regularnie materialy to mozna by pomyslec o jakies formie wspierania kanalu
@matgla95
@matgla95 3 ай бұрын
Dziękuję! Regularność niestety aktualnie nie wchodzi w grę, choć marzy mi się przyspieszenie montażu (pewnie kwestia wprawy). Kanał rozwijam w swoim wolnym czasie, a do tego dopiero uczę się nagrywania i montażu :) Póki co wystarczy lajk lub miłe słowo :)
@technikusMagna
@technikusMagna Ай бұрын
Nice code bro
@matgla95
@matgla95 Ай бұрын
Thanks !
@i_isak1451
@i_isak1451 3 ай бұрын
I guessed correctly but I liked anyways! Good video
@matgla95
@matgla95 3 ай бұрын
Thanks! :)
@hugoandres5937
@hugoandres5937 3 ай бұрын
Any advice for learning to program, without staying in the infinite loop of the courses, any tips that were useful to you, thank you
@matgla95
@matgla95 3 ай бұрын
I always recommend doing actual programs instead of courses. To be honest I almost always boycott most of course, it's too boring for me instead I am using them as a "what to learn next" list. Then think about what program you could wanna write and try to do it. It won't be perfect for the first time, but you can gain real experience and continuously improve it. It could be big or many small ones, but always think how you can improve them after all. When I was taking part in interviews in my previous company always the best candidates were with people that came with projects on GitHub that they prepared by themselves and it was easier for them to adapt to project.
@hugoandres5937
@hugoandres5937 3 ай бұрын
@@matgla95 very thanks 🙏🏻
@hugoandres5937
@hugoandres5937 3 ай бұрын
@@matgla95 Let's say I want to learn how like you, where would I start, if there is a lot of information, like the basics without having to go through the courses, the githubs are huge and there are topics in a single repository of different things, the documentation is technical and difficult, as you did at the beginning to later be able to extricate yourself from c, this answer would help me a lot more. greetings
@matgla95
@matgla95 3 ай бұрын
I don't mean to completely drop courses, they are necessary to learn basics. I also started with a course something like " from zero to games coder". And with each exercise I did a similar one on my own. Like it was a random number generation section with exercise with solution, so I did it, but then wrote my own program that also uses random number generation. With some basics I started writing game, since it was fun for me, step by step. With no knowledge it required a lot of internet research, like the first goal: select library, then render black window in OS... Trying to move from courses to reading reference manuals for language and documentation for libraries. Today all those GPT/Copilot could help to speed up information searching on given topic. Starting you may want to write as much as possible on your own, it's reinventing a wheel, but needed if you want to get deep knowledge. But most important is to find a way of learning that makes you fun. If it's not fun most probably you won't be able to spend enough time to grow fast, so the whole road will be longer. Keeping fingers crossed :) Which language you are trying to learn?
@hugoandres5937
@hugoandres5937 3 ай бұрын
@@matgla95 I've been trying to learn Rust for months, I took courses and read books but I haven't made any progress, I feel stuck, my goal with Rust is the backend, even in the same book it tells you that before that you must know C++. My biggest dream is to master Rust and then C++. that's why I started following your channe
@thefanboy3285
@thefanboy3285 3 ай бұрын
What does the tilde ~ symbole mean in C ? Just before the scanf
@matgla95
@matgla95 3 ай бұрын
It just performs bitwise negation on value returned from scanf function to break loop when got EOF ( which normally is -1 ).
@qy9MC
@qy9MC 3 ай бұрын
main(k){while(scanf("%d"))printf("%d ",k++*k/2);} is it a valid solution? It is 3 characters shorter. Also the original version with "%d " gave me segfault so I went with "%d ". I would like to try more but I really don't understand the coding challenge here. Why do we even scan for numbers? The rules are unclear to me, perhaps it's due to traduction from polish.
@matgla95
@matgla95 3 ай бұрын
So, let me clarify a little bit. The code is on SPOJ and is executed for 10 test cases. Test data is provided on STDIN in the form: 1
@HoangNguyen-nz4xe
@HoangNguyen-nz4xe 3 ай бұрын
That is so cool 😂
@matgla95
@matgla95 3 ай бұрын
Imagine my face when I found that type is not needed in the main function argument :)
@callisoncaffrey
@callisoncaffrey 3 ай бұрын
I see Windows, I leave. Edited to get rid of the heart sticker.
@matgla95
@matgla95 3 ай бұрын
Yes you're right, I have a problem with recording on Linux ( my camera interface produces crazy delays, most probably Nvidia again broke their driver xd ) which I haven't solved yet, so I temporarily switched to windows.
@callisoncaffrey
@callisoncaffrey 3 ай бұрын
@@matgla95 That's no excuse to have it running in the background. Honestly, I'd be embarrassed. You do you though. I'm sure your excuses will safe you from the social credit system you help implement by running spyware. Oh, and don't get me started on the smart phone which I'm pretty sure you have too.
@matgla95
@matgla95 3 ай бұрын
No no, I am only using pigeon post :)
@callisoncaffrey
@callisoncaffrey 3 ай бұрын
@@matgla95 You sound like a smoker telling me that smoked meat takes longer to go bad. I guess the copium is always real. Anyway, you keep making excuses for being the corporations' female canine. Another thing though. Are you actually in Poland? We are always looking for Team Fortress people in Europe. I wrote a fork of the original for the Darkplaces engine with more emphasis on tactics and stealth.
@unknownguywholovespizza
@unknownguywholovespizza 3 ай бұрын
Jerk
@jindrichcapek9836
@jindrichcapek9836 3 ай бұрын
Why is there a space between %d and ?
@matgla95
@matgla95 3 ай бұрын
Originally that code doesn't contain . It was added just to better presentation of execution. The testing from SPOJ is executed for many inputs from stdio and space is necessary to separate outputs for test cases.
@CodingWithDox
@CodingWithDox 3 ай бұрын
can u give us a link to the challenge
@matgla95
@matgla95 3 ай бұрын
Sure, pl.spoj.com/problems/SUMAN/ And more exercises and challenges like this are here: www.spoj.com/
@CodingWithDox
@CodingWithDox 3 ай бұрын
@@matgla95 I have a 52 letter solution but how do I make it use the correct compiler :c
@matgla95
@matgla95 3 ай бұрын
And that was one of the reasons that I decided to publish that video :) it's an old challenge and the current solution is easy on the internet to find, so I hoped someone will try to reduce it more! Unfortunately since the whole website is old and I am not even sure it is maintained, the latest compilers are not available.
@CodingWithDox
@CodingWithDox 3 ай бұрын
I lied, I misscounted, sorry for my ignorance :D
@matgla95
@matgla95 3 ай бұрын
@@CodingWithDox I am glad you tried. Someday someone for sure will find a better solution :)
@thribsilva
@thribsilva Ай бұрын
My solution to this in a theoretical language that sees and interprets whatever prompt you give it: an empty file. That language needs no code
@matgla95
@matgla95 Ай бұрын
No Code, No Problems! :)
2 Years Of Learning C | Prime Reacts
22:24
ThePrimeTime
Рет қаралды 298 М.
Running "Hello World!" in 10 FORBIDDEN Programming Languages
18:07
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 9 МЛН
MY HEIGHT vs MrBEAST CREW 🙈📏
00:22
Celine Dept
Рет қаралды 77 МЛН
The World Depends on 60-Year-Old Code No One Knows Anymore
9:30
Coding with Dee
Рет қаралды 884 М.
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 646 М.
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 7 МЛН
Teaching myself C so I can build a particle simulation
11:52
Gradience
Рет қаралды 277 М.
How programmers flex on each other
6:20
Fireship
Рет қаралды 2,4 МЛН
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 572 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 167 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 470 М.
Python VS С# | Согласен / Не согласен
14:27
Технологии в Контуре
Рет қаралды 49 М.
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 9 МЛН