Programming Languages

Поділитися
Вставка
  • Опубліковано 31 січ 2025
  • Ігри

КОМЕНТАРІ • 308

  • @miyuzakisuzuki4780
    @miyuzakisuzuki4780 10 місяців тому +84

    C++ will make your best friend your worst enemy. Good thing you're in there to be the middle man.

    • @shimona500
      @shimona500 10 місяців тому

      modern c++ is supposedly fine, or so i've heard from a friend at Google.

  • @Anubis1101
    @Anubis1101 10 місяців тому +25

    I love C++ for the opposite reason as most people (or the ones I hear stereotypically associated with the language), that I can just write things C-style most of the time, and use the extra features and tools as needed. I LOVE making my own functions and methods for things.
    One of my first major self-imposed projects was figuring out how to accurately 'bit-shift' a float (so that it divides or multiplies the value by powers of 2). It was challenging, but so much fun, and taught me so much about the language.

    • @Anubis1101
      @Anubis1101 10 місяців тому +8

      Optimization is still an ongoing issue, and programmers must be ever-vigilant in testing their code. I think that goes for all languages though, not just C++.
      Just recently, I discovered that std::cout has an optimization issue where consecutively passing multiple inputs on the same line with

    • @CaptTerrific
      @CaptTerrific 6 місяців тому +1

      This is why I love Cpp as well! Instead of "C with classes," I treat it 99% of the time as "C with smart pointers" :D

  • @FumeiYuusha
    @FumeiYuusha 10 місяців тому +35

    I'm glad I stuck with C++ through Uni and over the years of working. I had a lot of peer pressure to switch to Java, C#, Python and Rust nowadays, but C++ just feels right for me. I don't know how else to describe it, but C++ is just the language that comes to me naturally when I write code.

    • @DagothDaddy
      @DagothDaddy 10 місяців тому +5

      God you wouldn't think of programming as a field with alot of peer pressure but it is. I entered college just as C# blew up and I had so many people from classmates to professors and even a guidance counselor up my ass about prioritizing it over things I already had a handle on like C,C++ and rust.

    • @hypnos4754
      @hypnos4754 10 місяців тому +1

      I feel the same way. The syntax is intuitive and the way things work makes sense to me. This doesn’t seem to be the norm though. Most people I know feel the opposite about it. C++ is what made me enjoy programming.

    • @2Fast4Youtube
      @2Fast4Youtube 9 місяців тому +2

      If you do a lot of videogame development, you'll be probably interested in Jai.
      (Is not out yet, but is made by someone like you who never switched to any other language than c++)

    • @JohnTyree
      @JohnTyree 9 місяців тому

      This is probably because you learned with it and haven't really used much else. Everyone's "native" language feels right to them, but that doesn't mean French is better or worse than German, even in France.

    • @FumeiYuusha
      @FumeiYuusha 9 місяців тому +2

      @@JohnTyree That is an interesting theory, and I'm sure there is some merit to it. I would count myself as an exception though. I know 4 spoken languages and I'm currently learning a 5th. My favorite is not my native one, nor my second learned language.
      As for programming languages, I learned and used several other languages too, among them Ruby, Python, Java, Rust, Bash Scripting, Perl, C#, Assembly Code and other scripting languages made for specific applications. You are right in the fact that I used C/C++ the most, but I did learn programming in BASIC and Pascal, C/C++ only came into picture 2 years into my programming journey. My reasons are perhaps more unique to my own situation.
      I do not disagree with your statement though, I am sure a lot of people have the reason you stated, but it's definitely not mine.

  • @MyCodingDiary
    @MyCodingDiary 10 місяців тому +4

    You're changing lives with your content. Keep inspiring!

  • @NotSionnix
    @NotSionnix 10 місяців тому +11

    I think this video really highlights just how much bad coding practices there are in the industry and that learning how to write "good" code with appropriate standards is something that doesn't get talked about a lot.
    I think it would be very interesting to see a video talking about good coding practices, how to write readable code for you and for others, how to make things simple and reduce complexity when necessary, and common "bad" practices you've seen over the years. Cheers!

    • @Me__Myself__and__I
      @Me__Myself__and__I 10 місяців тому +5

      Good programming practices, discipline and learning to write readable & maintainable are hugely important. Unfortunately they are also EXTREMELY time consuming to learn and become good at. I think most of my code was complete crap even at the 20,000 hour of coding experience mark. It probably took me until 40,000 to start getting decent at it. My code worked and was considered good by others during that time, but I set very high standards for myself and my code. I spent a lot of time thinking about this stuff and carefully analyzing how the code I wrote turned out and performed and then intentionally finding better ways to do things. Writing code is fairly easy, writing GOOD, high quality code that performs well, is easily modifiable, is readable and maintainable is extremely difficult and takes a long time to learn. Wanting to learn this is a darn good path to be on. The best way to truly learn it is to meticulously pay attention to and analyze the code you write and how it turns out. Figure out which things are difficult to go back and modify a year or two later. Which code performs and scales well and which don't. Etc.

    • @Rekennnnn
      @Rekennnnn 2 місяці тому +1

      @@Me__Myself__and__I can you elaborate on "meticulously pay attention to and analyze the code you write and how it turns out", please. Perhaps you can share some effective practices you've picked up over the years. Thanks.

    • @Me__Myself__and__I
      @Me__Myself__and__I 2 місяці тому +1

      @@Rekennnnn If I could figure out what to say in detail it would be extremely long. Pay attention to what gets written, how its written, how long it took to write, if it ends up needing to be rewritten, if it needs to be optimized later, how easy it is to modify the code when requirements change in the future, how much time/effort is required for routine maintenance/tasks, how easy is the code to understand either when you come back to it in a year or two or for new developers, how well does the code/design scale over time, etc. Think about all those things and more before writing new code, while writing code, while changing the code later and in general after the code is in production. Pay attention to what works and what doesn't and learn from it. This takes many years, there are no shortcuts. But if you don't pay attention and analyze these kinds of details even after many years you won't have learned/improved that much. Fyi I suspect a lot if not all 5x/10x devs who write good code (vs writing garbage fast) do this sort of thing. This has certainly made me a much better and faster developer/architect.

    • @Rekennnnn
      @Rekennnnn 2 місяці тому +1

      @@Me__Myself__and__I Thank you, kind sir

    • @Me__Myself__and__I
      @Me__Myself__and__I 2 місяці тому +1

      @@Rekennnnn No prob, hope you find it helpful.

  • @Plachno85
    @Plachno85 10 місяців тому +3

    This is the video I’ve been waiting for!! Awesome insight into languages and your experiences. Thank you for the upload, Tim!

  • @Garouwerks
    @Garouwerks 10 місяців тому +41

    Hello Mr. Cain,
    I've been watching you since TKMantis had you on his channel. You have been one of the warmest, most kind, professionals I have had the joy to watch and learn from. I am now 54 a wife and mother of 2 who has been playing games for decades. I have had a lot of time to see games grow, and change, and I find it fascinating how close to the truth (to being On the Nose)many of the 'future games' are. I have been curious for years how all of you creators get that close to the truth in Our reality. Just how do you 1) come up with the ideas for the story of the game? 2) What things in current life help you come up with the future in the games? , and 3) Do you have some crystal ball (joke)?! Some of the things that happen in the Fallout series have insanely happen in real life. The real question is: do you ever feel surprise or shock, or anything; when ideas you came up with for a game and put in the game, become real?? Does that ever affect you?
    Thank you for doing these video's and being such an amazing person. I really look forward to hearing from you and learning about the industry. Much thanks!
    Sincerely,
    Nichole.

    • @Jpzarde
      @Jpzarde 10 місяців тому +5

      I’m not a Mr. Cain or really a qualified enough author to answer these questions, but feel inclined to do so anyway. Please forgive me
      1. I find the nature of ideas and inspiration to be like flashes of lightning. Sometimes they show up at just the right time, other times they take forever to appear. Either way, you need to be ready to do something when they show.
      In terms of storytelling, having knowledge in story structure / format can help, but isn’t a hard requirement. All I know for sure is once you’ve read Aristotle’s Poetics, you’ve read every story ever conceived on this planet.
      2. I think- based on what little I know, storytelling as a whole can be boiled down to answering a what-if question, and trying to answer it honestly. No matter what genre or medium, be it sci-fi or fantasy, video games, movies or books, the best / most accurate to life stories always have some kind of universal truth to them.
      What if the world got blown up by nukes? (An unlikely but not impossible future.) Life would probably go on. Humanity’s nature, though scarred, probably wouldn’t be all that different from life before the bombs fell. Their capacity for war will never change. That’s the world of Fallout in a nutshell. What if the world was threatened by a war perpetrated by a dark force? Say WWII? Every nation would react differently, but ultimately it’ll be the unseen, smallest masses of the human race who would win the war in the name of good, and pay the ultimate price in doing so. That’s lord of the rings.
      Sci-fi is neat because while most fictional stories ask “what if ‘x’ was real,” (like what if goblins were real,) Sci-fi specifically tackles what if ‘x’ in our reality was real, and more often then not it’s related to a developing technology that is very much closing in on becoming tangible by the day, if not the hour. Such as artificial intelligence, for example.
      I think in terms of storytelling being akin to having a magic crystal ball, sc-fi comes closest to predicting what our future could be like. Every other genre tends to be more about the nature of humanity, and more often than not is a morale lesson on how to be a good person.
      Everything else save for the message in your story is spectacle. The big battles, the drama, the mutant monsters, the retro future aesthetic, the occasional over the top wackiness, whatever. Everyone listens to a story for the spectacle, and they stay for the message / universal truth. (Or because you’re the author writing the story, that is also a possibility.) ((But that’s probably because they know what kind of spectacle you like to write into your story!!!)) You as an author get complete dominion over what kind of spectacle you want your world’s story to have, because chances are if you like to see lots of action and / or drama in your story, floating cars and mutant monsters or what not, someone else will too.
      Apply your story’s message / world to the spectacle you wanna portray and that’s how you get desolate retro future cities, or elves- dwarves, humanity and hobbits banding together to stave off the impossibly powerful forces of Sauron.
      I’m kinda shocked myself that AI has come so far- far enough to potentially replace the art / writing industry as a whole, but I’m hopeful that means art will become more of a social skill rather than a specialized commercial industry. Art has the potential to enrich everyone’s lives, and if everyone knows how to make art, (IE learns how to make it by hand and not with an AI,) the more lives there are to enrich.
      I hope you got something out of reading this :)

  • @mrhammer1179
    @mrhammer1179 10 місяців тому +2

    I've been a CS student for about 3 years and now am getting into game development, many of these videos have given me inspiration. It has been a slow start due to my workload, as well as the job search but I am hoping it'll speed up over the summer.
    Thank you for all the fun videos!

    • @mrhammer1179
      @mrhammer1179 10 місяців тому +1

      Also I tend to agree that C++ is the most useful, I prefer it over the other languages I've used.

  • @iswordlogici7760
    @iswordlogici7760 10 місяців тому +3

    All of these videos you make about programming really has me wanting to learn.

    • @Me__Myself__and__I
      @Me__Myself__and__I 10 місяців тому

      If you want to learn for fun by all means. I personally love programming. However, if you want to learn as a future career path - uh not so sure anymore. AI is going to put a LOT of software developers out of jobs. Within a decade it may make it completely irrelevant as a career. FYI

    • @TheSeriousDog
      @TheSeriousDog 8 місяців тому

      @@Me__Myself__and__I AI bad, programming good. Let man learn programming

    • @Me__Myself__and__I
      @Me__Myself__and__I 8 місяців тому

      @@TheSeriousDog Are you a 5 year old?

    • @TheSeriousDog
      @TheSeriousDog 8 місяців тому +1

      @@Me__Myself__and__I I actually disagree with your point of view, even if AI comes to a point that can replace developers(which I doubt). It is still good to learn programming, it will teach you a lot about computers and problem solving. Learning a new skill is never a waste of time.

    • @Me__Myself__and__I
      @Me__Myself__and__I 8 місяців тому

      @@TheSeriousDog I agree with the latter half of that. I've said it numerous times, learning for the sake of learning is still valuable. But leaning programming will not be "valuable" in the sense that it will pay money in the foreseeable future.
      AI can already write code and solve coding issues, though its mostly somewhat limited currently. But go check out "Devon" (I think that's the name). Its an autonomous system designed to work as a consultant programmer basically. It only gets better from there, and the improvement will be faster than a human could learn to be a good programmer.

  • @Tailmonsterfriend
    @Tailmonsterfriend 10 місяців тому +32

    I FEEL SO VALIDATED! I had a very similar language journey (Basic -> Assembly -> Pascal -> C -> Javascript -> (sea of mostly academic languages in college) -> Java -> C++ -> C#), and C++ is the one I felt I had the best combination of "powerful features" and "really fast." I think any programmer worth their salt can do great things in (almost) any language, but there definitely are differences in how much you can squeeze out of each one, performance-wise.
    Which reminds me, I really should learn Rust.

    • @sub-harmonik
      @sub-harmonik 10 місяців тому +4

      I'm waiting for zig to become stable

    • @arson5304
      @arson5304 10 місяців тому +1

      if you love powerful features and runtime performance, oh boy you're gonna fall in love with rust

    • @archeogeek315
      @archeogeek315 9 місяців тому +1

      All man who understand Assembly deserve respect.

    • @Noxfrolic
      @Noxfrolic 9 місяців тому

      I've gone from C/C++-> C# / JAVA -> C# -> Typescript + Python --> Go > Rust, Powershell or Typescript depending what I'm working with.
      Typescript is the best general purpose language today in my opinion. Not so much because it's good at anything, but because you can use it for everything meaning even small teams can help eachother and share resourses regardless of what they work on. Powershell is just a part of Azure these days, I'm doing it because our operations guys can't, but it's really just because it works so well in Azure runbooks and I'm getting tasks I probably shouldn't.
      Rust is basically C/C++ that you can write after a week with no sleep... and you get to be part of a cult!
      I don't think there are any bad languages. I prefer Rust these days, but it's mostly because everytime I'm doing C# or Java I feel like what I'm doing would be so much easier in Go and at least with Rust you get performance.

    • @CaptTerrific
      @CaptTerrific 6 місяців тому

      @@archeogeek315 You can learn assembly for a given ISA in a day! It looks scary, but even the most complex x86 architectures have surprisingly few instructions to learn. Of course understanding functionality just by viewing the ASM takes a long time to master, but so does any subject area. However assembly has a surprisingly linear learning curve, and I encourage you to try!! It'll make you a better programmer :)

  • @sealsharp
    @sealsharp 10 місяців тому +30

    I can do all three of Tims languages. Learned them in the same order.
    Learning C and C++ was pretty useful for working with C#. Tims example of C# being slow for image processing is one of these cases where a little bit of unsafe code could have saved the day.

    • @mandisaw
      @mandisaw 10 місяців тому +11

      One of the things I like about Unity - lets me code gameplay in a high-level language, while the engine uses C++ for graphics & better runtime performance. Most games you see with performance issues aren't really about the language (or even the engine), it's just poorly-written & architected - or no one listened to the technical artists & QA team.

    • @Me__Myself__and__I
      @Me__Myself__and__I 10 місяців тому +5

      Interestingly learning Pascal, particularly Delphi is far more relevant to C# than C or C++. C# and the .NET platform are actually based on Borland Delphi (Microsoft had to pay $$$ to license patents) and the architect of C# was the architect of Delphi (Anders Hejlsberg). I had worked in all 3 before C# and Delphi was, by far, the most relevant. In fact, C# is for the most part a vastly improved Delphi (though I still miss sets and visual form inheritance).
      C# became faster and more efficient over time. Plus there are ways of doing certain things faster. Image processing was slow in the beginning, I don't remember what I was doing but I remember trying to do image processing and it was a massive pain. But later versions provided more options. Plus, as you mention, it is always possible to code time critical capabilities in unsafe code. Though I'm not sure if you can do that with platforms like Unity. For most things C# is the best language that exists today, it started off good but they have expanded on and added to it numerous times and now its quite awesome. They have a habit of taking the best parts of other languages and adding them into C# in really good and useful ways. Its sort of the melting pot for the best of all languages now.

  • @Queso2469
    @Queso2469 10 місяців тому +10

    I'm glad C# has matured a ton in the past decade that has made it way more pleasant to use. My biggest annoyances in working in Unity are all terrible API decisions made by Unity themselves. It's now an extremely pleasant and performant language that I don't have to babysit, on top of an engine that I have to fight a lot :P

    • @Me__Myself__and__I
      @Me__Myself__and__I 10 місяців тому +2

      C# has been an excellent language for quiet a long time. I only recently started using it in Unity and from what I understand Unity was always lagging behind and was using Mono and not .NET proper. Development in Visual Studio against .NET has been fantastic for many years. Like I said I've only been using Unity recently, so if it was substantially worse before I'm very glad they've fixed and improved that. Its a great language but its only one piece of many that must all work together in a platform.

  • @LinuxRenaissance
    @LinuxRenaissance 10 місяців тому

    Thanks! I was asking myself this same question, but in the end I decided to focus on learning C for my first PC game. My goal is to make my own "engine" anyway. The person who actually helped me decide this was John Romero who said how they never re-used the code from the previous game because when you are making the next one you are smarter and more experienced and you will do it better this time.

  • @artempest7137
    @artempest7137 6 місяців тому

    You’re the best Timothy I love your stories and I love the way of how you express your passion for the industry 😄

  • @DamianReloaded
    @DamianReloaded 10 місяців тому +1

    Jason Turner's channel is a good source for staying up to date with everything c plus plus related.

  • @DreamsStreamChannel
    @DreamsStreamChannel 10 місяців тому +4

    On the topic of learning which language first, I think that depends a lot on learning style and environment. When I went to college for making games they started us on primarily C, then moved to C++. Not knowing anything about programming it was a lot to wrap my head around. But as we had instructors, TA's, and supporting resources it went well. Ever since, if I needed to pick up other languages for a project it hasn't been super tough.
    Whereas I have heard other programmers say that it was difficult to work the other direction from Java/C# to C++ or C. But if you are learning primarily on your own, it may be easier to work with a higher level language at first. Learning C/C++ there were some errors that would have been an absolute nightmare if I didn't have that academic setting to ask questions in.

    • @EEDIR-DK
      @EEDIR-DK 10 місяців тому

      I would tend to agree. C is best to learn first, then go towards a language with the features you want like C++.
      While performance is important, this is not the main reason for learning C first. I argue it a little different, as an electronics engineer, I have worked with quite a few different computing platforms, including GPUs and FPGAs, and frankenstein combinations of each like APUs and SoCs. What they all have in common despite their very different architectures and compute models are a c-style syntax. This helps you in concentrating about learning the capabilities of these platforms rather than using a lot of time trying to learn syntax instead.
      Some of the higher abstraction languages like Java and C# does seem to hide the nature of the underlying platform away from the user, so people get stuck in the "Java"-way or the "C#"-way of doing stuff, and can be hard to unlearn.

  • @xecreth7211
    @xecreth7211 10 місяців тому

    Just found your channel while searching for design videos and its awesome tyty

  • @CallousCoder
    @CallousCoder 10 місяців тому +2

    The good ole days when we wrote assembly and then moved to C, what a happy moment. Then to C++ which took some of the tedium from C++ away.

  • @developerdeveloper67
    @developerdeveloper67 10 місяців тому +6

    Hi Tim! Thank you for taking my question! So happy to watch this video. lol Surprised by how much you know, more than you often let off. But that is kinda obvious, since you have been making games from scratch in C for most of your career, you can only know well what you are doing. About the subject of the video: what can I say, more than I already said in dozens of comments here in your channel, well, I prefer C! I think most of the functionality of the C++ language is not really that necessary, and the C++ compiler is significantly slower than C's. Aside from that in non-practical secondary issue, I also I think there is a certain snobbish attitude in the C++ community online that is a bit like: "you have to do 'modern C++' or you are not a 'proper' C++ programmer", that is a bit off-putting to me. Again, thanks for the video! :)

    • @Me__Myself__and__I
      @Me__Myself__and__I 10 місяців тому

      In general C is harder to understand and more costly to maintain. It also allows undisciplined developers to write some truly obnoxious code that ends up being impossible for anyone else to comprehend or maintain. C++ and C# result in code that is easier to maintain, more modular (easier to adapt) and easier to figure out/read. Game development is a niche where certain things (raw performance & efficiency plus low-level hardware access) often outweigh many other factors. Game code doesn't need to be maintained and modified over time the way most other systems do. Once a game has shipped its code is mostly static except for bug fixes and the occasional tweak. In these areas for most software development purposes C# is by far the winner. But it really depends on what is being done and the constraints of the work. Writing low-level device drivers favors C or C++. Building a complex enterprise application that needs to be supported and modified over many years by multiple developers favors C#.

  • @Me__Myself__and__I
    @Me__Myself__and__I 10 місяців тому +1

    Dude. I started in BASIC on an Atari 400 (quickly upgraded to an 800). Then BASIC on a Apple II, C64, C128 and finally landed in Turbo Pascal 4 on an IBM PC-XT as my first procedural & compiled language in high school. Started learning machine code on the Atari so I could poke instructions into memory then taught myself assembly language somewhere in there to do graphics programming. This might be part of the reason I tend to agree with your perspective.
    I kinda feel sorry for newer developers coming up and learning in modern days. I knew pretty much everything there was to know about the Atari 800, which is why I moved on to other systems. It was possible because the Atari 800 ecosystem was tiny in comparison to what modern computers can do. Now its inconceivable that a single programmer could learn 100% of even a single development environment (such as Visual Studio) because they are so broad.
    It was also easy and fun to learn in that environment but also taught discipline because 16K of memory and a slow CPU is very limiting. A lot of newer developers have no clue about writing efficient code and many don't even consider performance or resource usage when coding. They are wasteful because on their development computer they have lots of RAM and CPU. But then in production scaling issues arise because nearly everyone's code is inefficient and the whole thing at scale becomes a resource hog. Which would also apply to game backend developers (particularly for things like MMOs). But in general game devs are probably one of the few areas in programming where efficiency and performance still matter.
    Anyway, I really think there was great benefit in learning to program in a tiny ecosystem under extreme constraints that no one I'm aware of benefits from anymore.

  • @MyCodingDiary
    @MyCodingDiary 10 місяців тому +1

    Your videos always make my day. Keep shining!

  • @valethemajor
    @valethemajor 10 місяців тому +1

    The simplicity reasons behind your preference toward C are the same that made me choose GO - forced to write simple and readable code with no wild tricks. I can always come back to my code and read it just fine. Cannot say the same about my JS days where I was also learning functional programming lol....

  • @chucknv5482
    @chucknv5482 2 місяці тому +2

    3:08 Doggo sighting

  • @wesp5
    @wesp5 10 місяців тому +7

    Hi Tim, what do you think about Python? I know you were not involved a lot in Bloodlines, but if it wasn't for the fact that the Python scripts, that kept the whole game together, were only compiled when the game started and were available as clear text in the game files, that made something like the Unofficial Patch possible in the first place!

    • @PointReflex
      @PointReflex 10 місяців тому +2

      That was very handy for lil idiot me when the crash at the end of the Society of Leopold mission happened in an age without home internet access, which forced me to kinda learn Python by "translating" the plain code from the game files and build a fix-enstein that allowed me to continue playing the game (I was at that level of Bloodlines-adiction). Side note, I saved the "fix" in a CD and went to upload it into the internet at a Cybercafe just to realize that your Unofficial Patch was a thing... did both kicked myself in the nuts and saved your patch in a DVD and ran back home.
      Anyhow the overall point is that since you have mentioned the game, I will be reinstalling it.

  • @wdavid3116
    @wdavid3116 6 місяців тому

    Ref your statement about pascal being compiled. I also started my programming with BASIC specifically QBasic on a 286. I remember I was trying to code a small game, I was very young at the time and didn't have internet access or any books, I was naively coding things to just happen one after the other and had a ship that would move up and down. I somehow got a copy of quick basic which had a compiler instead of the QBasic interpreter and when I ran the program through it what was a reasonably successful group of pixels that moved at a reasonable speed was just an instantaneous flash that you could barely see. At the time I was just totally confused as to what was going on and how it was possible.

  • @Valiblename
    @Valiblename 10 місяців тому +5

    I started with C# as well in Unity and definitely made the mistake to abuse the update function a lot
    Last year tried Godot and i like it because it guides you to use the publisher/subscriber pattern with it's signals

    • @Validifyed
      @Validifyed 10 місяців тому +4

      Sadly the one thing missing from godots signal system is input handling. There are signals for HID inputs, but it lacks the signal granularity of the 2019 updated unity input manager system, which uses generated code files to assign signals per input action type and per binding.
      As a result, most Godot documentation seems to include input queried in the process function.

  • @dziuaftermidnight
    @dziuaftermidnight 10 місяців тому +1

    C is the best option for me. When I use a tool, I like to be 100% familiar with it, and that is basically impossible with C++. That's why I always prefer on using C, especially when collaborating with people (since you can't really impose limitations on what language and STL features is somebody using when coding).

  • @Tetramir1
    @Tetramir1 10 місяців тому +1

    the part about optimizer bug is funny. I've only been working professionally as a programmer for 6 years. But in that short period, all the bugs I remember that happened only in optimized build happened because debug builds would init memory to 0, or things like that. So nowadays my first reflex in release build isn't to check the compiled code, and always to look for uninitialized memory or something similar.

  • @StavrosNikolaou
    @StavrosNikolaou 10 місяців тому

    That is such a fascinating journey. I started in the 90s with visual basic and then moved to C, C++, (just a smidge of) assembly, Java, Python, Python, Python,.., back to C++ and have only toyed with C#.
    Learning new languages is so fun (when you have the time to do so properly and experiment).
    Having written for so long in languages that force you to explicitly manage memory how do you feel with newer languages like C++ and C# that offer much more convenient primitives (smart pointers etc)?
    Thanks again for the great video. Keep the technical ones coming 😊

  • @EEDIR-DK
    @EEDIR-DK 10 місяців тому

    Hi Tim thanks for the video and the games through the years.

  • @samcrater7296
    @samcrater7296 10 місяців тому +2

    Tim, at 6:00-6:30 it sounds like you are suggesting that we look through -O3'd assembly and try to not only find the bug but figure out which compiler optimization it was a part of. Could you expound on that? That seems highly infeasible for anything but a small amount of code.

    • @CainOnGames
      @CainOnGames  10 місяців тому +8

      You can compile with different optimization flags to find out which optimization is causing the issue. And you can compile with pragmas to find out exactly what part of the code is being optimized incorrectly. Both of those actions are fine.
      But then yes, I recommend looking at the assembly output of that particular section of code created with the optimization flag to find out WHY the error is happening. Once you know why, you are prepared to avoid the issue in the future.

    • @adamvandolder1804
      @adamvandolder1804 6 місяців тому

      @@CainOnGames Compiler Explorer (aka godbolt) makes investigating C++ optimization issues sooo much easier. You get the assembly from all the major compilers, with links between each line of code and each block of asm

    • @OpenGL4ever
      @OpenGL4ever 5 місяців тому

      @@CainOnGames I have another question about this. You said in the video that you fixed it. Did you fix it at the assembler level? And if so, wouldn't that mean a lot of extra work if you had to adjust the assembler code after every recompilation in order to fix the bug?

    • @CainOnGames
      @CainOnGames  5 місяців тому +1

      @OpenGL4ever I usually fixed it by surrounding the code with pragmas to prevent its optimization. Sometimes I would rewrite the code so it would optimize correctly.

    • @OpenGL4ever
      @OpenGL4ever 5 місяців тому

      @@CainOnGames Thank you for your answer.

  • @neonneon892
    @neonneon892 10 місяців тому +13

    I unfortunately went and learned Rust before C++, and all the times I've attempted C++ afterwards have been full of "wow, this is so much nicer in Rust". Gotta get over that one day though, chances are that there will be a ton of C++ to maintain in whatever game programming job I end up in.

    • @Kroogles
      @Kroogles 10 місяців тому +3

      I've been coding for over 20 years and I've personally known dozens of engineers. You are literally the only person I have ever seen who thinks C++ is "much nicer" than Rust. More power to you, of course, but passersby should definitely do their own investigation. For my part, I couldn't disagree more.

    • @neonneon892
      @neonneon892 10 місяців тому +11

      @@Kroogles Sorry, still haven't found one, I think you misread a word! I definitely prefer Rust over C++ :)

    • @Kroogles
      @Kroogles 10 місяців тому +4

      ​@@neonneon892 I did misread, my apologies! I was deeply confused by what I incorrectly thought to be your position.

    • @simulacrumgames
      @simulacrumgames 10 місяців тому +1

      @@Kroogles I almost misread your comment and I was about to be like who have you been working with?!

  • @tehsensei
    @tehsensei 4 місяці тому

    I didn’t understand everything in this video, but it’s gotten me curious to learn something new.

  • @krank23
    @krank23 8 місяців тому +1

    I prefer C#, but… that's probably because I seldom do the kind of resource-intensive stuff that requires the kind of optimizations and close-to-the-metal stuff and manual memory management that C/C++ offers. Maybe I'm just a crappy programmer, but I like garbage collection, and I like a bunch of the affordances and little helping hands C# as a language gives you. On the other hand, what do I know? I just code for fun (and I also teach highschoolers C# and Unity development), not as my job. I don't have deadlines and I seldom finish projects. So my tastes are absolutely shaped by that.

  • @KidLudens
    @KidLudens 10 місяців тому +2

    Would having a better understanding of C help us think differently and make better decisions when coding in C++? I'm wondering if it's worth learning C if it will help make us smarter C++ programmers, and avoid complicating our code by unnecessarily relying on too many features of C++. If so, I would definitely learn C!

    • @jonteguy
      @jonteguy 10 місяців тому +3

      It probably will. But I think just learning C++ from C++11 and onward will also do that.
      But honestly as long as you really delve into the memory management of cpp you should be fine. You should never use things you don't know what they are actually doing behind the scenes because that will dim your undertanding of the language.

    • @KidLudens
      @KidLudens 10 місяців тому

      @@jonteguy Yeah for sure, I think doing something but not really understanding why it works will cause major headaches in the future, so I'm trying my best to fully grasp all that I can. I use cpp daily, and you're right, the memory management side of it seems to be where a lot of the complexity resides. Thank you for the response! :)

    • @sub-harmonik
      @sub-harmonik 10 місяців тому +2

      using c might help understand what happens internally more I think. Because you have to move and allocate all the memory yourself, it's that much less abstracted.
      Plus when you only use the very small set of features that have clear analogs in machine code it might make you ask 'how is that implemented internally' when you come across a more complex feature in c++ like lambdas or coroutines or stl data structures.

    • @KidLudens
      @KidLudens 10 місяців тому

      @@sub-harmonik Yeah, that makes a lot of sense. I do currently use lambdas, and it's true that I really only have a high level understanding of how they work. I'm more familiar with the syntax and how to create one, but I honestly couldn't explain to someone what they're really doing deep down in the code. Ok cool! I think I'll spend the next few months learning C for a few hours each evening. Who knows, I may have a few "Aha!" moments in the future while using cpp because I understand something a bit deeper! Thanks for the reply!

  • @RetroFrequency
    @RetroFrequency Місяць тому

    If I'm not mistaken, C# can be put into a "let's get dangerous" mode where it does allow you to work with it like C++ and is way faster as a result. Apparently it's the "unsafe" keyword.

  • @8Paul7
    @8Paul7 10 місяців тому +250

    Hi Tim, it's us, everyone.

    • @Jaqinta
      @Jaqinta 10 місяців тому +2

      waited him soo much for this topic soo excited ! watching now ! :)

    • @bruhvistan9001
      @bruhvistan9001 10 місяців тому +5

      Hello everyone, it's us, we.

    • @sentendo7647
      @sentendo7647 10 місяців тому +9

      this joke is getting old

    • @itsange02
      @itsange02 10 місяців тому +10

      @@sentendo7647ur mom is getting old

    • @insertoyouroemail
      @insertoyouroemail 10 місяців тому +2

      @@itsange02no u

  • @dominikdalek
    @dominikdalek 10 місяців тому +1

    Weird Tim didn't mention exceptions causing a lot of problems on consoles before it was possible to completely disable them in various libraries (including STL). As for the image processing in C# - you had to copy raw data out in those days and work with that. Working on abstractions provided in standard library (Image/Bitmap/Graphics) had massive performance penalties.

  • @0x44_
    @0x44_ 6 місяців тому

    I agree, and I love C++. I also love C though and it's really hard for me to pick between the two. Ultimately it probably depends on my goals, whether I have unlimited time and wanna do something well versus wanting to do something faster.
    Also, Inheritance is one of those things, I don't wanna say has no use, but I personally think its only place is making fast updates to code you didn't plan on, which is obviously useful for crunch. However, I just don't see any benefits, and only negatives, over using it instead of composition when planning systems out. That said, I've encountered countless people who get seriously defensive about it, and not a single one of them could ever give me a valid reason for using it, which makes one wonder if they just don't understand composition.
    Operator overloads are another that I feel are *almost* completely unnecessary and further fall into the category of "trying to do something clever, but just being stupid" since a function that describes what it's actually doing in the name is nearly always better, and I only say "nearly" because I think there's probably some low level library use-cases that I may just not be aware of, and I just hate saying never.

  • @jamesrivettcarnac
    @jamesrivettcarnac 10 місяців тому +1

    6:34 that this surprised you speaks very highly of the engineers you worked with prior to this.
    Cause i have met programmers who dont believe that functions are a good thing and cyclomatic complexity scores are a challenge.
    And thats not hyperbolic. The said that to me as their boss as justification for the code they were writing.

    • @Anubis1101
      @Anubis1101 10 місяців тому

      Yea I've seen some REALLY weird takes since diving into programming. The whole Clean Code style guide thing is wild when you try to think about it in practical use, but more than a few programmers still swear by it.

  • @GypsumGeneration
    @GypsumGeneration 10 місяців тому

    Thanks for sharing, Tim.

  • @struggopuggo
    @struggopuggo 10 місяців тому +2

    I'm curious to see if Rust will be used for game development.

    • @Kradse
      @Kradse 7 місяців тому

      it is being used for game dev :) try lookup the Bevy engine.

  • @Yorick257
    @Yorick257 10 місяців тому +1

    I feel called out and ashamed. But also hopeful, because it means that I still have so much to learn and master. I work with embedded systems, so the speed and the size are still somewhat relevant

  • @temdisponivel
    @temdisponivel 10 місяців тому

    Hi Tim. I have a question for you: I'm about to become a tech director for a small company (12 people, 7 engineers). The company uses off-the-shelf engines (Unity/Unreal). I would love you if you could talk about what makes a good/bad tech director, the do's and don't's, etc. Thanks for all the content you've put out, it's fantastic!

  • @souluss
    @souluss 10 місяців тому +1

    Me, a Scala programmer refusing to touch anything lower level, hearing that "you can do so much in c++": O.O

    • @pyepye-io4vu
      @pyepye-io4vu 10 місяців тому

      C++ can actually be as high-level as Scala.
      Also, give Scala Native a try! That's what I'm doing right now.

  • @DogeOfWar
    @DogeOfWar 10 місяців тому

    Hi Tim, can you (or maybe you already do?) have a video or blog detailing your experience using the Source engine with Vampire the Masquerade: Bloodlines? From what I read from other people at Troika they said it was groundbreaking at the time but it also took a while to learn.

  • @gregorymifsud5389
    @gregorymifsud5389 10 місяців тому +18

    multiple class or nested inheritance can most definitely make your life a living hell

    • @downstream0114
      @downstream0114 10 місяців тому +5

      I realized it was problematic when copying the way other people had done ridiculously deep class structures. I'm quite happy making "wide" code. Composition over inheritance.

    • @Me__Myself__and__I
      @Me__Myself__and__I 10 місяців тому +1

      Or it can incredibly simplify an architecture and add make a system much easier and cheaper to maintain due to modularity and expandability. A good, skilled software architect can do amazing things with a good OOP language like C# that deliver a lot of significant benefits. But it does take knowledge and skill that require an investment of time to learn.

    • @gregorymifsud5389
      @gregorymifsud5389 10 місяців тому

      @@Me__Myself__and__IIndeed

    • @darkengine5931
      @darkengine5931 10 місяців тому

      @@Me__Myself__and__I A general difficulty I tend to find with OOP specifically in the context of game design is that even moderately complex game rules tend to want to work towards the leakiest abstractions.
      Consider just implementing D&D rules. We often have rules like this attack temporarily drains one level from the creature that is attacked, this potion/spell heals this much HP, this spell does this much damage with this much area unless we're indoors or underwater or it's raining in which case it does something else, etc (hundreds of pages worth of such rules).
      Such a rulebook actually lends itself to a very straightforward procedural design with functions that mutate data. Or slightly less straightforward but still straightforward, as a functional design inputting data and outputting new data. It doesn't lend itself to a straightforward object-oriented design since with the thousands of inter-object interactions that result in mutations, it constantly raises the question of what modifies what. If objects only modify themselves for the least leaky of abstractions, we still end up working quickly towards a lot of monolithic objects with countless methods or fewer methods but then getting about as leaky as the worst getter/setter interface designs.

  • @arda7an
    @arda7an 10 місяців тому

    Hey Tim, great video as always.
    The audio is not that great though, it's actually been a problem for a while now. I think there's quite a fair amount of clipping going on and everything just sounds so extremely compressed and distorted, so yeah, just wanted to point that out :D

  • @SknCommonLisper
    @SknCommonLisper 9 місяців тому

    What's your opinion on (common) LISP? With (modern) common Lisp (specifically; the SBCL Compiler) you get code that rivals C's performance (and in some cases, surpasses it, such as with recursion or linked-list manipulation).
    To paint a bit of a picture. Common Lisp is both an compiled and interperted language (repl runs in 3 steps, with running compiled code last, which also allow for things like macros that alter functions entierly pre-runtime). So you get the 'best of both worlds' kind of scenario, this allow for things like debuging, or making code-changes at the same time as a game is running, without needing to re-compile it (as you can recompile the code immediately while the game is running, the repl will just start reading the new compiled code instead).
    Basically, you can do with CL natively, what you'd use a script language for, with no performance drawback.
    --
    Obviously, CL isn't a popular langauge in general, doubly so for games, so game-resources for it is bascially nil (We do have wrappers for SDL1.2 and 2.#, also openGL, but yeah, you generally need to get comfortable with CFFI for game-dev with CL).

  • @dreamingacacia
    @dreamingacacia 10 місяців тому

    since I'm using unreal, I guess I'd learn c++ sometime in the future. At first I was considering c++ and python, but what you've said make sense.

  • @armchair.9664
    @armchair.9664 10 місяців тому +2

    I work in the embedded software industry, and my impression of C++ is the exact same. Developers LOVE to over-complicate things with C++ and end up writing a whole lot of code that "shuffles papers around on the desk" rather than doing anything useful.

    • @Anubis1101
      @Anubis1101 10 місяців тому

      Many of the issues I've seen regarding bugs and bad practices can be traced back to poor teaching, both in learning and in the workplace. Too many programmers don't seem to care about efficient and maintainable code. Part of it might be the excessive ballooning of web development over software development during the pandemic, and performance isn't as important there.

  • @charliek5964
    @charliek5964 10 місяців тому +1

    Hey Tim. Have you ever worked with Python? We're workshopping adding it to my chemistry course for data processing. Just wondering if you have any tips or tricks (especially for teaching/learning Python).

    • @mandisaw
      @mandisaw 10 місяців тому

      Python has kind of taken the place of Fortran as the go-to for teaching code to scientists / (non-CS) science students. Lot of free cloud-notebook tools for a classroom or research lab setting, and a fair number of tutorials and case studies from colleges that have set it up. Not sure what country you're in, but I know for Google, they have their Python teacher-training resources online, and forums for researchers & educators (K-12 & higher ed) you can request access to. I believe AWS and Microsoft have their own communities, just don't know those as well.

    • @mandisaw
      @mandisaw 10 місяців тому +1

      You might find some use in resources put out by the big university systems as well, like MIT OpenCourseware and the R1 State universities.

  • @chocolate_maned_wolf
    @chocolate_maned_wolf 9 місяців тому

    Have you tried the new c++23 stuff? The template constraints are insanely powerful

  • @jakubpustulka
    @jakubpustulka 10 місяців тому

    Hi Tim Love your Channel. In relation to the amount of work programmers do we all suffer from back pain...Any recomendations for a healthier lifestyle as a programmer or anything like that?
    Cheers

  • @kaendor
    @kaendor 10 місяців тому +7

    Hi, given what you said about your prefered langages, I would strongly suggest to you to have a look if you have the time to Rust. Its stricter than C++, as close to the metal as C but can do high level abstraction too without worrying about abusing inheritance because there is none. There is however no engine as mature as unity or unreal but a nice one ECS oriented called Bevy is really promising ans open source.
    Thanks for your videos !

    • @gardian06_85
      @gardian06_85 10 місяців тому

      for games the Borrow Checker is the best and worst thing about Rust. and your "full compiled" blob size is massive unless you take the extra steps and "remake" each crate into your own codebase.
      Rust may be a lot better when they get a more fully featured "STD like" implementation (just rolling the 20-30 most used crates, and having them be "nearly" pre-compiled) where the program doesn't have to do 20 imports, and make a devils deal decision for which async implementation to use.
      there are still some things like "Linked List is impossible" and for all the "safety" Rust claims when there is a issue it hits hard, and can be destructive; the current "Borrow Checked Lifetime to Static" means the developer can 'skill issue' themselves into global static singleton.

  • @KenlieroGames
    @KenlieroGames 3 місяці тому

    Pascal was great. I had massive project with Delphi Pascal for 3 years... That is where I did my first 3D programming.... But I never finished project, lol.

  • @sushestvobezvolnoe
    @sushestvobezvolnoe 10 місяців тому +19

    C# is pretty well optimized and fast nowadays. But since it doesn't force to optimize usually the end result is worse. Imho, but i would rather use C# than C++ with STD.

    • @Validifyed
      @Validifyed 10 місяців тому +7

      C# is a pretty huge language. Many of the more functional and syntactically rich parts of the language (that I love, and use all the time) are also pretty slow. (Probably because they're trying to do as the functional languages do, but on mutable data).
      It's my favorite language because of its versatility. If I want to prototype something out real quick, it will let me do that. If I've run a profiler and need to come back and optimize, it will let me do that too.

    • @sealsharp
      @sealsharp 10 місяців тому +5

      Sadly, the mono runtime inside unity is the slowest way to execute C#. They are working on replacing that thing with CoreCLR ( fascinating blogposts about that) which is so much faster, but it's really not that simple because of the native-managed-interop.

    • @simulacrumgames
      @simulacrumgames 10 місяців тому +2

      Modern C++ can look so ridiculous and unintuitive nowadays. I really do like C#, and C++ isn't bad by any means (especially in the right hands), but if I could just have C with proper lambda functions... 😍

  • @Ramiobomb
    @Ramiobomb 9 місяців тому

    TBH, I'd wish we'd hear some words about Python and maybe compare it to C#. Also using Unreal, have to tried the Blueprint system?

  • @ignotlichitikus9314
    @ignotlichitikus9314 10 місяців тому

    interesting that STL didn't come with the source code, makes me wonder how they were provided back then,
    currently the entire STL is implemented in headers and we have access to all of its code, still can be hard to debug but the addition of static_asserts, concepts and proper tooling like the one provided by the latest visual studio we have much better experience debugging
    was expecting one of the reasons to not use STL was that they use standard allocators, with some work this could be partially solved by using std::allocator,
    most likely the same issue would be present with a custom implementation of these containers
    pretty cool how you used so many languages in a professional setting, I imagine you had to learn many things on the fly since many of these languages keep getting updated,
    C++ is still my favorite choice

  • @lovyNOM
    @lovyNOM 10 місяців тому +2

    what do you think about Zig? It's meant as a modern substitute for C

  • @TableHeroes2
    @TableHeroes2 10 місяців тому +2

    Truth is, C++ needs very good class documentation, especially if inheritance and overloading are widely used.
    Writing C++ classes and not writing the proper documentation for/in them, quickly leads to pain.

    • @theultimateevil3430
      @theultimateevil3430 10 місяців тому

      Shouldn't code be documentation by itself? What's the point in a programming language if we can just properly document assembly?

    • @wmidler
      @wmidler 10 місяців тому +2

      @@theultimateevil3430 the purpose of documentation is to tell the user of an interface how to use it, without requiring them to parse the entire implementation to understand how it works. Good programming interfaces should function as a black box-- try making that completely "self documenting" and you end up with 50-character function and parameter names.
      "just read the source" is not a valid defense of obscure interface design.

  • @bugothecatplays7864
    @bugothecatplays7864 9 місяців тому

    I end up starting a project in C++ and mostly writing C like code. I have an aversion of using every new feature possible, so unless I find a good use of something C++ specific, I'll stick to the most simple C-like code to solve the problem at hand.

  • @TheirSavior
    @TheirSavior 10 місяців тому +1

    You mentioned your experience with inheritance being abused. I'm sure there are other examples of projects where code works, but is hard to read, resulting in consequences later. Do you have any more experiences like that?
    If so, did these moments lead you to follow a system that keeps code maintainability in check?

  • @slayasloth
    @slayasloth 10 місяців тому +3

    As someone who’s younger, how did people like you learn to make games and program back in the day? I’m often so confused when older computer programmers say they just made a bunch of games and act like it was a seamless process. They seem to leave out the fact that they didn’t have the internet and sat there for hours. Did you learn just using books and just try all the commands and functions until something happened? Or was the lack of information not as bad as I’m assuming? Thanks

    • @mandisaw
      @mandisaw 10 місяців тому +3

      I'm a few years younger than Tim (started with BASIC in '87), but learning involved reading books, doing the exercises to understand the principles, and experimenting as you went along. You didn't really see source code for other people's work, esp commercial projects, so it was more like playing/using games & software and mentally deconstructing how it might work. (Or actually decompiling it, and reading the machine code - this was popular in hardware circles.)
      I think formal courses & teachers can be helpful, especially if you are completely new to programming. The structure & rigor can help you lock down the "boring but essential" stuff that online tutorials leave out.
      But learning to make software is the same as mastering any skill - you have to learn the basics, then it's loads of practice at deconstructing big ideas/problems into progressively smaller chunks. Once you know how to learn, you can learn anything - internet just gives you more tools to use.

    • @mandisaw
      @mandisaw 10 місяців тому +1

      To your point about sitting for hours - welcome to programming! LOL I still have to read esoteric documentation, release notes, library & API headers, communication with users & team members, etc whether it's for my day-job or my game projects. There are few careers more "never stop learning" than tech, and past the beginner/junior level you're usually learning on your own - few/no tutorials.

    • @slayasloth
      @slayasloth 10 місяців тому +2

      @@mandisaw ya for sure, thanks for the response! I like experimenting and spending hours on code but ya it’s just something I always couldn’t believe how anyone back in the day did it without the internet

    • @mandisaw
      @mandisaw 10 місяців тому

      @@slayasloth I wrote a nice response, but it seems YT ate it :( Short version is that we definitely had means to communicate with other hobbyists & pros, either at in-person clubs, through print magazines, or via the early-internet channels like Usenet.

    • @slayasloth
      @slayasloth 10 місяців тому

      @@mandisaw oh ok I see, sounds hard but still really interesting

  • @EuSouDallai
    @EuSouDallai 10 місяців тому

    Such a great video, Tim! As a developer, I wonder how difficult is to write my own engine. I'm pretty sure that is a very hard task. How do I even start creating something like a game engine?

    • @mandisaw
      @mandisaw 10 місяців тому +2

      The issue is less the complexity as the time/skillset. It can take years to craft a decent game engine for some specific use-case/genre. You'd have to learn to manage all the parts, incl graphics, sound, input, networking, scripting, design & editing-tools, asset import & build pipeline, etc. And you'd want to do that in such a way that you'll be able to run on your platform(s) of choice, even as it/they also develop & evolve (see Tim's vid from yesterday). You wouldn't even get started on your game until *after* the engine was mostly done.
      So the question that's generally asked is, "do you want to [learn to] build a game - or do you want to build an engine?" Because practically speaking, you'll really only get through one or the other.

    • @developerdeveloper67
      @developerdeveloper67 10 місяців тому

      Yes, it is very complex, and on top of that, there is a some, difficult for most, math you have to learn and get really used to: trigonometry and linear algebra, that is of course if you want to make 3D games from scratch. To start you should learn C, or C and then C++ if you want to learn C++. Then you should learn OpenGL, the best source today, the one that most people recommend is LearnOpenGL the website, look it up google, youtube don't let us post links.

  • @peanutbutteraddict22
    @peanutbutteraddict22 10 місяців тому +1

    My path rn, used to use c sharp in unity, currently using cpp in godot.

  • @muzboz
    @muzboz 10 місяців тому

    Are you interested in the ATARI 400 MINI at all? Seems like a really cute device for those who started out coding on the Atari range of home PCs. :D
    It's a small emulator/console (coming soon), comes with 25 built-in games, but also lets you run your own from USB, and outputs to HDMI, and supports programming in Basic, and an external keyboard. Very cute! :D

  • @fedeykin22
    @fedeykin22 10 місяців тому

    Hello Tim. I am curious if you would share your experience with "common" architectures in games like MVVVM, MVC, Three Tier Model etc.
    Is there one or more of these architectures that you would recommend. Also I am curious about your experience with writing unit tests and integration tests. Is there time to do it? is it prioritized? Should it be prioritezed?
    best Regards Jakob Arndal

  • @ashuggtube
    @ashuggtube 2 місяці тому

    I’m awfully late to this video as I joined the channel a few months ago and have been working backwards as well as watching all the new ones as they come out.
    I’m quite interested by which C++ compilers you’d looked at, Tim, where you said in the 90s or 2000s that the compilers had buggy optimisations and (initially) was slower? Microsoft, Borland, Watcom, DJGPP?
    And, more recently, which compilers have you used and been happy with?

    • @CainOnGames
      @CainOnGames  2 місяці тому +1

      Back then, I tested Microsoft, Borland, Watcom, and GCC. Watcom C was the fastest, and it had second monitor support (which was rare back then).
      These days, I just use Microsoft, for both C++ and C#.

    • @ashuggtube
      @ashuggtube 2 місяці тому

      @ thanks Tim!

  • @Me__Myself__and__I
    @Me__Myself__and__I 10 місяців тому

    Hey Tim, I'm curious which compiler were you using in the 2000s that had such buggy optimization? There used to be a rather large quality difference between compilers. Intel's compilers were some of the best for optimization. Microsoft compilers were some of the worst for almost everything. Microsoft's compilers were so bad the code often had to be written for a specific version of the compiler because MS couldn't be bothered with backwards compatibility. Borland's compilers were very good, not quite a good at optimizing as Intel's but decently good optimization while being very stable and highly compatible. In fact, most Borland developers had command line switches where they could compile in Microsoft mode for any version of most Microsoft compilers. So they even compiled code written for MS compilers way better than the Microsoft compilers could do.
    Another thing to consider though is that optimization in the late 90s / early 2000s became much more difficult. Intel processors were adding a bunch of new features and capabilities like branch prediction and caches to improve performance. Optimizing for those was quite difficult compared to older and simpler CPUs and it took awhile for compiler developers to get good at such optimizations. Plus some CPUs started adding new instruction sets that were much faster for certain operations but, of course, not all CPUs had those capabilities so now the code had to either be compiled for certain CPUs or be smart enough to swap out sections of the code depending on what CPU the code was running on.
    I don't think there is as much of a gap these days. Microsoft has thankfully cleaned up their mess quite well when they moved to .NET (and hired away all the best talent from Borland - which is probably why they improved).

  • @Jaqinta
    @Jaqinta 10 місяців тому

    Hello Mr Tim Cain ;
    I watched almost all of your videos and i'm one of your admirers (obviously :) ) If i had a chance to get your answer from one of my questions this is the one i really and really would like to know your opinion about .
    The question is , In your video you mentioned that Fallout 1 game engine is based on C and i just wondering how you guys managed simple actions needed for Fallout game is running ? I heard that from some software programmer correct me if it's wrong or not :) he says that suppose that there is one action you need to do soo you decided to program it with C programming language , in C programming language , you almost have to write your code one particular way soo if the person knows C and knows the problem then everyone can read the code behind it because it's easly readable . But in C++ , you can use multiple of approaches from that action soo you can write it in soo many ways even that coding in c++ seems easier than c programming language but if the original c++ coder is not available to show that code , the original programmer should make their code as clean as possible in order to make it easier to read from other c++ programmers .
    Thanks again for this amazing video :)
    Sincerely Jaqinta .

  • @Rodhern
    @Rodhern 10 місяців тому +3

    13:55 "C# was easy to learn, ... maybe because I learned it after C and C++". I have a different theory. You admitted to know Pascal. The same person that made one of the most popular Pascal compilers more or less decided the C# language design. To me there is a very strong commonality there (or at least there was when I looked at it, around the time when C# first came out).

  • @greebly6011
    @greebly6011 10 місяців тому

    I'm a novice programmer, I hear a lot of talk about super badass programmers wanting to be able to modify their engine or open source software but I would like to hear an actual example. When it comes to STL it makes sense, because when it was new there were problems with it that you would just need to fix and those are small enough things and concepts it shouldn't be too hard to work on. But I cannot fathom doing something like that on an unknown and bloated / possibly overcomplicated game engine like Unreal; maybe its because I just don't know how Unreal works well enough. I would love for someone with the experience to explain a specific thing they've changed about an engine (not inhouse) that they've modified and how that went.

    • @OpenGL4ever
      @OpenGL4ever 5 місяців тому

      Look at Star Citizen. They licensed the Crytek engine and then modified and changed it more and more every year to implement new features or do things differently. Then there was a lawsuit about it because they said they had basically rewritten the engine and thus called it differently.

  • @LTPottenger
    @LTPottenger 7 місяців тому

    Overloading should be used the same way on every object or it's a mess. It is needed sometimes in C++. Inheritance is great but C++ allows you to do it in stupid manners that should be illegal.

  • @theultimateevil3430
    @theultimateevil3430 10 місяців тому

    Compiler bugs are real! Just last year, I've had a bug in clang where the compiler wrongly optimized out a branch in a very trivial piece of code. Sometimes, -O0 is still a solution.

    • @OpenGL4ever
      @OpenGL4ever 5 місяців тому

      Nobody questions that. The real problem is how you handle it in the end. Shipping the code without optimization is lame.

  • @jamesrivettcarnac
    @jamesrivettcarnac 10 місяців тому +1

    4:11 well. That explains some things 😝

  • @riz5571
    @riz5571 10 місяців тому +1

    Hi Tim, software engineer (not in the gaming space) of 10+ years.
    I'm not that familiar with C# and definitely don't have any preference/bias towards it.
    Do you think the issues were due to C# or how Unity utilised it? I would assume that Unity would parse (or compile) C# and then pick up the bits it needed to be scripted for the engine - which I'd imagine could introduce its own overhead and issues.
    I might be wrong and wondering what you think?
    Also, another question.
    I've been a big proponent throughout my career (and when conducting interviews) that people should understand the fundamentals. I very often see candidates (or new employees) being very proficient in the tools yet when something goes wrong coming to a standstill.
    A specific example may be that someone can use the requests python library but doesn't understand any of the underlying calls (HTTP spec, C socks and beyond).
    I try to question if I'm interviewing but have push back from colleagues/superiors. But if I'm not interviewing, these candidates are being employed often.
    Thanks again for your uploads, content and consistency 😊

    • @riz5571
      @riz5571 10 місяців тому +2

      Apologies there's not much of a question there.
      I suppose my main issue (especially in the current climate) is people wanting to get things done without understanding any of the underlying tech/code/os etc.
      And then you see the abundance of learning material on the Web which feels only designed to teach the surface level without any understanding of the core.
      I've also spoken with many uni graduates in the UK who have gone through a similar learning experience.
      I never went to university, was an apprentice from 17. And therefore was always part of some sort of software team in every role going forward.
      Wondering your thoughts on this, even if in the game context. I understand it's relatively
      easy to learn how to use an off the shelf engine, but I'd presume the same applies if one gets stuck and then doesn't understand grasp the core concepts/tech (as you've touched upon in this and previous vid).

    • @honaleri
      @honaleri 10 місяців тому +2

      Colleges don't teach competency, at least not in America. Most American schools do not test for or care about a person's competency.
      They are rigidly designed around a getting over mindset, from elementary school up to college. They test and see if learning. markers have past, but do little to see if people comprehend anything.
      Give a person a test sheet and they'll fill in the blanks all correct. Ask them without paper to explain what something is or why it works, they will stutter and guess and collapse.
      Because they don't have competency, they have mostly basic sight based reflex to the data. Like being able to know a Chinese character reads "love" but not being able to write it from scratch without seeing it.
      They aren't being trained to push beyond the basics of sight based reflexive reasoning. They can't reasons from scratch.
      It's a pervasive American problem.
      Because our school system was designed to get as many kids to pass as possible, not to ensure as many understand as needed.

    • @mandisaw
      @mandisaw 10 місяців тому

      Re: C# & Unity - Early .NET compilers were kind of crap, which wasn't an issue for enterprise apps (desktop & server-side), but became more apparent when mobile & games came into the ecosystem. Microsoft has improved the compiler performance and C# itself considerably, however Unity is still using an older .NET runtime/standard (Mono) for maximum cross-platform compatibility.
      They are in the process of updating it to a version (CoreCLR) that will theoretically allow them to meet & keep up with modern .NET standards, while keeping their cross-platform nature (the engine's core strength). But it's a long-term project that they're a couple years into already.
      Keep in mind that the above only really applies to developer code and managed libraries - the engine itself uses native C++ on most platforms and devs can always write/use C++ plugins for stuff that needs that performance, like physics or netcode.

    • @riz5571
      @riz5571 10 місяців тому +1

      @mandisaw thanks, appreciate the reply. I was curious and not fancying digging into that world myself right now!

    • @mandisaw
      @mandisaw 10 місяців тому

      @@riz5571 Sure! Re: newer programmers - Unfortunately this is a common issue across tech (and not just in the US, @honaleri). Lot of components IMExp. First, few people genuinely value education - not students & parents, and not employers. They see HS/college as a route to social & economic opportunities - which it is! - but few have any patience or preference for learning itself. So corners get cut, people focus more on getting into the "right" school by name/rep vs a genuinely rigorous program, cheating abounds, and employers for their part are left to rely on poor substitutes like leetcode and narrow recruitment pools.
      Schools feed the problem in some [bad] cases - tech-career programs boost enrollment, and don't have the same infrastructure overhead as say, chem or bio. You can mostly get by with the same computer labs & Wi-Fi network that you'd already have. But I have seen/heard of some truly shoddy curricula, either grossly outdated, or missing fundamentals, or lacking in practical hands-on work like group/term projects. Don't get me started on "game design" or "IT support" programs.
      Math/innumeracy plays a part too. Some well-meaning schools rip out all the "hard math" from the curriculum, or offer with- & without-math variants. So you can get CS grads who know how to use Mathf.Sin[e] or Vector3, but have no idea what those words actually mean, or how to know which ones are eating your performance.

  • @michaelvicente5365
    @michaelvicente5365 10 місяців тому

    Hey Tim, what do you think about neural network AI NPCs? A lot of people (I think you included and josh sawyer) have mentioned it's the "future" of gaming, but I can't help but feel sad when I think about games I like if they were not written by actual writers. Good human writing is part of what makes the dialogues interesting to me, because they have a soul and, most importantly, a purpose. I feel like companies like Ubisoft are pushing AI like crazy because they want to overwhelm the player with content over quality, and I personally hate this idea. I know some NPCs are simple and repeat things (arrow in the knee style) but I actually don't think it's a bad thing. I'd rather have 5 interesting NPCs to focus on in a town, with interesting dialogues than have long generic conversations with everybody, wasting my time. Some dialogues in Fallout games made me laugh, smile, angry and part of me knows that it's because they're written with a mind behind them, not a mashup of data.

  • @catiperere
    @catiperere 8 місяців тому

    Your dog is making think that I leveled up on Kingdom Come Deliverance!!!!!!!!!!!!!

  • @wmidler
    @wmidler 10 місяців тому

    I think C would be about 10x easier for beginners if there were separate symbols for pointer declaration and dereferencing. The fact that you use the same symbol for turning a type into a pointer and turning a pointer back into a plain type is pretty insane.

    • @pyepye-io4vu
      @pyepye-io4vu 10 місяців тому

      The same symbol does make some sense.
      In the declaration: int *p; this means "*p is the int"
      In dereferencing: *p = 5; this means "the int *p is set to 5"
      Try to think of *p as "one thing" rather than two separate things.
      Unfortunately all 3 of these are valid in C: int* p, int * p, int *p.
      Initially I wanted to think of it as "int*" because I thought of that as "the type of p".
      But that's not the intuition for which it was designed.
      It was definitely designed for the intuition that "*p is the int".
      Then there are two different symbols: & for referencing (get the address of a value), and * for dereferencing (get the value of an address).

  • @shnargru
    @shnargru 9 місяців тому

    I'm really curious, what kind of SDLC works well with game development? Agile and Extreme Programming works great with business applications, but what works well for games?

  • @JavierBonnemaison
    @JavierBonnemaison 10 місяців тому

    I asked about refactoring in a previous video (particularly making sure that the code is understandable without tacit knowledge). Is it not common practice in your experience?

  • @gilgamecha
    @gilgamecha 10 місяців тому

    Tim I wonder what you think of go (golang)? Like a clean modern back to basics C.

    • @bionic_batman
      @bionic_batman 10 місяців тому +2

      I doubt he would be interested in it considering that Go is mostly only suitable for writing server side for multiplayer games
      I really love Go but it is nearly impossible to write a program that uses graphic card in pure Go without any C bindings

    • @gilgamecha
      @gilgamecha 10 місяців тому

      @@bionic_batman fair point

  • @arcan762
    @arcan762 10 місяців тому +2

    6:55 I see this one a lot too, I call it "technical masturbation"

    • @mandisaw
      @mandisaw 10 місяців тому

      Perl is both the best & worst language for this LOL It did teach me regexp though, so for that I'll always have a fond memory of Perl.

  • @10bokaj
    @10bokaj 10 місяців тому

    Have you tried the C/C++ replacement langs, like JAI, ZIg, Odin, Rust?

  • @twotamatos
    @twotamatos 9 місяців тому

    Yah I’m learning python I started by learning a bit of coding for a Pokémon fan game but then found u can use it for so much else I’m very optimistic if u go to the proper school, have the correct friends or even the right initiative u don’t even need to be a mathematician it looks super complex and computer science is but it is the foundation of so many things you can do so much with code cuz u know how websites r made n what not. That’s where u start seeing how hacking comes into play in fallout awful mini game that intimidates people from taking science XD but yah it won’t be what I specialize in but for a few things like site design game developing it is gonna be a mile stone I gotta get past. I’m really lucky my dad did a lot of computer stuff back in the day cuz he gave me some great genes I just picked up scripts oh it’s in the name like we read the code off a script right n then we change a few variables and it runs a scripted event in some instances but that’s where I never thought I could have the aptitude to do this but u my good sir are one of the sole inspirations if you have a passion just flat out knowing most computer scientist only have 4-10 years of training and now that u found ur interest u can learn it n that’s a really powerful thing man idk if I could have stayed on that path without hearing a dev like you say that simple phrase if u want to get into it now is the time more then any god how the tools have been developed and they r still improving everyday evolution in like 5-10 years at a time in motion

  • @Woodythehobo
    @Woodythehobo 10 місяців тому +4

    Another great vid. For me: I used Unity C# for many years until I finally got fed up of the engine. Often their 1st party modules would be half-baked or outright broken. Felt like you had to use marketplace addons to fill in the gaps, which added to project bloat and load times. Engine patches would randomly break my projects and cause new bugs. They removed/altered features I used such as GI. Tutorials online are mostly outdated and unusable. Outdated docs. Terrible licensing decisions was the final nail in the coffin. Frustrating. Then FINALLY moved to Unreal 5 when 5.1 launched, it was unbelievably refreshing. Hardly any bugs. Core engine ton of features. C++ isn’t too bad to learn vs C#. Blueprints visual scripting is incredibly solid for rapid prototyping. Old tutorials still work with very minor adjustments. Great performance. Awesome built in features like nanite, lumen, metahumans, quixel megascan etc. Fair licensing. Overall Unreal is a joy to use, which IS important for hobbyists because we want to enjoy it!

    • @Anubis1101
      @Anubis1101 10 місяців тому

      Yea the pricing fiasco gave me the push I needed to finally break away from it, and I'm glad I did.

    • @fsharplove
      @fsharplove 10 місяців тому

      Does Unity still using a very old version of C# ? Last time I checked they were using a very old mono base version while Godot was offering the latest one.

  • @polygonpanda
    @polygonpanda 10 місяців тому

    I'm confused by the idea that a C++ template library wouldn't come with source code, since template functions are written in header files and compiled at compile time using template replacement it seems they must expose their implementations.

  • @Tom-f4d6l
    @Tom-f4d6l 10 місяців тому

    How would you modify assembly in a program as a part of a CI/CD pipeline? is it that consistent? I feel like even if I knew the fix I would get chewed out by lead for doing that since I'm introducing a manual (and error prone because I might forget) process into making a build. Personally I can understand not bothering to learn or figure out a solution that doesn't work well with your processes (although I think its always good to have more options to solve problems).

    • @mandisaw
      @mandisaw 10 місяців тому

      I don't think Tim's advocating for modifying the output assembly code, more like using that as a debugging tool. Essentially start from there and backtrack to where the problem lies. Even if the problem turns out to be in the compiler/build-command, that's something that could be amended/updated in your CI/CD pipeline.

    • @mandisaw
      @mandisaw 10 місяців тому

      As for getting chewed out by the lead for solving a problem - generally you'd have already discussed the priorities (this vs something else) and be working on this with your lead's blessing. But that's in a team with a good working-relationship, which admittedly isn't the case everywhere.

    • @Tom-f4d6l
      @Tom-f4d6l 10 місяців тому

      @@mandisaw I was assuming Tim was modifying the output assembly (which isn't something I would normally expect, but he did say he had done work in assembly before). but using a pragma to turn off optimization or just not using certain optimization flags in your code would (I would think, i don't work in c++ daily) be the maintainable way to work around this issue.

    • @mandisaw
      @mandisaw 10 місяців тому

      @@Tom-f4d6l IIRC his whole point was not to just workaround it by turning off -O flags, but to actually uncover & address the cause. Looking over the machine code was the means to achieve that.

    • @Tom-f4d6l
      @Tom-f4d6l 10 місяців тому +1

      @@mandisaw Well, I am exaggerating when I say I would get chewed out; it would be more like I would have a long conversation about why what I did doesn't work when a simple "don't do that" would suffice. Personally and currently I have a great working relationship with my leads and leadership (and that is in no small part due to the work my leads put into maintaining that relationship... and some institutional trauma from that not always being the case). And while I can see a team prioritize 'making it work' over 'making it maintainable' I'm pretty confident that should be an exception rather than the rule. I find that in software development you can really be too smart for your (teams) own good. If the seniors are writing code the juniors can't work in and maintain, you are basically making tech-debt. I think most teams would prefer to optimize code for maintainability rather than for performance and that's mostly the right choice given the power of modern computer hardware.

  • @jthemagicrobot3960
    @jthemagicrobot3960 9 місяців тому

    Wow I remember some of these languages

  • @MrJballn
    @MrJballn 10 місяців тому

    To frame the question, there were a large number of designers and programmers working in the industry that had worked with you/under your philosophy at studios you'd left (and studios you'd yet to join) that made games that still "feel" like other Tim games. Is there a level of tribalism in the industry that results in emerging developers identifying strongly with a certain power player or paradigm, or is it more the upshot of lingering culture changes you'd effected on an institutional basis that just happened to stick with them?

  • @EdgarVerona
    @EdgarVerona 10 місяців тому +4

    Agreed 100% about C++, and I would add "egregious use of template metaprogramming" and "code generating macros" to ways in which C++ features can be abused to create utterly unreadable code.

  • @philbertius
    @philbertius 10 місяців тому +4

    JVM (Java and Kotlin) doesn’t support C# structs, but it’s caught up to C++ performance due to Just-In-Time compilation. And you can abuse sun.misc.Unsafe for straight up memory management and pointer manipulation. Anything you need SIMD/AVX vectorization for you can do in C++ and invoke with JNI.
    As an indie I value my own time more than absolutely best theoretical performance, so it’s definitely going to be more modern languages for me. But the fundamentals are always important, even more so when the language itself doesn’t respect them! (Looking at you, Python!)

    • @mandisaw
      @mandisaw 10 місяців тому +3

      "Value my own time more" This! Indie or AAA, games or business software, labor is ultimately the costliest resource. A modest amount of performance-minded coding, with decent project architecture, is warranted, but IMExp even on mobile, the engine & OS do a good-enough job for most scenarios.
      I do think anyone wanting to work in software should learn C as a matter of course. Some principles are just easier to teach & learn in C, like memory-management and pointers, data structures (arrays, queues, vectors, etc), values vs reference, etc. There are also good, unfilled jobs in embedded systems and true high-performance, mission-critical domains (e.g. NASA/space, defense, healthcare) where C is still king.

  • @slowfuse
    @slowfuse 10 місяців тому

    7:52 maybe it will call the base function MAYBE it wont. Ahh a fellow programmer...

  • @zupcis
    @zupcis 10 місяців тому

    Hi, Tim. I was wondering about your opinion about current active rpg game developers like bethesda, larian, inexile, obsidian, bioware? Do you see any other rising stars, that will make the future of rpg genre?

    • @zupcis
      @zupcis 10 місяців тому

      Sorry forget about code project red and piranha bytes

  • @ClintChocolateChip
    @ClintChocolateChip 10 місяців тому

    Hi, Tim! May I ask your opinions on using tools like Unity to make games?

    • @CainOnGames
      @CainOnGames  10 місяців тому

      Game Engines
      ua-cam.com/video/Iw3bCdIvAj0/v-deo.html

  • @TheKorath
    @TheKorath 10 місяців тому

    If you did write in a low level language again like C/C++ would you write your own libraries or would you use something like SDL?

  • @renaigh
    @renaigh 10 місяців тому +12

    C-tier video

  • @entorwellian
    @entorwellian 10 місяців тому

    Yo Tim, what is a quaternion?

  • @1Tasteless
    @1Tasteless 10 місяців тому +3

    C# was my first language. Definitely very easy to get started with.