Тёмный

Why I Use C | Prime Reacts 

ThePrimeTime
Подписаться 479 тыс.
Просмотров 130 тыс.
50% 1

Recorded live on twitch, GET IN
Reviewed Video
• Why I Like Programming...
By: / @franciscofox
My Stream
/ theprimeagen
Best Way To Support Me
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
MY MAIN YT CHANNEL: Has well edited engineering videos
/ theprimeagen
Discord
/ discord
Have something for me to read or react to?: / theprimeagenreact
Kinesis Advantage 360: bit.ly/Prime-Kinesis
Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
turso.tech/deeznuts

Наука

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

 

11 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 557   
@demolazer
@demolazer 13 дней назад
Turned 3 mins video into 13 mins, is this guy the best react streamer or what
@StingSting844
@StingSting844 13 дней назад
Yes he is 🎉
@Thenderick
@Thenderick 13 дней назад
Six seconds in, pauses video
@ryoukaip
@ryoukaip 13 дней назад
so true lol
@ShrirajHegde
@ShrirajHegde 13 дней назад
4x developer
@briza_md
@briza_md 13 дней назад
The Asmongold of programming
@cazz
@cazz 13 дней назад
Prime might be a web dev, but we all know hes moving towards C/C++
@zyriab5797
@zyriab5797 13 дней назад
It's "C and/or C++". Stop mixing these languages, it confuses newcomers.
@mrfli24
@mrfli24 13 дней назад
⁠@@zyriab5797really ??? 😂
@Cyclically
@Cyclically 13 дней назад
didn't expect to see you here
@aliceylan1211
@aliceylan1211 13 дней назад
@@zyriab5797 it doesnt confuse anybody what are you talking about those two are literally the same language but one having some additional stuff
@carriagereturned3974
@carriagereturned3974 13 дней назад
C++ never been promoted here. C++ is over complicated.
@andythedishwasher1117
@andythedishwasher1117 13 дней назад
Wait, did Prime just subtly endorse the practice of quiche eating? Revoke this man's x86 Assembly license immediately!
@PhilipAlexanderHassialis
@PhilipAlexanderHassialis 13 дней назад
"Real programmers don't eat quiche"
@Kane0123
@Kane0123 13 дней назад
His kids clearly rejected his quiche eating ways. So he got that right at least
@paladin80lvl
@paladin80lvl 12 дней назад
wait, did you just shif in your pants?can you like unshif?
@indyztech
@indyztech 12 дней назад
All we are saying is give quiche a chance.
@grimvian
@grimvian 12 дней назад
After 40 years in IT as a reseller and now retired, I wanted to warm up my old hobby - programming. After two years of C++, I realized, that I'm not compatible with C++ and ended with C and it's great. When memory management and logic goes hand in hand, I just love it.
@SimGunther
@SimGunther 13 дней назад
Because it's the offical lingua franca of programming
@eloniusz
@eloniusz 13 дней назад
I think you've meant "ligma".
@Vinoyl
@Vinoyl 13 дней назад
@@eloniusz what's a ligma
@TheSulross
@TheSulross 13 дней назад
there was a time that if an applicant didn't have some years of commercial C programming on their resume that they shouldn't even bother applying. It was as expected in the industry as much as we expect everyone to know the alphabet and be able to read. Those were the days of real programmers, of course.
@eloniusz
@eloniusz 13 дней назад
@@Vinoyl Ligma balls
@ShinneyDev
@ShinneyDev 13 дней назад
@@Vinoyl💀💀
@FinaISpartan
@FinaISpartan 13 дней назад
C is still the closest thing to cross-platform assembly. I also love the simplicity of the language, and it shows with how small and fast its compilers are. I only wish it had better tooling, as something like cargo really speeds up development.
@TheSulross
@TheSulross 13 дней назад
any tech stack that achieves esoteric priesthood status and I'm all in my copy of K&R poses prominently in my shrine to the ATT Bell Labs pantheon
@arimill1045
@arimill1045 13 дней назад
just add zig build tools and you're modern. Its the best
@vitalyl1327
@vitalyl1327 13 дней назад
Sadly, even C cannot be called a cross-platform assembly. It's too far detached from the actual ABI details, for example.
@uis246
@uis246 13 дней назад
​@@vitalyl1327except inline assembly
@bitwize
@bitwize 13 дней назад
I'd say LLVM and WASM are closer to cross-platform assembly than C. C is a high-level language with an abstract machine model as part of the spec.
@samuelmoncarey7183
@samuelmoncarey7183 13 дней назад
The best skill to have as a programmer is understanding code someone else wrote
@lmoelleb
@lmoelleb 11 дней назад
Not to mention the code you wrote yourself a few weeks back. :)
@MindBlowerWTF
@MindBlowerWTF 11 дней назад
@@lmoelleb weeks? Bro, I come back two days later and im lost
@lmoelleb
@lmoelleb 10 дней назад
@@MindBlowerWTF well, I did not want to push it too far.... But to be honest, sometimes the lunch break is enough. :)
@GhidBase
@GhidBase 6 дней назад
​@@lmoelleb lunch break is more accurate lol
@halladba101
@halladba101 5 часов назад
I think writing a code that optimizes someone's time going through it is considerable (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ehTIhQpj9ys.html)
@captainfordo1
@captainfordo1 13 дней назад
The reason I use C (and Odin, because it’s philosophy is the same) is because it doesn’t get in my way when I code. That’s it. It is so much easier to reason about my code when I don’t have 50 different features to think about, all polluting my mental model.
@ITSecNEO
@ITSecNEO 10 дней назад
Sure 😂 So we not mention the brain damage everyone gets when compiling their c code. Everyone who worked on bigger projects in c can relate to that
@dan_pal
@dan_pal 3 дня назад
Then you must have an even bigger mental model to manage your make files lmao
@foo0815
@foo0815 12 дней назад
That's the reason I love programming in Common Lisp. You can start fairly abstract, but go down to machine level when you need to.
@taylorallred6208
@taylorallred6208 13 дней назад
After trying out many languages (including Rust and Zig) I’ve also found that I strangely really enjoy C. There’s much less to keep in your head and with some good technique and knowledge of what you’re doing it’s very gratifying.
@jose6183
@jose6183 13 дней назад
Exactly
@kjetilhvalstrand1009
@kjetilhvalstrand1009 13 дней назад
I agree, but its nice to have few drops of vector lists, and other stuff, the g++ finds normally more potential bugs, when casting. I’m bit too old school for all the C++ classes, most of my code is C. Templates is good way keep my code more DRY, can do the same with macros, but it seems easier to write templates.
@xbmarx
@xbmarx 13 дней назад
What some people miss about the undefined behavior in C is that much of it is a feature, not a bug in the spec. C deliberately has some UB to allow compilers to optimize on architectures that behave differently at a fundamental level. For example, AVR and PIC microcontrollers and certain RTOSes will not panic when dereferencing a null pointer. I've worked with some microcontrollers, like the TI MPS430, that actually initialize uninitialized variables. Not everything is ARM or x86. C's stance to define this as UB means that compilers can make the correct decision depending on the OS and hardware. Reading forums of competing programing languages, you'd get the impression that undefined behavior in C is a pernicious and capricious bug in the specification itself. It's not. It's quite deliberate. All this being said, languages that eliminate this UB and prescribe standards across hardware are limiting their optimizeability across different architectures and, imo, are unlikely to replace C as the common systems programming substrate.
@isodoubIet
@isodoubIet 13 дней назад
It would be possible to make most such instances of UB as "implementation defined" instead of UB. UB means the program can legally do anything. It can delete your hard drive. It can turn off the life support machines. It can push the button and launch the missiles. UB is never a feature. It's *always* a defect in the spec.
@MrHaggyy
@MrHaggyy 11 дней назад
@isodoubIet so what is your difference between undefined and implementation defined. If you take something like the aero-space, automotive or industrial standard compilers they all need to define a certain behavior for UB. So no missile launches by accident, your car flips by accident or your microwave burns down your house.
@isodoubIet
@isodoubIet 11 дней назад
@@MrHaggyyIt's not "my" difference, it's the standard's (C and C++ both). For example the C++23 standard defined "Undefined behavior" as "behavior for which this document imposes no requirements", whereas "unspecified behavior" is "behavior, for a well-formed program ([defns.well.formed]) construct and correct data, that depends on the implementation", and implementation-defined is "behavior, for a well-formed program ([defns.well.formed]) construct and correct data, that depends on the implementation and that each implementation documents". Undefined behavior is e.g. accessing an array past the end. Unspecified behavior is which subexpression gets evaluated first in an expression like (a + b) + (b + c), and implementation-defined is like the width of an int. "If you take something like the aero-space, automotive or industrial standard compilers they all need to define a certain behavior for UB" The "compiler" always "defines" a certain behavior by UB, and its source code is a definition of sorts. The problem is you as the programmer have no idea what that might be, and even if it happens to work, it's a bad idea to rely on it.
@isodoubIet
@isodoubIet 11 дней назад
@@MrHaggyy It's not "my" difference, it's the standard's (C and C++ both). For example the C++23 standard defined "Undefined behavior" as "behavior for which this document imposes no requirements", whereas "unspecified behavior" is "behavior, for a well-formed program construct and correct data, that depends on the implementation", and implementation-defined is "behavior, for a well-formed program construct and correct data, that depends on the implementation and that each implementation documents". Undefined behavior is e.g. accessing an array past the end. Unspecified behavior is which subexpression gets evaluated first in an expression like (a + b) + (b + c), and implementation-defined is like the width of an int. "If you take something like the aero-space, automotive or industrial standard compilers they all need to define a certain behavior for UB" The "compiler" always "defines" a certain behavior by UB, and its source code is a definition of sorts. The problem is you as the programmer have no idea what that might be, and even if it happens to work, it's a bad idea to rely on it.
@vorrnth8734
@vorrnth8734 9 дней назад
Well UB means anything can. The program might order uranium, set your bed in fire.
@andythedishwasher1117
@andythedishwasher1117 13 дней назад
The dichotomy you describe between drive to mastery and drive to get paid seems like it has a middle ground that I strive for that could be described as a drive to accomplish a task well and efficiently for the satisfaction of it.
@Bobbias
@Bobbias 13 дней назад
"all you need is a bunch of nand gates" Better yet, all you need is a bunch of transistors.
@XDarkGreyX
@XDarkGreyX 13 дней назад
Just need a lot Indians who know math
@ark_knight
@ark_knight 13 дней назад
Even better - Abacus - Chinese.
@janek9971
@janek9971 12 дней назад
all you need is electrons and holes
@hindsightcapital
@hindsightcapital 4 дня назад
Better yet, all you need is some sand
@mateusvmv
@mateusvmv 13 дней назад
Wait until you start implementing high level concepts within the C preprocessor Because no language feels closer at home than your own personal (it's readable to you) macro spaghetti
@mxruben81
@mxruben81 12 дней назад
I once forked a lua library where the previous owner generated all the tests with a custom C program. It was such a confusing macro mess that I ended up just rewriting them. Probably a skill issue but idc it was still insane.
@BeethovenHD
@BeethovenHD 13 дней назад
People always pushing stuff further and further. In almost everything. Examples are the economic growth, your piano skills or your rizz skills - idk. Sometimes there is no need. Have a nice day.
@bearwolffish
@bearwolffish 13 дней назад
10:28 Do love those filters and ranges. Haven't written a boomer loop in anything but simple examples made readable for people unfamiliar with algorithms, in a long time.
@AGentooUser
@AGentooUser 13 дней назад
1:45 In youtube you can press '
@zyriab5797
@zyriab5797 13 дней назад
Thank you, wise Gentooman
@jgfjfgjfhjf
@jgfjfgjfhjf 13 дней назад
ty
@sutirk
@sutirk 13 дней назад
We got vim motions on RU-vid before we got GTA 6
@stefangibacaivastani
@stefangibacaivastani 13 дней назад
@@sutirk tragic
@jerichaux9219
@jerichaux9219 13 дней назад
Marry me.
@AvalancheGameArt
@AvalancheGameArt 13 дней назад
Try embedded development, the only abstraction you have is the startup code that calls your main function. Also working with memory you understand how the computer works. interrupts are another thing that allows you to demistify what happens at the processor level. also you need to study the specific controller's architecture.
@qy9MC
@qy9MC 13 дней назад
What I like in C is that premature optimisation actually works. In other languages it simply fails due its unfriendly nature to the compiler or interpreter. C is much clearer on what is fast. I think the slowness of other languages is mostly due to knowing what is fast in that language. Often when you write code, we tend to use the most simple way, so we use language provided things, but those are often slower than writing the code with more basic things. So sugar is the devil and we can't stop using it due its charming simplicity. C simply doesn't have that option, you are forced to write the function with basic blocks. That way C code is often faster.
@thesenamesaretaken
@thesenamesaretaken 12 дней назад
So long as you know what you're doing. If you don't then things can get funny: one time I thought I would try converting some Python code I had to C. It was a bunch of tight loops doing calculations, the sort of thing you don't expect Python to be good at, and I was curious what C's performance with basically the same code would be. Instead the stumbling block was the 50mb file of numbers I had to read in to an array first, that's trivial in Python but my uneducated attempt to hand roll a C file parser was so bad I never even got to the calculation. Writing in C requires a commitment to learning about things you would otherwise take for granted.
@TehKarmalizer
@TehKarmalizer 12 дней назад
@@thesenamesaretaken that does indeed sound like an issue I would expect a Python-first programmer to encounter. Coming from the other way, a C developer would also probably be perplexed by performance for different reasons.
@MrHaggyy
@MrHaggyy 11 дней назад
@thesenamesaretaken in the really heavy number crunching python is only a little bit slower. Your modules are usually written in the language that suits the problem, and the python language just distributes data as needed.
@pavelperina7629
@pavelperina7629 11 дней назад
@@MrHaggyy Yeah, If you do number crunching in numpy or something, you are basically using C code anyways and often well optimized. If you want to write your own raytracer using Python, then it could be three orders of magnitude slower than C. By the way very niche language for number crunching is Julia, it has simplicity of Python, but much smaller communities and much less libraries. If you use strong typing, it's roughly 3-5 times slower than C which is not that bad. I tried it, but I have no use for it. Mostly I can write one purpose or not time critical stuff in Python and larger apps in C++.
@coolbugfacts1234
@coolbugfacts1234 11 дней назад
In C the semantics are so ill-defined that higher level optimizations that require the language to specify how memory and pointers can be used more concretely will never be possible
@KingBobXVI
@KingBobXVI 19 часов назад
8:40 - This is a really important thing for you to have called out, imo. I was feeling super burned out for _years_ of corporate software work; spending most "dev time" on cloud configurations, using a random mix of languages for every project, spending tons of time upgrading frameworks or switching to new ones because web development paradigms and "best practices" change every year or two... it's all so draining and soulless. Then I finally made myself do a project I'd been wanting to do for years - get back into making a game engine, combined with wanting to make it work for Web-Assembly for various reasons. Was originally going to use Rust, but learning two new things while already dealing with burnout was... not working. Eventually went with C and with the arbitrary deadline of a game jam, I managed to start the project and actually get into it again. Because of it, this is the first year in almost a decade where I've actually been _enjoying_ coding again.
@Zyhru
@Zyhru 13 дней назад
prime was talking real to the new gen of programmers real talk at the end there , gr8 vid
@elbardo_lux
@elbardo_lux 13 дней назад
I don't know if I'm too dumb to realise i'm doing things wrong or if I never did something that actually required me knowing how to use them, but I never had issues with pointers in C
@psteven5
@psteven5 13 дней назад
it mostly just stems from beginners not really understanding what they are, and then proceed to throw * and & at things until it (seems to) work
@KingJellyfishII
@KingJellyfishII 13 дней назад
I have a theory that people's misunderstanding of pointers stems from a misunderstanding of memory. if you understand physical memory, pointers become - if not obvious - easier to reason about.
@Muskar2
@Muskar2 13 дней назад
@@KingJellyfishII It's interesting to me. I always heard rumors that so many people having a hard time with pointers, but I've never really seen examples of things that real people had trouble with after not being an absolute beginner (unless you're buying into RAII instead of memory arenas). Have you encountered any actual misunderstandings from people who weren't outright beginners?
@kashperanto
@kashperanto 13 дней назад
Yeah, I think it's entirely a beginner problem. Maybe if people are talking about null pointer issues that is a legit concern, but that is really just a symptom of lazy error handling or poor design. A lot of code is easier to read and reason about when using pointers.
@isodoubIet
@isodoubIet 13 дней назад
Pointers are easy, just the syntax is hard to get at first because of the misguided notion of "declaration follows use" (one of many many sucky choices in C's design).
@deanruskov9025
@deanruskov9025 4 дня назад
I am a first year electrical engineering student and i had a 1 semester cource on C. It was some of the most fun that ive had learning and it sparked a desire to continue studying programming. There's something so special about starting from a blank file and bit by bit implementing a complex program that languages like java have yet to show me, but then again I'm comparing apples to oranges
@JohnDoe-np7do
@JohnDoe-np7do 13 дней назад
What you said ab the level of abstraction hidden from you even when using C is so right. And that part about having more control being a pain sometimes is true depending on the scope of a project, the amount of heap/dynamic allocs my current project makes always makes me think "yo this sh*t is dangerous" altough thanks to arenas and defer pretty much solve it for me but still its risky. Im by no means a beginner but damn i still dont know a lot, im 700 lines into a compiler/language ive chosen to write (in zig btw) when i have the time & i realize just how much ive taken for granted. Im not even at the code gen part, was considering native asm but i think llvm ir or qbe would be a more sane option. the tokenizer i wrote is great, its 500 lines & works flawlessly & is fast. the parser however is another story, its works but is a mess & needs to be revised plus im using a map to resolve vars at runtime, pretty sure there are better ways to do this. At this point, the language already has the ability to resolve identifiers into values, booleans, floats & ints of numerous bases (namely 2, 8, 10 & 16, coz were programmers, these are the only ones that truly matter, in any case they all evaluate to base 10 at run time) the parser also has the ability to evaluate binary arith operations/expressions with numerous operands even when an operand is actually a nested expression, altough there is no precedence and is left-associative for now. However if im being honest with myself, the implementation of the parser is so dumb & the amount of branches the program takes is probably enough to grow an actual physical tree 😂 There are many functions/methods which use both recursion and loops at the same time + ive added so many constraints into the syntax of the language such as prefixing ids with $ or @ to ease the process. @ is supposed to reference global symbols either "imported" from zig std or c std or simply provided out of the box. Got the idea from llvm ir & zig too. theres still so much left to do such as adding that feature and by the time im done itll probably be well over 1000+ loc & hopefully ill come out more knowledgeable once its completed but more importantly, be able to accomplish my goals for this project. I dont think there is a necessarily a "best" language, in fact im at a point where i enjoy as many languages as possible, i used to be like this guy but for me it was c++ but i appreciate the more modern languages available nowadays. After all, its nice to have a change of language once every while coz 4 the most part the basics stay the same & it should always be a joy to program, skill issues suck but there really is no easy way to get good if you dont have inherent talent for this.
@EvanEdwards
@EvanEdwards 13 дней назад
I don't often have an opportunity to write C, but when I do, I enjoy it. And often it is still the best tool for the job.
@AlistairGale
@AlistairGale 13 дней назад
Because B isn’t commercially available?
@the_mastermage
@the_mastermage 13 дней назад
How about D?
@Master120
@Master120 13 дней назад
​@@the_mastermage i guess D already exists e-e
@IamPyu-v
@IamPyu-v 13 дней назад
and cuz B is interpreted
@JohnDoe-np7do
@JohnDoe-np7do 13 дней назад
Every now and then i rmb D is a language 😂 dont get why its basically unknown despite being easy & decent
@colemanroberts1102
@colemanroberts1102 13 дней назад
​@@JohnDoe-np7do I feel D doesn't have a natural niche or compelling features. D's sweet spot is between c++ and java. "C++ with GC" or "native code java". But C++ has accrued features like reference counting, and java has jit compilers now.
@_morio
@_morio 13 дней назад
I’m a former frontend engineer and currently learning C, so this really resonates with me. As he mentioned, I can’t resist my inner drive to be a mastery, however inefficient it does feel like.
@beest_
@beest_ 12 дней назад
Hey Prime, what are your thoughts on SVG and HTMX . Use a SVG editor to design the page and all its elements, and have HTMX be the event handler
@stevenrosscarpenter
@stevenrosscarpenter 12 дней назад
The cool thing about coding on old hardware like a commodore 64 is that you store ram data in actual memory addresses that reflect spots the physical chip.
@XERAEN
@XERAEN 13 дней назад
G. K. Chesterton reference dropped, subscribe button slammed.
@rocapbg9518
@rocapbg9518 4 дня назад
"Assembly is smaller" spoken truly like someone who hasn't written a line of x86 assembly in their life.
@user-wb5xj7oq5w
@user-wb5xj7oq5w 13 дней назад
why did prime flashbang us at the end for no reason
@EdwinMartin
@EdwinMartin 13 дней назад
Twice!
@jerichaux9219
@jerichaux9219 13 дней назад
FBI OPEN UP
@coolbugfacts1234
@coolbugfacts1234 11 дней назад
light mode is superior to dark mode, that's the truth people aren't ready to hear. Linus Torvalds, Dennis Ritchie, Brian Kernighan, Bram Moolenar, all light mode users. On the other hand, Rasmus Ledorf, creator of one of the worst languages in existence, dark mode user.
@coder_foo
@coder_foo 7 дней назад
The most fun I have programming is writing C for microcontrollers. There's something about poking bits around memory and they actually live right where I put them. Generally I don't even use heap alloc, just allocating static blocks and using a simple memory manager. It's miles away from my daily work.
@Xe054
@Xe054 11 дней назад
G.K. Chesterton mentioned!
@woddenhorse
@woddenhorse 11 дней назад
"The more Control you have, the more Pain you have" dayumm real.
@taylorworthington9394
@taylorworthington9394 2 дня назад
I'm not a programmer yet, but I watch a ton of stuff about languages. Your way of talking about it makes the most sense to me. What is the deal the Rust's safety? Is it one of these overly abstracted things? How important is it really? I noticed Zig has 4 "build modes". Good? . . . Great?
@Dazza_Doo
@Dazza_Doo 11 дней назад
*Real Talk* How do you use Zig with Embedded/Microcontrollers ?
@albertoarmando6711
@albertoarmando6711 13 дней назад
there are useful, well crafted, abstractions. And there is Vercel and Next.js
@hansdampf2284
@hansdampf2284 10 дней назад
4:13 this. C _feels_ like it’s a direct translation of the assembly into a little bit more friendly and universal language. But in reality we got caching, pipelineing, branching probability dependent pipeline prefetching, hyper threading etc etc on top of that we have compiler optimizations In reality much much more is happening under the hood, that is abstracted away into a black box so the cpu acts like we think it should.
@ravenecho2410
@ravenecho2410 2 дня назад
Lmao, i imagined having myself programming my current problem with gates and i chuckled 😋
@victorpinasarnault9135
@victorpinasarnault9135 13 дней назад
Take Zig and Rust togheter.
@MECHANISMUS
@MECHANISMUS 13 дней назад
There must be a psychology thing to the level of abstraction you prefer too.
@ryanskeldon
@ryanskeldon 12 дней назад
People just have varying levels of concern for the value of their time.
@thisbridgehascables
@thisbridgehascables 8 дней назад
I started watching about C. It’s interesting to learn the foundation to these other languages. Kinda provides you context to what has been developed to give you better methods, less complexity..
@NeverSuspects
@NeverSuspects 9 дней назад
When you were talking about how tiny and how difficult it is to make mechanical watches, optical lithography for modern cpu production came to mind and seemed pretty hard too. .. soooo tiny
@eppi6328
@eppi6328 13 дней назад
what a way to start a video
@funkdefied1
@funkdefied1 12 дней назад
It sounds like the abstraction level he likes the most is “memory and logical operations”
@Nickps
@Nickps 13 дней назад
10:22 You gotta love how in the list of features that C++ has and C doesn't, he put designated initializers which were ported from C99 to C++20. C did that first bro. EDIT: char8_t is in C23. Another not C++ exclusive.
@isodoubIet
@isodoubIet 13 дней назад
Noooo don't let facts get in the way of luddism
@atijohn8135
@atijohn8135 13 дней назад
I also love how he brought up C++20 ranges, when Haskell has had this concept for decades, and I'm pretty sure it's been there from the early versions of Rust.
@Nickps
@Nickps 13 дней назад
Man the lists in the background are a fucking disaster. "Named after a logician" is a bad thing now? Also, pointer sized integers are a Rust thing? Is intptr_t not C anymore?
@Nickps
@Nickps 13 дней назад
​@@atijohn8135 I'll have to admit I didn't know that but I'm not surprised. That part of the video has so many things wrong with it I can't understand how it got made.
@kokoinmars
@kokoinmars 13 дней назад
People thinking C is the perfect representation of the machine should look up microcode, and as primeagen says, compiler magic.
@vilian9185
@vilian9185 13 дней назад
>look up microcode so...C?
@Heater-v1.0.0
@Heater-v1.0.0 13 дней назад
Does anyone with a brain actually think that? C was created as a way to enable rewriting of Unix from assembler so as to make Unix portable to many other architectures. So immediately we see that C is a kind of minimalist abstraction that can work efficiently over many instruction sets. Further to what you say even assembly language is not a perfect representation of the machine the code runs on now a days, it knows nothing of the caches, pipelines, multiple dispatch, branch prediction, instruction reordering and other magic that may or may not be happening on the machine it's running on.
@psteven5
@psteven5 13 дней назад
most of the compiler magic for C is optimization, although there are still some abstractions that are not 1 to 1 mappings, but if the optimization magic was removed and the code were to be compiled literally, it would still work the same (although it certainly helps to have programmed in assembly for that understanding)
@Heater-v1.0.0
@Heater-v1.0.0 13 дней назад
@@psteven5 That is true. However I have heard many old hand C programmers complain that "compiler broke my code". Which basically means they were assuming C is much closer to the generated code and machine than it actually is. Which is to say they had undefined behaviour in their code that worked for years or decades until some new optimisation broke it. Changing optimisation levels can certainly change the behaviour of ones code in the face of UB. I'm guessing it was a long time since they learned C and they relied on compiler behaviour to guide them rather than studying the C standard specification as it has been refined over the years.
@0xD1CE
@0xD1CE 13 дней назад
Microcode is just an implementation detail. The CPU still has to fetch and decode instructions we're familiar with before it breaks it down into micro instructions.
@stegwise
@stegwise 13 дней назад
what book is that at 1:12?
@allliver123
@allliver123 12 дней назад
rust has an insanely nice package manager that bundles everything up nicely AND includes all dependencies, but adds heaps of abstraction c has no package manager, and you need to do slightly more complex builds on top of installing libraries just to get a binary, but it lets you have lots of control both are a double edged sword, there is no one programming language that can do everything flawlessly because there is no perfect language, and either way you are going to make sacrifices
@usercommon1
@usercommon1 9 дней назад
Prime's body is a machine which turns 3 min video into 13 min video
@grifferz
@grifferz 13 дней назад
What should I be inferring from the fact that the only representations of themself (?) that they put in this video are an anime avatar and someone wearing nitrile gloves with taped shut boiler suit sleeves to accomplish basic tasks? I feel like interacting with this person will lead to waking up naked in a basement chained to a metal pipe.
@dipi71
@dipi71 12 дней назад
I'm of 2 extremes: Ruby for complex object-basedness (not mererly OO); and clean C for compact UNIX-like CLI tools, as well as the occasional Ruby-hot-spot speedup. GDB, the GNU debugger (and the Godbolt website) brings it all together for me: it lets me single-step through the produced assembly code. Beautiful.
@freesoftwareextremist8119
@freesoftwareextremist8119 12 дней назад
Understandable. These days I just write everything in Lisp, using C when needed, like interfacing with the system or libraries.
@TimepieceMaster
@TimepieceMaster 13 дней назад
2:20 Said another way, you'd have to be a TimepieceMaster. ;)
@houcemkabboudi
@houcemkabboudi 7 дней назад
The points in the video are fair and well elaborated. As a programmer and an artist I say it feels good to go back to simpler things (but not always for me). People who hate on other languages for no reasonable argument are the worst. I am currently using JavaScript mainly but I enjoy using other languages and have used them on different projects. So far I've used JS (and TS), C, C++, C#, Java, PHP, Python and even Assembly (had too much fun with this one). I really liked (and disliked) some of them but if anyone asks me why would I use a language over another for a certain project, I believe I have the minimum required knowledge to have a fair judgement and give a good reason. People just need to remember: they are all tools and all tools come with good and bad things.
@KingBobXVI
@KingBobXVI 19 часов назад
7:30 - on the whole thing with Zig and the ?*var syntax to denote a pointer as "could be null"... ...that's just the difference between pointers and references. C++ has this feature, pointers are pointers that can be null. References are pointers that, for all intents and purposes, are non-null.
@Brian-ro7st
@Brian-ro7st 13 дней назад
One of the things I dislike about the move away from exposing pointers to the programmer is that data structures where pointers are the most natural representation, like linked list and trees, actually become more confusing. This is one of the areas where I think go really excels. I honestly don't think I fully comprehended the link list until I implemented them with pointers in go.
@rdubb77
@rdubb77 12 дней назад
Or you can just implement a linked list in C.
@Brian-ro7st
@Brian-ro7st 12 дней назад
@@rdubb77 Yeah, obviously an option.
@rdubb77
@rdubb77 12 дней назад
@@Brian-ro7st that’s how I learned pointers well. It really helps with the concept of needing a pointer to actually change data itself as opposed to just reading data or changing a copy
@evandrofilipe1526
@evandrofilipe1526 10 дней назад
Implementing linked lists in lisp is also natural
@BaldurNorddahl
@BaldurNorddahl 13 дней назад
C is not assembler. People think it is without realizing how much you can't actually do in C. I once wrote a compiler that generated assembler code, that couldn't be replicated in C. It was just a different calling convention but that is enough. Also the amount of optimization that occurs is crazy and the generated code might be fairly different. Finally other languages, such as Rust, actually generate assembly that is equally close to the code as C does.
@pavelperina7629
@pavelperina7629 11 дней назад
Yeah. Other example are intrinsic instructions such as AVX.
@75hilmar
@75hilmar 13 дней назад
Nike - Just do something 😂
@darkferiousity
@darkferiousity 11 дней назад
So I was really interested in learning machine language and it is interesting to me that it reminds me somewhat of languages like spanish and german that the opcode changes based on certain circumstances it is really beautiful you wouldn't rrally understand why in certain areas the assembler generated what without context. I believe context is huge helps understand what is really going on.
@RonyBatistaInoa
@RonyBatistaInoa 12 дней назад
Mechanical watches are the graphql of timekeeping
@ethanbuttazzi2602
@ethanbuttazzi2602 5 дней назад
3:55 now that just a skill issue, i use C# but i go out of my way to know how every most of it works, how the CLR handles the IL etc, i scoured the documentation for a lot of time until i could understand what i wanted, i went deep in a lot of parts, safe for how does the CLR compile the IL into machine code cause for me going that far isnt nessesary, if you are using something but dont dive in, of course its gonna be a big black box.
@movntn
@movntn 13 дней назад
GK Chesterton mentioned
@gnagyusa
@gnagyusa 10 дней назад
I went from machine code to assembly, then C way back and never got into the newer toy programming languages. I want to focus on solving the actual engineering problems instead. I always thought that wasting so much time on the latest shiny programming languages was like focusing on the telescope instead of the stars and galaxies you were supposed to observe.
@woolfel
@woolfel 12 дней назад
I don't like or wear watches, but I appreciate the level of art and craft.
@zwerko
@zwerko 13 дней назад
09:28 - Spoke like a true quiche eater!
@astral6749
@astral6749 13 дней назад
I love C. I don't use it in practical applications, but it's very fun to use in easy to medium Leetcode problems.
@guilhermeandraschko
@guilhermeandraschko 13 дней назад
Primeagen just got pumped bc the guy is pumped. 😂 jokes apart, it’s nice that we have different programming preferences bc we need this, we need different communities exploring different problems, imagine if everyone is playing javascript from now on, what happens with all other projects that is more suitable to other languages? Embbeded systems, OSs? So, lets celebrate the “diversity”
@mathiasbttger980
@mathiasbttger980 13 дней назад
I think a grand goal comprised of smaller goals is the golden medium
@tomzimny7408
@tomzimny7408 13 дней назад
I love mechanical watches. It's awesome to see an old German man putting tiny, fragile pieces together to make something we take for granite (pun).
@jareddunlop8411
@jareddunlop8411 11 дней назад
I cracked and went to C (definitely not c++), because it allows me to learn, but also I realize there are a lot of gotchas with it. So, it makes a great learning and exploratory language, but it seems like a terrible option for actually building stuff. A great discovery and prototyping or proof of concept tool, but building I think the abstracting those gotchas away, after you are aware of them is what you want. The concern and critique of the video, is that, yes, if building something yourself, it is probably more enjoyable and satisfying. When other people are potentially going to change your stuff, you work on a team, that all introduces a lot more variables and levels of complexity that I think make C not the best tool for that type of scenario. Not that a team can't build in C, but it would probably require a whole different model of collaboration than the tools made with that in mind like it sounds more modern tools are like Zig and Rust (Neither of which I am familiar with, especially not Zig yet, but I like pointers, so who knows)
@mauricioprado6395
@mauricioprado6395 13 дней назад
the primagen life and professional takes are always from the point of view of a well versed, smart and lucky man. those doesn't apply for all people following.
@luserdroog
@luserdroog 13 дней назад
You should run through some old classic tales like the Story of Mel.
@amn3siacx
@amn3siacx 13 дней назад
it’s a mazoterica harmony
@danielvaughn4551
@danielvaughn4551 13 дней назад
the bit about white paper was a solid joke
@jerichaux9219
@jerichaux9219 13 дней назад
Haven’t gotten there yet; were we talking about the 8 people using Haskell again?
@jerichaux9219
@jerichaux9219 13 дней назад
Just got there. BOOM, called it!
@chonwhite
@chonwhite 13 дней назад
With great power, comes great trouble.
@ArturdeSousaRocha
@ArturdeSousaRocha 13 дней назад
With great power comes a great core dump.
@kahnfatman
@kahnfatman 13 дней назад
I hope my May won’t die when I’m endowed with such power.
@Amy-601
@Amy-601 13 дней назад
Multi Core! Boom 💥! - Amy
@science_trip
@science_trip 12 дней назад
I will try again zig when it will start to be stable and not provide braking changes in every single sub version. When I m building products I need stability. the other are just experiments
@arimill1045
@arimill1045 13 дней назад
Still think C + zig build tools is the best combo
@martinmusli3044
@martinmusli3044 13 дней назад
„Giving yourself more control, but it comes at a cost of time“ Uses NeoVim and writes own Plugins
@potato9832
@potato9832 12 дней назад
Just wish C had some new features: namespaces, better built-in memory tools, auto pointers, type aware macros, automated #include guarding, pre and post handlers bound to procedures, etc.
@niggacockball7995
@niggacockball7995 11 дней назад
And functions inside structs (void pointers dont count)
@hellowill
@hellowill 11 дней назад
Interesting, I prefer going the other way. I.e. starting with Math and REDUCING the abstractions, i.e. functional programming. That said, it depends what project you're building and who you're building with. This video really only applies to hobby projects where you have control over those things.
@shanehebert396
@shanehebert396 13 дней назад
I think that C's influence on hardware has been underestimated, as well. Look at the 8-bit world and how those assembly languages are architected. Then when you get to 16-bit and later (remember, C came about in the 1970s) you can see, even in extended ISAs like the x86, how instructions and architecture were added that can arguably be at least in support of C, if not more directly influenced. Then get to the load/store architectures and see how well their assembly languages and architecture map to C.
@robinmaibals1193
@robinmaibals1193 12 дней назад
He's so afraid of exposure that he's treating this like he's living in a nuclear fallout zone.
@AloisMahdal
@AloisMahdal 13 дней назад
I'm at 0:00, looking forward to seeing Prime's reaction to the video, which I believe is called "Why I don't Use Zig"
@JoeStuffzAlt
@JoeStuffzAlt 10 дней назад
That's one thing I dislike about some platforms. Because of the framework switching, it's hard to really become the master of one
@TobiasSample
@TobiasSample 11 дней назад
5:58 watch the clock tick as the pendulum swings
@hindsightcapital
@hindsightcapital 4 дня назад
Haskell mentioned lol
@Bp1033
@Bp1033 13 дней назад
I got good at C and it made me pretty good at every other language I found out. Because I played "the farmer was replaced" and accidentally learned python in like an hour.
@This_Account
@This_Account 12 дней назад
Any programming language is better than web server config files. Even debugging isn't the same because the feedback is invisible until you check.
@sdwone
@sdwone 12 дней назад
The Grand Daddy of pretty much ALL modern languages! All hail C!!!
@0xO2
@0xO2 10 дней назад
Yes, CPUs are complex blackboxes. Programs segfaults without just memory barriers in particular place in assembler code...
@AntiCookieMonster
@AntiCookieMonster 12 дней назад
I spent more time fixing broken debian installations than arch ones, so I don't know about that time saving thing. If you don't want to customize it that much just install Gnome DE and be done with it. 90% of it will work out of the box. The missing 10% I don't care to fix, because I never use.
@MrAbrazildo
@MrAbrazildo 5 дней назад
9:45, I would say that this is C++, compared to C. Kind ugly on a 1st glance, but offering plenty of tools, still precise. Higher level ones would be an electronic canvas, with a gross line, loosing drawing area as a supposedly necessary price to pay for the technology. C is like the spaceship used to go to the Moon: 1 can deeply admire it and its achievement, but he/she should also realize that it would never reach Mars.
@0x0404
@0x0404 10 дней назад
I prefer C. But I do want more. I want classes and inline closures. Swift gives me those but makes you jump through too many hoops to use pointers. C++ gives me those but the closure syntax is a mess. JavaScript gives me those but the prototype syntax is tedious to simulate classes but it probably has the most transparent closures.
@DMSBrian24
@DMSBrian24 11 дней назад
I agree that C strikes a good balance between knowing what the computer really does and being able to program it efficiently. But yeah, obviously there's a ton of compiler magic, there's the abstraction provided by the OS itself, there's crazy hardware optimizations, there's crazy CPU firmware optimizations, there's even non-deterministic neural branch prediction. But we can't un-abstract those, this level of complexity is still required for current level of performance. While in case of a lot of languages, abstraction causes loss of performance, so C strikes the right balance there as well.
@DMSBrian24
@DMSBrian24 11 дней назад
And yeah, languages like Zig or even Go are in many terms direct improvements over C. Zig doesn't really abstract anything away, it just provides developer ergonomics, means to understand the code better by just reading it, for the most part it doesn't physically prevent you from shooting yourself in the foot but it more or less makes it very clear when you're about to do so based on those features, those features aren't abstractions though, it's just syntax coercion. When it comes to Go, obviously it does abstract quite a bit but not in a way that's incomprehensible and in a way that might not fit all problems but it fits a large class of problems exceedingly well without much performance sacrifice. Same with Rust, though it does take its syntax and preprocessor coercion quite far, to the point where it's easy to forget about the underlying hardware/OS interactions.
@exotic-gem
@exotic-gem 13 дней назад
I love C, it’s the best language to me ! Rust is interesting though, mostly because giving more information to the compiler enables more powerful optimisations… but I think C could add similar things, and become way more powerful than Rust in the end.
@pierreollivier1
@pierreollivier1 13 дней назад
I don't think it can, and I don't think it will, C doesn't break, and the reason Rust is able to give more information to the compiler is because the language semantic is richer and more detailed. Changing C such that it could provide that kind of information would break a lot of things.
@vwheukfvf
@vwheukfvf 13 дней назад
Why hear?
@evandrofilipe1526
@evandrofilipe1526 10 дней назад
That analogy with the paper kinda sucked IMO. Sticking with it, I think lambda calculus would be the pen and paper and using Asm would be more like using all of those unnecessary utensils
@nevokrien95
@nevokrien95 13 дней назад
I LOVE c its the best. I am writing a compiler for a toy lang right now.
Далее
You're A Furry If You Use This Linux Distro
24:33
Просмотров 113 тыс.
LeetCode Isnt Real | Prime Reacts
29:04
Просмотров 162 тыс.
ОНО СУЩЕСТВУЕТ?? #shorts
00:19
Просмотров 1,3 млн
МАЛОЙ И РЕЧКА
00:36
Просмотров 277 тыс.
zig is the future of programming. here's why.
9:34
Просмотров 222 тыс.
Single Language Productivity Is Fake
41:06
Просмотров 182 тыс.
What Does Your Editor Say About You | Prime Reacts
22:12
The Plight Of Cobol Mainframe Programmers
29:15
Просмотров 185 тыс.
The Most Amazing Software Ever Created
20:02
Просмотров 301 тыс.
it's been a rough week for microsoft...
10:22
Просмотров 258 тыс.
1000 Players - One Game of Doom
15:42
Просмотров 137 тыс.
Scams In Software Engineering
31:44
Просмотров 570 тыс.
Main filter..
0:15
Просмотров 10 млн
С iPhone точно не укачает!
0:41
Просмотров 465 тыс.
#miniphone
0:16
Просмотров 3,5 млн
#miniphone
0:16
Просмотров 3,5 млн