Do you ever plan on learning another more modern language, like Rust, Go or Zig? I'd find it interesting what you think of them after 2 years of C (also you mentioned Haskell at the end)
"Is simplicity better?" Simplicity is the final achievement. After one has played a vast quantity of notes and more notes, it is simplicity that emerges as the crowning reward of art. -Chopin
Yes. It's easier to refactor/refine a simple program than a complex program. Simple first. Always. Premature complexity is a disease experienced by Enterprise developers.
@@PhilipAlexanderHassialis I also enjoy saying "premature abstractions" which is related to "premature complexity" given that abstractions are often correlated with complexity. You have my blessing to spread the word. Overly abstracted and overly complex code have been the bane of my programming existence. Not to mention all the proselytizing I've had to endure from holier than thou self-important coders quoting programming proverbs as if they were etched on stone tablets from Mount Sinai. I'm quite sour about it all, really. I've joined the crusade to bring back simplicity, efficiency, and performance. Let's end the tyranny of the OOP group and their abstractionalist devotees.
@potato9832 If you want to see the epitome of overabstraction, check out OpenAI’s Python module. their boilerplate code didn’t work out of the box, so I had to go digging through 30 layers just to find out what the hell I was actually working with. It’s codebases like that which showcases the true horrors of OOP.
Programming in low-level as a whole is fun because what you do is what you see, usually. I always liked memory management, and in these languages you can directly interface with it and snoop around to see what is working and what is not.
I come from a .NET background, but I’ve been learning C for a few months now. I’ve learned more about C# these last few months because I finally understand how things work. Getting a basic understanding of memory allocation and pointers made me understand how badly I’ve written C# and Java code in the past. I’d reccomend everyone to learn a language without a Garbage Collector for that reason
4:05 this happened to me the first time I had somebody explain to me how to _actually_ implement a state machine. I knew in theory how they worked, but it always seemed abstract to me. After that I understood that the whole point is to build your own stuff.
Is it really like that? I do feel that way about C++, but I always thought C was simple enough that a student could learn every aspect of the language in a single semester.
What blew my mind was this: typedef int FunctionType(int); FunctionType myFunction; Now myFunction is a function that takes an int an returns an int. Typedef's can alias function types, and you can use them in a function declaration. What's even crazier is that there is a use case for this, Tsoding Daily made a video about it.
@@fullaccess2645The use case (callbacks) exists in virtually every common programming language. It's just that the syntax for it in C is a bit weird. In C++, you can do it either this way, or two other ways which are not mutually compatible (struct which overloads operator() or std::function).
@@ruanpingshan Maybe not every aspect but certainly a lot. we learned C and then C++ in the same 1 semester course. it was a pretty intense course. but my knowledge of C feels a lot more complete despite it taking up less time.
I am currently learning the ropes of Zig, and have been looking for a practical application to learn with. My typical "goto" project type to practice with is implementing some serialization/serialization format or a basic 3D voxel game, but implementing an interpreter seems like a great learning exercise, for both the language I am trying to get familiar with, and interpreter concepts.
// Greeter class class Greeter { public void greet() { System.out.println("Hello"); } } // Hello class inherits from Greeter class Hello extends Greeter { // world name private String worldName; // constructor public Hello() { this.worldName = "world"; } // getter for worldName public String getWorldName() { return worldName; } // setter for worldName public void setWorldName(String worldName) { this.worldName = worldName; } @Override public void greet() { System.out.println("Hello, " + worldName + "!"); } } // HelloFactory class to create Hello objects class HelloFactory { // createHello method to create Hello Objects public static Hello createHello() { return new Hello(); } } public class Main { public static void main(String[] args) { // Use the factory pattern to create a Hello object Hello hello = HelloFactory.createHello(); // Set the world name hello.setWorldName("world"); // Print the greeting using the getter hello.greet(); // Output: Hello, world! } }
Lightspped C on my 512K fat Mac (which I converted from 128K by soldering in denser memory chips) was my best new language experience ever. Lightspeed C with its integrated IDE (I coupled it with Macbugs MC68K assembler/monitor) was a Turbo Pascal experience for Mac programmers. Very affordable and as a C compiler there was no limitation as to programming task that could be undertaken. And at that time C was barely older than a decade so it was still THE programming hotness across the industry.
Whatever job you end up working on whatever project - these kind of projects is the best upgrade to ones skills! Especially if you are a beginner! Good you show this guy off here!
the promisse of increased productivity when compared to something that is generaly percieved as unproductive had an inverse effect to where a thing that is generaly percieved more productive became less productive and less productive became more productive
A lovely journey, I like of this type of "studying", he choose C and don't give up because of opinion of people... this guy became a great engineer!! Only the music that feel me sad!
"Is simplicity better?" Complexity appeals to stupid people. Most people think "If I can't understand something, it must be better than what I can understand."
The best part of C is the language has so few things its really easy to get into a flow state with it. The worst part is you have to hand-roll *everything* yourself. A corollary of that is all the useful libraries people have made are generally awful to get into your build cause nobody agrees on build systems. Also automake and autoconf are the worst inventions ever. They are only step above writing DNS zone files by hand. This means you end up having to always reinvent libraries AND build systems. Point is, C as a language in a vacuum is great. Its the stuff around it that make it awful.
The thing with segfaults is that even in other languages these would be bugs. The would just come up as IndexOutOfBoundsException or NullPointerException (excuse my Java).
Except with segfaults you are lucky if it is actually a segfault. It could also read random other memory from the process and keep going with fucked up data.
@@andrejsk6211 In practice this is almost immediately obvious, because there's no safety features that'll enable the language to keep going semi-correctly with garbage input. It'll just shit itself and die, perhaps not in the place where the issue originated, but pretty close. I've written almost every single weekday C++ for over a decade. Memory issues that actually caused me to really stare at the screen for hours can be counted on both hands.
11:54 Thats not a language problem its a cultural problem I have noticed with all the Java devs I have ever worked with ... over engineering to the point of ridiculousness. They are the kings of code bureaucracy the Vogons of programming. And their code has the same aesthetic qualities as Vogon poetry.
@@0x1EGEN Its not the language its the developers, their culture and the way it affects the way they write code. I have never worked with COBOL developers but I would imagine there are a lot of practices that are in place with good reason given the systems that still exist which are written in COBOL.
@@sacredgeometry In the case of COBOL, it's not the devs that are bureaucratic but the language itself was literally designed to be. It's like filling out a form when populating each divisions. And since it has become so engrained into our financial systems with billions (yes billions) lines of code, it's nearly impossible to replace. But hey I guess that also means solid job security haha.
@@CoderDBF Nothing. C can do whatever COBOL does. But C wasn't around as long as COBOL and that's the reason why our backbone systems weren't written in C. If we were to rewrite everything, it wouldn't be in C but in a much safer, stricter language, Rust perhaps.
If you keep mentioning HTMX and how great it is, my webdev professor is going to climb through your computer screen and scream at you to have a very wonderful Christmas. Because I'm over here listening to lectures on the tag and asking questions about AJAX requests and IDK what he thinks about that. The answer I got was "you're not really going to need anything AJAX in this class." I'm going to start asking things about WASM any day now, and I fully expect to get exactly 0 answers. Also, I think it's the mark of a good tool that the more you use it, the more you like it. For some reason, C is just such a tool. I don't know if it's Stockholm's syndrome, and I'm not sure that I much care at this point.
I think his comments on productivity are less about C s Java and more a product of what happens when you stop and learn a new paradigm. Learning new approaches by writing real-ish code outside the constraints of an existing codebase and language can be enlightening.
That was a good video.and a good reaction. C for the longest time is always been my go-to language. I'm trying to transition my go-to to c++ just to be able to add some objects but I prefer not getting too wild with OO, except where it simplifies implementation and maintenance.
just skip on the OO all together it's not worth it. function overloading and templates are nice thoguh. But don't overdo templates, they can kill your compile times.
00:04 Journey from clueless to relatively okay in C programming language 02:46 Java is too slow 05:28 Casey was one of the biggest streamers on Twitch in the Science and Tech programming world. 08:20 Define and use your own versions of SSR and CSR 11:11 Java programming was slower than C due to extensive planning 14:09 Created a base layer for an application without using libraries 17:01 C is a favorite language and simplicity can be nice 19:49 Using C for programming can lead to a shift in thinking and improved software development
on the promise of that "increased productivity from language tools", I'd liken it to a kitchen full of gadgets and gismos - most of the time you can get the job done with a good, sharp knife and a cutting-board - a few good basic tools, that are all completely familiar and quickly to hand, rather than 100 single-purpose gadgets that you have to read the manual every time and come with the overhead of extra cleanup at the end...
17:50 (Speaking from the perspective of someone who spent over ten years with C++ and dropped it a couple of years ago.) When I see those C++ projects where 80% of the commits are just fighting the language quirks and/or adding yet another layer of abstraction, turning the codebase into a convoluted "metaprogramming" mess, I wanna cry and tell the people "C'mon, guys, please, PLEASE, stop it, you've just literally spent a thousand lines of code to do one damn thing that realistically needs fifty lines of pure straighforward algorithm, not to mention your abstraction will be used in one freaking place!" Sooo... Yes, I believe simplicity is often better. Do stuff in a simple way and add complexity only when it's needed instead of being a smartass.
Is simplicity better?! Yes! I love C I adore Zig and Rust after about 2 years on and off I’m getting used to C++ after 23 years I still feel a bit lost at times - especially stl templates. I love small languages and simple syntax. It makes you actually focus on the smaller problem to solve (you have to) and that discipline also makes you understand the problem all the much better. Where in higher languages you tend to take bigger problems and actually creating some convoluted code as a result, those simple languages force you to chunk that problem down even further.
@19:50 Templates are typechecked glorified macros. Are they worse than templates and similar metaprogramming techniques? Yes. Is it fundamentally different? Eh... not really.
@@isodoubIetThey both take literal input and generate substituted code which is then compiled as normal. It's not like erlang metaprogramming where they generate ASTs. C++ templates have expanded on that over time but their original form was little more than type matched macros.Feel free to go back to pre-standard C++ and play with them. Working with POD vs not was a mess. I use them regularly in retro development (ARM C++ 1.11, compiler by Norcroft). Over time templates were found/made to be Turing complete (I have had people who worked for me with PHD thesis in C++ metaprogramming and have their libs in Boost). They diverged more and more but they are still both code generation tools. Templates are first and foremost... a template. A macro is generally used as a form of templating. Functionally they are very similar. Typed and Turing complete don't really make it "fundamentally different" in practice.
I'm doing the same thing that this guy is doing, plus as I'm developing things in C, I'm rewriting everything in Zig, so that when zig is production ready hopefully I can lend a job that has a zig component into it.
@melonhusk562 Good things take time, but there's a need for a C replacement, wether it's rust, or zig, doesn't really matter. But surely old C codebases will eventually pick a language to migrate their unsafe/unmaintainable C code to more modern languages.
Another thing that is fun to write besides quaternions is writing Fast Fourier Transforms (FFTs) and their inverses as well as ODEs (Ordinary Differential Equation) solvers.
every programmer worth his salt should know C, every Computer Scientist worth his salt should know assembly. Period, point blank. Oh no, not C++. Not Objetive-C. I mean C when I say C.
Sounds more like an excuse/justification to not do this yourself than an observation about "this guy" or "why it works". If you can understand any high level language, then you also have the intellectual capacity to understand C and arena allocators. And while it's true that it takes time to learn something new, it's time spent expanding your toolset in a way that makes you a better programmer in any language. An obvious benefit. Sure, your employer/manager/lead might disagree, but then they don't understand that it's shooting yourself in the foot not to do it - which means they're also shooting the company's interest in the foot. I fail to see good reasons not to do it.
@@Muskar2 Yes and then there is also attention span and spacial Imagination. You can train those only so much, maybe at some point you find a way to break things down and it gets easier, but there is no guarantee.
@@75hilmar Sure. I have a close family member who has very limited intellectual capacity (ICD-10 F71), and they've been an extremely slow learner their entire life - so I do believe some things can't be changed - and there's certainly _some_ variety in who has an easier time learning than others. But you won't know what applies to _you_ until you try, that's my point. Arguing generally is typically an excuse. If you're passionate about software development then I think it's worth trying. The only good reason not to do it is if you've already tried really hard in many different ways and just can't find a way to enjoy learning about it. Perhaps you need a mentor that will inspire you or something. Moreover, if software development is just a way for you to make easy money, and not something you actually care about, then I think perhaps you'd just be better suited in another field. Or perhaps you're just not in a good mental state in your personal life and you've been neglecting that. Etc. Good luck!
@@75hilmar attention span isn't infinitely trainable, but it is almost infinitely controllable or at least manageable. If you were locked in a white windowless room for 6 months with only a computer with a text editor and clang and a copy of K&R, you would learn C. Attention span is useful for avoiding being distracted by distractions, but you can also avoid being distracted by just removing all distractions from your environment. Try it. You'd be surprised how efficient you can be when presented with only two options: be productive, or stare at a wall.
4:20 "For me this gave me the confidence to look at everything." I agree 100% with this mentality because I have lived the exact same thing. I did not get this revelation with Linked lists but with TCP Sockets. Once I succesfully implemented a ' ' functional ' ' chat app in C with low level TCP sockets, it openned my eyes and I realized that all networking, once you reach the Transport layer, is bsacially the same. You just change the port numbers, after that , the Docs, the SDKs, the libs and the RFCs are the only thung you care about. (99% of the errors you get are ERR_ADDR_IN_USE anyway)
@@ThePrimeTimeagen I am! Job is going great and I am having a blast exploring in my free time...doing edge machine learning to practice low-level. Still learning a lot from your content!
It takes far more than 2 years to become relatively okay at C It takes longer than 2 years to be relatively okay at anything [especially anything as old as C...]
Funnily enough, it's rust that's illustrated to me that you only really need structs. Lack of generics is annoying, but that's the only thing really. You don't need inheritance, and you can basically still have OOP, classes are just syntax sugar. Its a bit more verbose going `void method(MyStruct_t *self, Arg_t arg)` rather than something like `fn method(&self, arg: Arg)` but you can get away with it if you need to. Also you can have your C code run on a GPU with OpenCL (if using a subset of the language) and GPU segfaults are extra fun because they sometimes crash your graphical session :) (ideally compile with gdb first for initial testing).
"Its a bit more verbose going `void method(MyStruct_t *self, Arg_t arg)` rather than something like `fn method(&self, arg: Arg)` but you can get away with it if you need to." Classes are not for syntactic convenience. They're there because they satisfy useful invariants.
@@andrejsk6211 Like for example imagine you have a class representing a sorted collection of numbers. The class author provides a member function insert that takes an element + some iteration functionality. You can now safely binary search over the collection, etc. The "invariant" here is the property that the numbers are sorted, which should hold from the instantiation of the collection until it is destroyed. As long as you can argue that each member function does not break that invariant, you have basically proved that those invariants hold throughout the lifetime of the program for all instances of this class. This is very powerful and greatly simplifies reasoning about the system. You can also make changes to the underlying representation of the collection. You can start from an array for ease of implementation then move on to, say, a b tree, without breaking anybody's code since all they care about are those invariants you guarantee in your API. Conversely, imagine that instead of a class you just have a simple struct. Now everyone that uses the struct has access to its underlying representation, which means they can do to it any operation they can do to an ordinary array. This means that if you want the elements to always be sorted, you must now verify that this is true for every single time the struct is used, anywhere in the codebase. Realistically, this is impossible. Further, because everyone has access to the underlying representation, you no longer have the ability to change it in the future. So for example if you find that a b-tree would perform faster for your use case instead of a bare array, well, tough luck, you have to hunt down every instance of the struct and make sure nobody's relying on parts of the array api that wouldn't also be present for the b tree api.
That slowing down in higher languages is something I too experienced, too many choices always googling what function to use and what structure to adhere too. Whilst in C and assembly I knew there’s no function to do something already so I hack it together myself. And yes it’s more work but soon you have a body of your own functions that you just use in other programs and you are quick. The thing is that is GenXers generally grew up from basic to assembly to C and higher languages. We are used to the details and complexities and this trivial. I can’t solve myself into Millenials and certainly GenZ who never have had the luxury of known this simplicity. So I can’t imagine how they look at problems. I immediately see the electronic components or low level code pop in my brain when there’s s problem we need to solve. And it’s easier to abstract up than down I guess.
@@ThePrimeTimeagen As an alternative may I suggest checking out "Doom on NES!" by TheRasteri. Not running *on* the NES but *through* it in a clever way.
"Is simplicity better?" Yes. As for your reaction about C processor programming - why? Is it because it makes you uncomfortable, or because there's an actual measurable, objective thing that can be pointed to and said "Bad"?. Templates are just doing the same thing, just in a more hidden fashion. If the argument he's making is that he's just writing one set of C macros and then using them forever, and nobody ever needs to look at the code to figure out what it's doing, then it's not meaningfully different than using template code and never examining the compiler source to see what it does. The concern is in reliability - template code in compilers is tested by millions of people, the C-macros he wrote obviously aren't, but that's only a problem when there's a bug. If there isn't - and there's no more likely to be a bug in that code than in any other piece of code - then they're fine. He does point out that debugging them is harder, but while debugging is a substantial part of programming, you should in theory be debugging each piece of code once - that is, until you figure out what the problem is, and fix it. You pay compilation time *every single change*. Template compilation time is horrendous. Shorter compile times make iteration times much faster, which means much more productivity. A good macro library will save you astronomically in the long run.
There is a reason that if you don't want to program with machine code or assembler you use C or maybe C++. C is extremely powerfull but more difficult than 'higher languages'. Even then it is still a far cry from the difficulties of programming wihth Assembler or Machine Code without to many compromises.
I'm so jelly of jai beta testers. I'd love to try it. But I'm not sure I want to meet the requirements of figuring out how to get in. Especially not if it requires sucking up to JBlow in his streams, listening to him being a grumpy lone wolf who assumes the worst of other people - even though he does stream interesting coding problems.
@@Muskar2 He is just looking for people who will use the language and aren't beginners (it isn't super beginner friendly). He mentioned this in some stream, and someone clipped it, so you should be able to find the clip. I just sent him an email asking to join, explaining my experience, and what I plan on doing with the language. And I got lucky with the timing, and lucky in general, because a few days later I got an response saying I got added to the beta. There is no harm in trying. Worst case is that you get no response. You miss 100% of the shots you don't take.
@@m4rt_ Perhaps I should mention that I haven't been able to find the clip you were talking about, nor his email. I've only contacted him in stream chats and via Twitter DMs. So I'll spend a few hours looking for those things today.
C macros are better at compiling english to C than LLM-s. We are just not precise enough in expressing our intentions. It's not for the lack of trying tho ...
gcc errors are way better than msvc which is what this poor guy was using. I was dealing with a problem with code in MSVC, I didn't understand the error because it was a mess so I copied the code over to Linux and compiled with GCC and it told me exactly what the error was. Granted, this was C++ not C, but I imagine that the trend exists for all C/C++.
As a hobby C programmer I find C99, cozy most of the time. The segfaults until now always comes back to not doing the intended logic. I use a few macros like __line__ and __func__ and a debugger.
After painfully graduating from Uni in CS, I coded a few Lua games following tutorials. Every time that I try to do a nice project all by myself, I end up stuck alone and helpless and unable to progress and frustrated.
That might be a sign that you need to learn programming in more depth. The problem with programming is if you don't understand a small detail it can be very hard to work with. My recommendation is learn each feature in isolation before you use it. Don't give yourself opportunities to miss-interpret anything. Lua is a scripting language. It's good for learning the basics but it won't teach you more than that. C teaches all you need to know and it's very small like Lua. Pointers can be hard to wrap your head around though.
In my defence, I blame minecraft for making me learn java
Man don't blame others for your wrong choices... its a joke, you made a great video!!
That’ll do it. Good job repenting for your sins
Do you ever plan on learning another more modern language, like Rust, Go or Zig? I'd find it interesting what you think of them after 2 years of C (also you mentioned Haskell at the end)
i blame runescape private servers =_= notepad.exe was all I knew how, press this compile.bat to compile, run.bat to run, don't ask questions
Be proud of Java. th-cam.com/video/ADqLBc1vFwI/w-d-xo.htmlsi=R77CNVEkDBRtFwT8
"Is simplicity better?"
Simplicity is the final achievement. After one has played a vast quantity of notes and more notes, it is simplicity that emerges as the crowning reward of art.
-Chopin
Yes. It's easier to refactor/refine a simple program than a complex program. Simple first. Always. Premature complexity is a disease experienced by Enterprise developers.
@@potato9832 heh, I chuckled. I will steal this "Premature Complexity" term :)
@@PhilipAlexanderHassialis
I also enjoy saying "premature abstractions" which is related to "premature complexity" given that abstractions are often correlated with complexity. You have my blessing to spread the word.
Overly abstracted and overly complex code have been the bane of my programming existence. Not to mention all the proselytizing I've had to endure from holier than thou self-important coders quoting programming proverbs as if they were etched on stone tablets from Mount Sinai.
I'm quite sour about it all, really.
I've joined the crusade to bring back simplicity, efficiency, and performance. Let's end the tyranny of the OOP group and their abstractionalist devotees.
@potato9832 If you want to see the epitome of overabstraction, check out OpenAI’s Python module.
their boilerplate code didn’t work out of the box, so I had to go digging through 30 layers just to find out what the hell I was actually working with. It’s codebases like that which showcases the true horrors of OOP.
I know I'm a year late but,...
"Simplicity is the ultimate sophistication" - Leonardo da Vinci
Programming in low-level as a whole is fun because what you do is what you see, usually. I always liked memory management, and in these languages you can directly interface with it and snoop around to see what is working and what is not.
I come from a .NET background, but I’ve been learning C for a few months now. I’ve learned more about C# these last few months because I finally understand how things work. Getting a basic understanding of memory allocation and pointers made me understand how badly I’ve written C# and Java code in the past.
I’d reccomend everyone to learn a language without a Garbage Collector for that reason
"Is simplicity better?" Well in the words of Terry Davis, "An idiot admires complexity, a genius admires simplicity." Gottem!
Well c`s simplicity creates complexity
@@goporororo7404 No. Bad programmers and computer scientists create complexity.
4:05 this happened to me the first time I had somebody explain to me how to _actually_ implement a state machine. I knew in theory how they worked, but it always seemed abstract to me. After that I understood that the whole point is to build your own stuff.
His channel is amazing. I learned Arena Allocator because of him. Amazing guy
You never stop learning C; you'll always find some other quirk in this "simple but not so easy" language
Is it really like that? I do feel that way about C++, but I always thought C was simple enough that a student could learn every aspect of the language in a single semester.
The following is legal C syntax:
struct S { /* ... */ } typedef T;
What blew my mind was this:
typedef int FunctionType(int);
FunctionType myFunction;
Now myFunction is a function that takes an int an returns an int. Typedef's can alias function types, and you can use them in a function declaration. What's even crazier is that there is a use case for this, Tsoding Daily made a video about it.
@@fullaccess2645The use case (callbacks) exists in virtually every common programming language. It's just that the syntax for it in C is a bit weird.
In C++, you can do it either this way, or two other ways which are not mutually compatible (struct which overloads operator() or std::function).
@@ruanpingshan Maybe not every aspect but certainly a lot. we learned C and then C++ in the same 1 semester course. it was a pretty intense course. but my knowledge of C feels a lot more complete despite it taking up less time.
Prime memes his way into actual life lessons.
Paused it while he's chuckling about "cross platform" java. I bet two quarters he's about to say, "Write once, debug everywhere."
Haha! Close enough. :)
“Just do thing rather than beat around the bush” perfect statement
I am currently learning the ropes of Zig, and have been looking for a practical application to learn with. My typical "goto" project type to practice with is implementing some serialization/serialization format or a basic 3D voxel game, but implementing an interpreter seems like a great learning exercise, for both the language I am trying to get familiar with, and interpreter concepts.
The Rust themed TH-cam channel "No Boilerplate" should make a sister channel for Java called "Just Boilerplate".
oh i love that idea
public class Hey {
public static void main(String[] args) {
System.out.println("That's offensive!");
}
}
// Greeter class
class Greeter {
public void greet() {
System.out.println("Hello");
}
}
// Hello class inherits from Greeter
class Hello extends Greeter {
// world name
private String worldName;
// constructor
public Hello() {
this.worldName = "world";
}
// getter for worldName
public String getWorldName() {
return worldName;
}
// setter for worldName
public void setWorldName(String worldName) {
this.worldName = worldName;
}
@Override
public void greet() {
System.out.println("Hello, " + worldName + "!");
}
}
// HelloFactory class to create Hello objects
class HelloFactory {
// createHello method to create Hello Objects
public static Hello createHello() {
return new Hello();
}
}
public class Main {
public static void main(String[] args) {
// Use the factory pattern to create a Hello object
Hello hello = HelloFactory.createHello();
// Set the world name
hello.setWorldName("world");
// Print the greeting using the getter
hello.greet(); // Output: Hello, world!
}
}
@@fredoverflow public class App {
static void main(String[] args) {
IFactory
@@fredoverflow printf("Tha't's too much code, lol");
Lightspped C on my 512K fat Mac (which I converted from 128K by soldering in denser memory chips) was my best new language experience ever.
Lightspeed C with its integrated IDE (I coupled it with Macbugs MC68K assembler/monitor) was a Turbo Pascal experience for Mac programmers.
Very affordable and as a C compiler there was no limitation as to programming task that could be undertaken.
And at that time C was barely older than a decade so it was still THE programming hotness across the industry.
Whatever job you end up working on whatever project - these kind of projects is the best upgrade to ones skills! Especially if you are a beginner! Good you show this guy off here!
the promisse of increased productivity
when compared to something that is generaly percieved as unproductive
had an inverse effect to where a thing that is generaly percieved more productive
became less productive
and less productive became more productive
A lovely journey, I like of this type of "studying", he choose C and don't give up because of opinion of people... this guy became a great engineer!! Only the music that feel me sad!
"Is simplicity better?" Complexity appeals to stupid people. Most people think "If I can't understand something, it must be better than what I can understand."
The best part of C is the language has so few things its really easy to get into a flow state with it. The worst part is you have to hand-roll *everything* yourself. A corollary of that is all the useful libraries people have made are generally awful to get into your build cause nobody agrees on build systems. Also automake and autoconf are the worst inventions ever. They are only step above writing DNS zone files by hand. This means you end up having to always reinvent libraries AND build systems. Point is, C as a language in a vacuum is great. Its the stuff around it that make it awful.
The thing with segfaults is that even in other languages these would be bugs. The would just come up as IndexOutOfBoundsException or NullPointerException (excuse my Java).
Except with segfaults you are lucky if it is actually a segfault. It could also read random other memory from the process and keep going with fucked up data.
@@andrejsk6211 In practice this is almost immediately obvious, because there's no safety features that'll enable the language to keep going semi-correctly with garbage input. It'll just shit itself and die, perhaps not in the place where the issue originated, but pretty close.
I've written almost every single weekday C++ for over a decade. Memory issues that actually caused me to really stare at the screen for hours can be counted on both hands.
11:54 Thats not a language problem its a cultural problem I have noticed with all the Java devs I have ever worked with ... over engineering to the point of ridiculousness.
They are the kings of code bureaucracy the Vogons of programming. And their code has the same aesthetic qualities as Vogon poetry.
Nah, COBOL is still king of bureaucracy.
@@0x1EGEN Its not the language its the developers, their culture and the way it affects the way they write code.
I have never worked with COBOL developers but I would imagine there are a lot of practices that are in place with good reason given the systems that still exist which are written in COBOL.
@@sacredgeometry In the case of COBOL, it's not the devs that are bureaucratic but the language itself was literally designed to be. It's like filling out a form when populating each divisions. And since it has become so engrained into our financial systems with billions (yes billions) lines of code, it's nearly impossible to replace. But hey I guess that also means solid job security haha.
@@0x1EGENWhat does COBOL do that can’t be done in C?
Billions of lines of code to do what?
@@CoderDBF Nothing. C can do whatever COBOL does. But C wasn't around as long as COBOL and that's the reason why our backbone systems weren't written in C. If we were to rewrite everything, it wouldn't be in C but in a much safer, stricter language, Rust perhaps.
If you keep mentioning HTMX and how great it is, my webdev professor is going to climb through your computer screen and scream at you to have a very wonderful Christmas. Because I'm over here listening to lectures on the tag and asking questions about AJAX requests and IDK what he thinks about that. The answer I got was "you're not really going to need anything AJAX in this class." I'm going to start asking things about WASM any day now, and I fully expect to get exactly 0 answers.
Also, I think it's the mark of a good tool that the more you use it, the more you like it. For some reason, C is just such a tool. I don't know if it's Stockholm's syndrome, and I'm not sure that I much care at this point.
no way! our web dev module was all about ajax for a good while.
I think his comments on productivity are less about C s Java and more a product of what happens when you stop and learn a new paradigm. Learning new approaches by writing real-ish code outside the constraints of an existing codebase and language can be enlightening.
That was a good video.and a good reaction.
C for the longest time is always been my go-to language. I'm trying to transition my go-to to c++ just to be able to add some objects but I prefer not getting too wild with OO, except where it simplifies implementation and maintenance.
just skip on the OO all together it's not worth it. function overloading and templates are nice thoguh. But don't overdo templates, they can kill your compile times.
00:04 Journey from clueless to relatively okay in C programming language
02:46 Java is too slow
05:28 Casey was one of the biggest streamers on Twitch in the Science and Tech programming world.
08:20 Define and use your own versions of SSR and CSR
11:11 Java programming was slower than C due to extensive planning
14:09 Created a base layer for an application without using libraries
17:01 C is a favorite language and simplicity can be nice
19:49 Using C for programming can lead to a shift in thinking and improved software development
on the promise of that "increased productivity from language tools", I'd liken it to a kitchen full of gadgets and gismos - most of the time you can get the job done with a good, sharp knife and a cutting-board - a few good basic tools, that are all completely familiar and quickly to hand, rather than 100 single-purpose gadgets that you have to read the manual every time and come with the overhead of extra cleanup at the end...
17:50
(Speaking from the perspective of someone who spent over ten years with C++ and dropped it a couple of years ago.) When I see those C++ projects where 80% of the commits are just fighting the language quirks and/or adding yet another layer of abstraction, turning the codebase into a convoluted "metaprogramming" mess, I wanna cry and tell the people "C'mon, guys, please, PLEASE, stop it, you've just literally spent a thousand lines of code to do one damn thing that realistically needs fifty lines of pure straighforward algorithm, not to mention your abstraction will be used in one freaking place!" Sooo... Yes, I believe simplicity is often better. Do stuff in a simple way and add complexity only when it's needed instead of being a smartass.
Is simplicity better?! Yes! I love C I adore Zig and Rust after about 2 years on and off I’m getting used to C++ after 23 years I still feel a bit lost at times - especially stl templates. I love small languages and simple syntax. It makes you actually focus on the smaller problem to solve (you have to) and that discipline also makes you understand the problem all the much better. Where in higher languages you tend to take bigger problems and actually creating some convoluted code as a result, those simple languages force you to chunk that problem down even further.
Scheme enters the chat
lol, my journey with "C" started with the book "C for Pascal Programmers" and of course the "White Book" some 30+ years ago.
The tagging thing was soooooo good and yet soo simple, genius
@19:50 Templates are typechecked glorified macros. Are they worse than templates and similar metaprogramming techniques? Yes. Is it fundamentally different? Eh... not really.
Yeah it's fundamentally different actually
@@isodoubIetThey both take literal input and generate substituted code which is then compiled as normal. It's not like erlang metaprogramming where they generate ASTs. C++ templates have expanded on that over time but their original form was little more than type matched macros.Feel free to go back to pre-standard C++ and play with them. Working with POD vs not was a mess. I use them regularly in retro development (ARM C++ 1.11, compiler by Norcroft). Over time templates were found/made to be Turing complete (I have had people who worked for me with PHD thesis in C++ metaprogramming and have their libs in Boost). They diverged more and more but they are still both code generation tools.
Templates are first and foremost... a template. A macro is generally used as a form of templating. Functionally they are very similar. Typed and Turing complete don't really make it "fundamentally different" in practice.
Can someone tell me what that annotation similar thing @8:27 is called? cant find it anywhere
I'm doing the same thing that this guy is doing, plus as I'm developing things in C, I'm rewriting everything in Zig, so that when zig is production ready hopefully I can lend a job that has a zig component into it.
@melonhusk562 Good things take time, but there's a need for a C replacement, wether it's rust, or zig, doesn't really matter. But surely old C codebases will eventually pick a language to migrate their unsafe/unmaintainable C code to more modern languages.
@@pierreollivier1pipe dream
Years of c and c++ and I’m still following tutorials
Bringing on Casey and talking about debugging sounds fun.
Another thing that is fun to write besides quaternions is writing Fast Fourier Transforms (FFTs) and their inverses as well as ODEs (Ordinary Differential Equation) solvers.
Writing FFTs is fun when you have an intuition for the maths behind it
My first "blown away" moment occurred once I really understood how recursion could be used to solve the Towers of Hanoi problem. So beautiful.
i fucking love C
The 3b1b Blockchain reference was really a major throwback
3:15 it sounds like he recorded the video in a bathroom stall. What a legend.
4:55 like in those old Scooby Doo episodes when the gang unmasks the monster of the episode
"It all started when I was looking into how a compiler was made"
Finally, a white man.
will we ever see you program in C live on your stream?
He too bad for C
hes a soycoder he cAnt
every programmer worth his salt should know C, every Computer Scientist worth his salt should know assembly. Period, point blank.
Oh no, not C++. Not Objetive-C. I mean C when I say C.
I like C
can't wait to see how linked list work 😲
I'm a newbie I didn't surpass the for loop level yet 😅
This guy is living this life of small steps. And he is smart enough to pull it off, that's why it works.
This is the wrong takeaway. It's not about being "smart", on the opposite, simple things are easier to understand.
Sounds more like an excuse/justification to not do this yourself than an observation about "this guy" or "why it works".
If you can understand any high level language, then you also have the intellectual capacity to understand C and arena allocators. And while it's true that it takes time to learn something new, it's time spent expanding your toolset in a way that makes you a better programmer in any language. An obvious benefit. Sure, your employer/manager/lead might disagree, but then they don't understand that it's shooting yourself in the foot not to do it - which means they're also shooting the company's interest in the foot. I fail to see good reasons not to do it.
@@Muskar2 Yes and then there is also attention span and spacial Imagination. You can train those only so much, maybe at some point you find a way to break things down and it gets easier, but there is no guarantee.
@@75hilmar Sure. I have a close family member who has very limited intellectual capacity (ICD-10 F71), and they've been an extremely slow learner their entire life - so I do believe some things can't be changed - and there's certainly _some_ variety in who has an easier time learning than others. But you won't know what applies to _you_ until you try, that's my point. Arguing generally is typically an excuse. If you're passionate about software development then I think it's worth trying. The only good reason not to do it is if you've already tried really hard in many different ways and just can't find a way to enjoy learning about it. Perhaps you need a mentor that will inspire you or something. Moreover, if software development is just a way for you to make easy money, and not something you actually care about, then I think perhaps you'd just be better suited in another field. Or perhaps you're just not in a good mental state in your personal life and you've been neglecting that. Etc. Good luck!
@@75hilmar attention span isn't infinitely trainable, but it is almost infinitely controllable or at least manageable. If you were locked in a white windowless room for 6 months with only a computer with a text editor and clang and a copy of K&R, you would learn C. Attention span is useful for avoiding being distracted by distractions, but you can also avoid being distracted by just removing all distractions from your environment. Try it. You'd be surprised how efficient you can be when presented with only two options: be productive, or stare at a wall.
4:20 "For me this gave me the confidence to look at everything."
I agree 100% with this mentality because I have lived the exact same thing.
I did not get this revelation with Linked lists but with TCP Sockets. Once I succesfully implemented a ' ' functional ' ' chat app in C with low level TCP sockets, it openned my eyes and I realized that all networking, once you reach the Transport layer, is bsacially the same. You just change the port numbers, after that , the Docs, the SDKs, the libs and the RFCs are the only thung you care about. (99% of the errors you get are ERR_ADDR_IN_USE anyway)
Take C, add comptime instead of macros, add enums, and a match statement.
That would be a contender for the best systems language.
Well, C has enums and it really does enumerate :P
13:36 - so true
"It's cross-platform...you can debug it anywhere"
hi sabrina! hope you are doing well
@@ThePrimeTimeagen I am! Job is going great and I am having a blast exploring in my free time...doing edge machine learning to practice low-level. Still learning a lot from your content!
It takes far more than 2 years to become relatively okay at C It takes longer than 2 years to be relatively okay at anything [especially anything as old as C...]
_"The Lord's Language"_ Yep. That should be trademarked by C.
i been studying C for a year and pointers were easy it was bit shifting (and actually learning binary > deci > hex) that chapped my ass.
Currently learning c
+1 more Casey collabs 5:13
Funnily enough, it's rust that's illustrated to me that you only really need structs. Lack of generics is annoying, but that's the only thing really. You don't need inheritance, and you can basically still have OOP, classes are just syntax sugar. Its a bit more verbose going `void method(MyStruct_t *self, Arg_t arg)` rather than something like `fn method(&self, arg: Arg)` but you can get away with it if you need to. Also you can have your C code run on a GPU with OpenCL (if using a subset of the language) and GPU segfaults are extra fun because they sometimes crash your graphical session :) (ideally compile with gdb first for initial testing).
"Its a bit more verbose going `void method(MyStruct_t *self, Arg_t arg)` rather than something like `fn method(&self, arg: Arg)` but you can get away with it if you need to."
Classes are not for syntactic convenience. They're there because they satisfy useful invariants.
@@isodoubIetLike what?
@@andrejsk6211 Like for example imagine you have a class representing a sorted collection of numbers. The class author provides a member function insert that takes an element + some iteration functionality. You can now safely binary search over the collection, etc. The "invariant" here is the property that the numbers are sorted, which should hold from the instantiation of the collection until it is destroyed. As long as you can argue that each member function does not break that invariant, you have basically proved that those invariants hold throughout the lifetime of the program for all instances of this class. This is very powerful and greatly simplifies reasoning about the system.
You can also make changes to the underlying representation of the collection. You can start from an array for ease of implementation then move on to, say, a b tree, without breaking anybody's code since all they care about are those invariants you guarantee in your API.
Conversely, imagine that instead of a class you just have a simple struct. Now everyone that uses the struct has access to its underlying representation, which means they can do to it any operation they can do to an ordinary array. This means that if you want the elements to always be sorted, you must now verify that this is true for every single time the struct is used, anywhere in the codebase. Realistically, this is impossible. Further, because everyone has access to the underlying representation, you no longer have the ability to change it in the future. So for example if you find that a b-tree would perform faster for your use case instead of a bare array, well, tough luck, you have to hunt down every instance of the struct and make sure nobody's relying on parts of the array api that wouldn't also be present for the b tree api.
That slowing down in higher languages is something I too experienced, too many choices always googling what function to use and what structure to adhere too.
Whilst in C and assembly I knew there’s no function to do something already so I hack it together myself. And yes it’s more work but soon you have a body of your own functions that you just use in other programs and you are quick. The thing is that is GenXers generally grew up from basic to assembly to C and higher languages. We are used to the details and complexities and this trivial. I can’t solve myself into Millenials and certainly GenZ who never have had the luxury of known this simplicity. So I can’t imagine how they look at problems. I immediately see the electronic components or low level code pop in my brain when there’s s problem we need to solve. And it’s easier to abstract up than down I guess.
The dude is writing his own perl.
I'll always admire simplicity that's why I like languages like C, Zig and Go. Rust is just going in the C++ direction of adding too many things
9:43 memcpy moment
prime's mic is on point but the guy on the vid is blowing up the bass of my speakers @Flip pls fix thx
C is to GO,
as
C++ is to Rust.
2:45 it s about time i watch it again, thaanks for reminding me
"Doom on a pregnancy test."
That wasn't a thing. The guy just reused the screen.
thanks for ruining one of my favorite things
@@ThePrimeTimeagen As an alternative may I suggest checking out "Doom on NES!" by TheRasteri. Not running *on* the NES but *through* it in a clever way.
3Blue1Brown and Ben Eater and jadidx9 were my 3 main goto channels for newer videos.
"Is simplicity better?"
Yes.
As for your reaction about C processor programming - why? Is it because it makes you uncomfortable, or because there's an actual measurable, objective thing that can be pointed to and said "Bad"?.
Templates are just doing the same thing, just in a more hidden fashion. If the argument he's making is that he's just writing one set of C macros and then using them forever, and nobody ever needs to look at the code to figure out what it's doing, then it's not meaningfully different than using template code and never examining the compiler source to see what it does. The concern is in reliability - template code in compilers is tested by millions of people, the C-macros he wrote obviously aren't, but that's only a problem when there's a bug. If there isn't - and there's no more likely to be a bug in that code than in any other piece of code - then they're fine.
He does point out that debugging them is harder, but while debugging is a substantial part of programming, you should in theory be debugging each piece of code once - that is, until you figure out what the problem is, and fix it. You pay compilation time *every single change*. Template compilation time is horrendous. Shorter compile times make iteration times much faster, which means much more productivity. A good macro library will save you astronomically in the long run.
5:52 Latchhh was a legend. We need him back!
2:55 And still a great movie.
"Everything should be made as simple as possible, but not simpler." - probably Einstein
Simple beats easy, every time.
Source: I'm a weary dev
I watched that video. It was inspiring for this C noob.
Wow, 10x dev in the making
There is a reason that if you don't want to program with machine code or assembler you use C or maybe C++.
C is extremely powerfull but more difficult than 'higher languages'.
Even then it is still a far cry from the difficulties of programming wihth Assembler or Machine Code without to many compromises.
him blank out the word java is the funniest thing I have ever heard and seen in my life lol
Weird that Christmas music is playing in the background the whole time.
"Thank you for watching, C you next time"
Part of the reason that to like C++ is because I use it as “C with built in data structures”
"Rust is better than C" will only stay relevant until Zig and Odin reach 1.0
I believe livecoding was older than twitch? Anyone remember that platform?
They were using modern C. Being able to declare variables anywhere in a function is like `defer` level of convenience.
well....lets go and rewrite everything in C
@@anon_y_mousseGigachad C 😅
8:30 You can kinda do the same in Jai
I'm so jelly of jai beta testers. I'd love to try it. But I'm not sure I want to meet the requirements of figuring out how to get in. Especially not if it requires sucking up to JBlow in his streams, listening to him being a grumpy lone wolf who assumes the worst of other people - even though he does stream interesting coding problems.
@@Muskar2 He is just looking for people who will use the language and aren't beginners (it isn't super beginner friendly).
He mentioned this in some stream, and someone clipped it, so you should be able to find the clip.
I just sent him an email asking to join, explaining my experience, and what I plan on doing with the language. And I got lucky with the timing, and lucky in general, because a few days later I got an response saying I got added to the beta.
There is no harm in trying. Worst case is that you get no response.
You miss 100% of the shots you don't take.
@@m4rt_ I wrote him before, but thanks for the tip on how to appeal to him. I'll try again
@@m4rt_ Perhaps I should mention that I haven't been able to find the clip you were talking about, nor his email. I've only contacted him in stream chats and via Twitter DMs. So I'll spend a few hours looking for those things today.
guys im new to programming, whats bad with java?
19:17, this 1, alone, is enough reason to switch to C++.
Subbed, LOL I love the bit about not even saying JAVA or around kids LMAO
C macros are better at compiling english to C than LLM-s. We are just not precise enough in expressing our intentions. It's not for the lack of trying tho ...
“It Came Upon a Midnight Clear” is some odd choice of background music 😂
Why he had laugh when said Java crossplatform ? and Debug it everywhere ? Please explain me someone :)
C, Zig, Lua, Python, all the simplest in their category, which is what makes them powerful and super loved.
Is python really that simple? You have to deal with lots of different ways of doing things
@@ZombieLincoln666 as with any simple tool, if all you have is a hammer, all you see are nails.
@@PaulSebastianM import(hammer)
gcc errors are way better than msvc which is what this poor guy was using. I was dealing with a problem with code in MSVC, I didn't understand the error because it was a mess so I copied the code over to Linux and compiled with GCC and it told me exactly what the error was. Granted, this was C++ not C, but I imagine that the trend exists for all C/C++.
CBUN 🤯?
Ah, the Freddie Mercury of Programming
My last modified date stretches back beyond 2000, what does that say about me?
I'll be here 2 years later when 2 Years Of Learning Haskell has dropped
As a hobby C programmer I find C99, cozy most of the time. The segfaults until now always comes back to not doing the intended logic. I use a few macros like __line__ and __func__ and a debugger.
"Doom on a pregnancy tester" had me.
how hash maps are constant time access blew me away the first time! good old intro to algorithims :)
close your eyes and BIll Burr is shouting XD
After painfully graduating from Uni in CS, I coded a few Lua games following tutorials. Every time that I try to do a nice project all by myself, I end up stuck alone and helpless and unable to progress and frustrated.
Then try to team up with someone. This may be your breakthrough.
You could try streaming while you do it
That might be a sign that you need to learn programming in more depth. The problem with programming is if you don't understand a small detail it can be very hard to work with. My recommendation is learn each feature in isolation before you use it. Don't give yourself opportunities to miss-interpret anything.
Lua is a scripting language. It's good for learning the basics but it won't teach you more than that. C teaches all you need to know and it's very small like Lua. Pointers can be hard to wrap your head around though.
@@BoardGameMaker4108 pointers aren’t that hard to understand, they can just be hard to keep track of
what’s this debugging video