Тёмный

coding in C but I start over for every compiler error 

Low Level Learning
Подписаться 645 тыс.
Просмотров 264 тыс.
50% 1

TODAY I TAKE ON A MIGHTY CHALLENGE. A QUEST THAT NO OTHER PROGRAMMER OR CONTENT CREATOR WILL TAKE ON FOR THEIR VIEWERS.
Today I will program a TCP Server and Client in C, but there is a catch. First, I will create this socket server and client, but if I get ANY compilation errors, I will delete ALL OF MY CODE AND START OVER. Two, I will not be using an outside resources. I will instead only be using the man pages that come with Linux.
Wish me luck.
🏫 COURSES 🏫
www.udemy.com/course/c-progra...
🔥🔥🔥 SOCIALS 🔥🔥🔥
Low Level Merch!: www.linktr.ee/lowlevellearning
Follow me on Twitter: / lowleveltweets
Follow me on Twitch: / lowlevellearning
Join me on Discord!: / discord

Наука

Опубликовано:

 

21 сен 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 339   
@LowLevelLearning
@LowLevelLearning Год назад
follow me on twitter please 👉 👈 twitter.com/lowlevellearni1
@gameplayyt504
@gameplayyt504 Год назад
Hey man, Do you run your code through WSL?
@eug3n33
@eug3n33 Год назад
Hello, i have one question, i hope you may take an answer on it. What font do you use in this video?
@vincent4070
@vincent4070 Год назад
Next challenge: repeat this with echo | gcc -x
@circuit10
@circuit10 Год назад
@@gameplayyt504 It's native Linux
@minirop
@minirop Год назад
Now onto the hard mode, compile with: -Wall -Wextra -pedantic -Werrors -Wconversion
@LowLevelLearning
@LowLevelLearning Год назад
I had to make sure the video adhered to the RU-vid under 24 hour guideline LOLOL
@TheMLover
@TheMLover Год назад
I preffer -pedantic-errors -fstack-protect-all -std=c89
@KaranveerSingh97
@KaranveerSingh97 Год назад
@@TheMLover hahahaha... c89 lol
@TheMLover
@TheMLover Год назад
@@KaranveerSingh97 the OG mode
@doublepmcl6391
@doublepmcl6391 Год назад
@@KaranveerSingh97 LooL not with c89 😂 this would be getting ridiculous
@pokemettilp8872
@pokemettilp8872 Год назад
I learned a great practice: "TODO: Make code good" Imma put this after every line of code now!
@LowLevelLearning
@LowLevelLearning Год назад
YOURE LEARNING FROM THE BEST
@not_ever
@not_ever Год назад
I prefer the convention of putting the TODO before each line of code. This way people know what to expect on the next line and the bar has been set as low as possible, so no one can be disappointed.
@arthur979
@arthur979 Год назад
// do client stuff
@sobanya_228
@sobanya_228 Год назад
Don’t repeat yourself. Put all the code inside a single todo block
@CyrillKR
@CyrillKR Год назад
This is honestly better than watching an hour long tutorial of an introduction for writing sockets in C.
@lmaox265
@lmaox265 Год назад
Could you explain to me what the application of a program like this is ?
@amritlohia8240
@amritlohia8240 Год назад
@@lmaox265 To run a server, basically.
@Kenyerman
@Kenyerman Год назад
-Wall -Werror
@LowLevelLearning
@LowLevelLearning Год назад
HARD MODE
@dimi5862
@dimi5862 Год назад
@@LowLevelLearning nah hard mode is with -Wextra
@mek101whatif7
@mek101whatif7 Год назад
You forgot -pedantic
@artemetra3262
@artemetra3262 Год назад
-Weverything
@houseisforthesoul
@houseisforthesoul Год назад
-WhatTheFack
@dooza
@dooza Год назад
I didn't have prior knowledge to C before my networking class and we literally just had this assignment. It was still hard with Stack Overflow help, because most C socket programming guides were written in plain HTML and were uploaded to some random subdirectory in a webserver at some university in 2002. But, MAN did I learn how man pages work!
@intazoid
@intazoid Год назад
_MAN_
@silentparrot8510
@silentparrot8510 Год назад
You inspired me to make a calculator interface in c++ with qt designer, but everytime its ugly i retype everything, wish me luck
@LowLevelLearning
@LowLevelLearning Год назад
See you in a few years LOL
@OnlyHerculean
@OnlyHerculean Год назад
Hahaha you made me chuckle man!
@hasanabufreiha8908
@hasanabufreiha8908 Год назад
@@LowLevelLearning Lmao
@OzelotJungle
@OzelotJungle Год назад
Have you finished?
@petermuller608
@petermuller608 Год назад
Great video idea. I especially like the "no outside resources" part. This was the default up to like 2005 for most of us :D
@sprytnychomik
@sprytnychomik Год назад
"Warnings are not errors" Only runtime can tell... ; )
@LowLevelLearning
@LowLevelLearning Год назад
Truuuuuuuuw
@LoomMexatron
@LoomMexatron Год назад
I am rather impressed. Not many people have the courage to do such challenge with such rules!
@CallousCoder
@CallousCoder Год назад
I called it the sadomasochistic challenge! 😃
@Dyanosis
@Dyanosis Год назад
What challenge? He basically copied from the man docs.
@ronen124
@ronen124 Год назад
@@Dyanosis he knew much more than that [edit: I fixed a poor typo error I made]
@deang5622
@deang5622 Год назад
It's a pointless challenge: it achieves absolutely nothing.
@deang5622
@deang5622 Год назад
@@Dyanosis Nobody knows the specifics of every function within all the installed packages, looking up documentation is an essential part of any programmer's job. However, it is completely pointless challenge. It has no value whatsoever. I have been programming for 40 years, and yes you occasionally get the number of arguments wrong for a function, no one in their right mind deletes all their code and starts again. No one.
@sohn7767
@sohn7767 Год назад
This feels like a Speedrun but every error is a huge timeloss so you reset
@Ululukiful
@Ululukiful Год назад
Yeah I also thought of steel soul/iron man programming
@Ecks1118
@Ecks1118 Год назад
Genuinely one of the most entertaining, professional, and helpful programming youtubers I know, you're very cool. This is also a very "fun" challenge idea.
@LowLevelLearning
@LowLevelLearning Год назад
Thank you for your kind words!
@RyanLynch1
@RyanLynch1 Год назад
very cool idea and a clever gimmick! hope you do more of these
@ahmedsaadsabit1749
@ahmedsaadsabit1749 Год назад
I have begun to love this channel so much, some more low level content would be fucking amazing!
@isabelpino1987
@isabelpino1987 Год назад
With your videos my learning curve will shrink drastically. Thank you.
@mhsd7178
@mhsd7178 Год назад
Impressive. Any chance you could do a video where you go into more detail on how this works including how to work with the man pages?
@LowLevelLearning
@LowLevelLearning Год назад
Sure
@johnnygotti1568
@johnnygotti1568 Год назад
yeah, i was shocked when he pulled up documentation from a man page
@davga2300
@davga2300 Год назад
This was an excellent video! Thanks. I need to try this sometime as it will probably improve my programming skills.
@pwnwriter
@pwnwriter Год назад
Learnt a lottt Pls do these type of challenges moreeeee.
@heitormbonfim
@heitormbonfim Год назад
Great one, bruh. Just make sure to give a ctrl + (plus) to zoom in a bit and a ctrl + B to get rid of the side bar showing the files.
@kalelalves
@kalelalves Год назад
I don't think I ever felt so stressed out from watching someone code. hahaha
@_odo
@_odo Год назад
Now do hardcore mode: switch OSes every time you get a compile error (Linux, macOS, Windows, FreeBSD, and then increasingly obscure Unixes in VMs)
@pallzoltan
@pallzoltan Год назад
Man youre crazy .)) Love your videos
@notyaniecetv
@notyaniecetv Год назад
I just know this is a GREAT way to learn ! 😂 Leaving a comment so I can come back to this when I get off
@limesenpaiscomics3287
@limesenpaiscomics3287 Год назад
So informative, thanks a lot!
@rallokkcaz
@rallokkcaz Год назад
LOW LEVEL GANG! This is what's up! Great video as always my dude. htons time.
@LowLevelLearning
@LowLevelLearning Год назад
GANG GANG GANG
@RichiAndiProject
@RichiAndiProject Год назад
Ima download it thanks for sharing!!
@hbobenicio
@hbobenicio Год назад
This is a really nice way to learn API's (and programming languages) by heart
@okie9025
@okie9025 Год назад
Nice!
@LowLevelLearning
@LowLevelLearning Год назад
Thanks!
@spinspin1597
@spinspin1597 Год назад
It is genuinely so nice to see someone else using wmi3, like seriously it really made my day lol
@potatofuryy
@potatofuryy Год назад
Man you’re making me want to get back to coding again
@badgerint
@badgerint Год назад
A very brave challenge indeed. Even more so with the senseless Yoda Notation.
@berliangur
@berliangur Год назад
It's like Dark Souls of Coding
@LegendKopper
@LegendKopper 6 месяцев назад
I am a software engineer in a high level language (javascript/typescript) and it's always shocking / fascinating how little I understand watching these videos. Props to all C programmers out there
@markay7311
@markay7311 Год назад
Now, this is a video worth watching!
@drizer4real
@drizer4real Год назад
brilliant way to a) torture yourself and b) learn deeply about a subject. Love your channel !
@Don_XII
@Don_XII Год назад
Haven't watched the video yet, but liked and comment already for the pain alone lol
@Erizo_
@Erizo_ Год назад
ngl, easier than i expected, i was expecting like 1000 loc.
@phuctran25277
@phuctran25277 Год назад
Nice video. I found your channels useful. You can improve your videos by adding intro or some sort of delays before the main content. I was shocked and completely caught off guard because the moment your video started you directly jumped into the main content at 00:00 immediately after the video is done loading. I have to scroll the video to the beginning because I did not catch what you said. Otherwise the content is good, keep up the good work!
@amisingh2366
@amisingh2366 Год назад
This was awesome! More of that haha
@mahdirahman8451
@mahdirahman8451 Год назад
This is amazing 👏 🙌
@retrokoh
@retrokoh Год назад
Reads: "i START OVER every time i get a compiler error" Me: Grabs popcorn and gets comfy
@CallousCoder
@CallousCoder Год назад
Kudos! Sadomasochistic challenge. But you didn’t do it properly (shortcut 😊) because this server only accepts one client. You need to either hand it of to select() or a pthread from a pool 😂 And you send and you do not check whether all bytes were sent and if not send the remainder until 0 bytes are send.
@LowLevelLearning
@LowLevelLearning Год назад
something something works on my computer
@CallousCoder
@CallousCoder Год назад
@@LowLevelLearning try connecting 2 clients simultaneously see if it still works for both of them 😂Although that could be a challenge with such a short message. But that send bug I came across in a commercial bokking system that booked tickets. And sometimes it would hang and the whole client hung - waiting for the ticket booking to be confirmed. I disassembled the code read it and instantly saw that blatant bug. Reported it to the manufacturer in Sri Lanka and they were like: “it works here in unit test, it’s no bug!” Well do’t do that to me because I get very annoyed 😅 “Of course it works when you test it on a high speed local network let alone on loop back interface! But try it in the real world with slower lines, where did you get your degree? The useless Uni?” So I actually patched the binary code with a hack hook. And proved it to them with screenshots. And when I proved it to that engineer’s manager - who happened to visit our office the next week. And I told what an idiotic useless attitude this guy had, he got fired by him over the phone… that was not what I wanted. Now that single connection bug I ran into as well at a company we were doing a technical verification for a product a client of us wanted to buy. I see the server code and I say to my manager: “let’s have some fun” I opened a telnet to that server and kept its socket alive. The engineer comes and starts test run and it doesn’t end (waits for connection). We hear him go: “huh? What? Huh? Well I think we fucked up some code, time to restore everything!” We looked at each other and immediately made a note in our report to not use Cegelec as their IT partner because they obviously didn’t write quality code nor understood their own solution. The funny thing is that I too ran into these things learning socket programming back in the mid 90s. So I know what to look for, but Fucking up during learning is fine. Making this blunders in production code is unforgivable.
@toastea4987
@toastea4987 Год назад
@@CallousCoder Dude its a coding challenge not an enterprise program
@user-hd7wd4nu1o
@user-hd7wd4nu1o Год назад
Nice, brings back memories .... Did this ~35 years ago. Much harder in vi:) and using 2 vt100 terminals in a lab at 10pm at night.
@steveokinevo
@steveokinevo Год назад
A nice video man, your send and recv may not send all data on the first send / recv call, you need to handle that, nice intro all the same, well done.
@iwillburn
@iwillburn Год назад
Hell yeah bruv! Let's goooooo!!!!!
@TheOriginalJohnDoe
@TheOriginalJohnDoe Год назад
1:40 "0 > sfd" You sir, are playing with fire.
@Quantum_Nebula
@Quantum_Nebula Год назад
It's hella sadistic to even challenge yourself with this, especially on RU-vid. Dang
@blackbriarmead1966
@blackbriarmead1966 Год назад
This gives me flashbacks to my "Intro" to computer systems class. I had to make a multithreaded socket server for file transfer. took at lest 24 man hours
@pendragonscode
@pendragonscode Год назад
I read the title and I already knew what was coming.
@marianos63
@marianos63 Год назад
This gentleman deserves a prize
@SkrtlIl
@SkrtlIl Год назад
How would the good version of this code look for the client? Someone else mentioned polling for multiple connections on the server and resending a buffer (don't know why, I thought TCP takes care of that).
@bloroxcleach896
@bloroxcleach896 Год назад
coding a snake game but everytime you blink you have to start over
@bernardev3
@bernardev3 Год назад
Imagine doing this challenge with an really big application, it might take some years to complete :v
@Artenesama
@Artenesama Год назад
Great vídeo!
@johntheawsomeful
@johntheawsomeful Год назад
These are my favorite
@jojo150393
@jojo150393 Год назад
Challenge with a friend: every compile error, the guy have to drink a beer
@sorek__
@sorek__ Год назад
Great challenge, you are definitely very good programmer. Shame it's very complicated and hard to follow for someone who doesn't know what this stuff does!
@LowLevelLearning
@LowLevelLearning Год назад
Sorry!
@sorek__
@sorek__ Год назад
@@LowLevelLearning Don't be sorry for being good!
@deang5622
@deang5622 Год назад
A good programmer doesn't waste valuable time deleting code because they made a harmless mistake.
@perfectionbox
@perfectionbox Год назад
A friend of mine took the challenge, he's still at it and it's been three years 😂
Год назад
Can we go async next time? Awesome tutorial.
@armazi2983
@armazi2983 Год назад
Me: tries this challenge Also me: fucks up on main function declaration
@kawaiibunnypop5545
@kawaiibunnypop5545 Год назад
This is the best free software Ive seen. Respect.
@setitthen
@setitthen Год назад
Great channel ....can you do something on passing array using pointers to an address. And circular buffers for data logging applications. Thank you.
@LowLevelLearning
@LowLevelLearning Год назад
Sure thing!
@yashumaurya4500
@yashumaurya4500 Год назад
brother, what do you do for a living. if yt is your main work (full time) then what did you used to do before this ?
@alfredomenezes8814
@alfredomenezes8814 Год назад
Would be intersting to see something like this with Rust too!
@enriquedelacal2814
@enriquedelacal2814 Год назад
More C videos please
@T1MB05L1C3
@T1MB05L1C3 Год назад
This is like the nuzlocke of coding
@avashurov
@avashurov Год назад
Reminded my how we had to write c code on the paper in collage for exam… Now double challenge, make it compile and run with no errors on Linux, MAC, and windows
@armpitpuncher
@armpitpuncher Год назад
This is sort of how I learned opengl. I would write the code to render a triangle from memory every day until it was second nature.
@deang5622
@deang5622 Год назад
But did you delete it each time you made a mistake? No, I thought not. So it's not really how you learned opengl is it?
@armpitpuncher
@armpitpuncher Год назад
@@deang5622 What a weird fucking comment.
@Baguette939
@Baguette939 Год назад
It says sort of
@Burgo361
@Burgo361 Год назад
This challenge is awesome, and I both want to try it and fear it haha
@LowLevelLearning
@LowLevelLearning Год назад
Do itttttt
@excuseonme
@excuseonme Год назад
You just earned a new sub 😂
@stefan429
@stefan429 Год назад
this is the low level masochism i fuck with
@durgeshchauhan9773
@durgeshchauhan9773 Год назад
Best of the best
@proyuncu-jv8gd
@proyuncu-jv8gd Год назад
Thank you
@huntabadday2663
@huntabadday2663 Год назад
He. He did it! He made a program work first try!
@embedyt
@embedyt Год назад
i dont even know anything about c++ i just like watching it
@ashajjar
@ashajjar Год назад
how do you know which section to call from the man pages? :/
@abeard1
@abeard1 Год назад
This was nerve-wracking
@manuindenwolken
@manuindenwolken Год назад
Please do this in Rust and expand the condition for starting over to compilation warnings.
@vmannn4259
@vmannn4259 Год назад
"Step 1: Be the compiler"
@TheRealJman87
@TheRealJman87 9 месяцев назад
I find avoiding compiler errors with C is pretty easy. Runtime errors, though... 😬
@MuhammadAhmedBilali
@MuhammadAhmedBilali Год назад
Did you close sfd at the end of server.c main?
@hypocritical7379
@hypocritical7379 Год назад
This is literal torture
@HenokJackson
@HenokJackson Год назад
At 7:03 did you try type casting & client_info to (struct sockaddr*)?
@jflow922
@jflow922 Год назад
This is a coding project nuzlocke
@fuery.
@fuery. Год назад
I'd do this but in python personally, would be a fun challenge to make sure I know what I'm doing. Probably wouldn't do a server or anything though.
@paherbst524
@paherbst524 Год назад
Only using man pages?? Isn't that the norm? That should be everyone's first reference.
@aakarshan4644
@aakarshan4644 Год назад
oh shit ... this sadomasochistic method is so fucking useful to increase accuracy in coding problems lamo .. thanks man :)
@LowLevelLearning
@LowLevelLearning Год назад
this is the way
@CallousCoder
@CallousCoder Год назад
My dad and even a colleague 10 years my senior couldn’t even compile to see if something was correct or not. Because compiling took too much resources from daily batch processing. So compiles were queued to be done after business hours. So fucking up meant losing a whole day. Im a very decent programmer but I do need iterate quickly 😄 I couldn’t do that.
@scriblestingray5713
@scriblestingray5713 Год назад
Why. I haven’t even watched the video, but seeing that title makes me want to die.
@MrA6060
@MrA6060 Год назад
really interesting video, would be cool to force to learn stuff without going to immediately google it instead of using the docs. Also didn't expect sockets to be this easy to code
@TornTech1
@TornTech1 Год назад
Im looking for some guidance... I am a professional Web Backend C# developer. But in the evenings I'm wanting to dabble in embedded/bare metal programming as its quite distant from the usual stuff I do every day in C#...(The idea of attempting to write my own OS one day is quite appealing!) I've been binge watching your videos and love the channel and your content! but I am conflicted between focusing my effort on learning and mastering Rust, Vs C. I Was hoping to hear some opinions from yourself and the community on what people think, and if you had to do it over again... what would you pick as your main weapon of choice for this area of development?
@LowLevelLearning
@LowLevelLearning Год назад
I’ll be doing a video on this first but the short version is if you’re new to this world, learn how things work with C first. It’s the best way to learn how computers work (albeit the process is a bit painful :) )
@sapphie132
@sapphie132 Год назад
Why was my first reaction to the description of the challenge, "hey, that seems fun"?
@ayman436
@ayman436 Год назад
The Dark Souls of programming
@Siger5019
@Siger5019 Год назад
Does using a checker count as getting compiler errors?
@dardevelin
@dardevelin Год назад
Yes Obvi. You need to be able to write in pen and paper and no googling :D
@mymonagaming8547
@mymonagaming8547 Год назад
TNice tutorials man did a really good job of explaining ever tNice tutorialng ever one else don't really go into detail
@thomas_w
@thomas_w Год назад
Why do you always write if(0 > expr)? I mean it works the same, but I and also everybody i know would write something like if(expr < 0), so the expression before. But still a great video anyway.
@Red4mber
@Red4mber Год назад
Satan be like : Now do that in Rust
@BalloStudios
@BalloStudios Год назад
What is a socket server?
@Luix
@Luix Год назад
Do you recommend learning C for Arduino and similar projects (ti boards etc)
@asandax6
@asandax6 Год назад
Yes and to make it more challenging don't use the Arduino IDE or PlatformIO not even the VS code extensions.
@gabrieleymat6332
@gabrieleymat6332 7 месяцев назад
That moment when you realise you learn C in a school where there are structures forbidden (switch case, for loops, goto...), the only function authorised are write, read, open, malloc, free and pipe. You need a norm to code, and use the flag -Wall -Werror -Wextra And if someone can crash your program (ex, a failed malloc) OR you have memory leaks, you are graded 0/100
@markvaldez8602
@markvaldez8602 Год назад
very fun
Далее
how do hackers exploit buffers that are too small?
8:25
За что я НЕНАВИЖУ ЛЕТО
00:59
Просмотров 199 тыс.
06-Linux Command | head tail more less
12:01
Rust is Not C
16:24
Просмотров 192 тыс.
Writing Code That Runs FAST on a GPU
15:32
Просмотров 550 тыс.
one of the craziest exploits i've ever seen
8:40
Просмотров 375 тыс.
Building and riding increasingly small bikes
18:01
Every Programming Language Ever Explained in 15 Minutes
15:29
God-Tier Developer Roadmap
16:42
Просмотров 7 млн
Yanlışlıkla Telefonumu Parçaladım!😱
0:18
Просмотров 4,9 млн