Rincewind
Magister
Did you read the entire book? I've read people say the first three chapters are good enough.
The more you do, the better. But don't just read, do the exercises, otherwise you will gain just like 20% of the benefits.
Did you read the entire book? I've read people say the first three chapters are good enough.
While you are right in saying languages are just tools, programming is not easy and doing it well is actually quite difficult. There is real value in simplicity, brevity and getting shit done. When you start you don't know what pattern is useful and what functionnality is to be avoided in 99.9% of the cases. Learning with Python or Racket is great because you will roll out working code quickly, play with it, and then be able to reproduce it in other context or language. In the end I believe that good coding is independant from the language. Good coding is finding the simplest way to change your inputs into your desired output. It's finding the best path from your ideas to the end program. Some languages make it easier than the others, and are thus more suitable for beginners.I don't know why the language would do that, it's more about what the programmer is going to do. If anything C++ teaches you to avoid bad programming the hard way.
If anything C++ teaches you to avoid bad programming the hard way.
Anyone here big on the Scala/Haskell train?
Functional programming is a solid approach. Thinking you need a purely functional language to get the benefits is not.Anyone here big on the Scala/Haskell train?
Decided I need to do some stuff in a language that doesn't look like my job, and hey the "objects and Java were all a giant mistake" guys seem to have it right.
Go is basically just one guy enforcing his C++ opinions at the compiler level. Surprisingly it hasn't come up much in this thread. Though it isn't really for games.If anything C++ teaches you to avoid bad programming the hard way.
I'd say C++ is the ultimate goldmine to pick up horrible habits. The vast multitude of ways how you can shoot yourself in the foot is actually truly impressive, especially for a beginner. But even among pros, teams usually agree on which 20-30% of the language to use, otherwise things quickly devolve into chaos. There's good reason why C++ style guides like this exist.
But maybe you're saying the same thing? I just don't think anybody should be forced to go through that crap unnecessarily, especially if there are other languages that do the job better and with much less pain.
Btw, Tundra is a quite nice example of a well-written codebase in a minimalistic sane subset of C++. If I had to touch C++ ever again, I'd pick a style resembling something like that.
He's writing the game in C++. His videos are interesting, but it'll be a millennia until he finishes the game.
I guess if you have a super computer at Google it works, but it's just not practical with a home computer.
If you're serious about programming, a language that programs the actual computer rather than a virtual machine or an interpreter will bring you the greatest benefits, compounded over time.
Delphi generates very inefficient code though (source : joined a team to work on a major RTS title in Delphi in the past).
Though I don't know if Go code is good
Programming the "actual computer" is a rabbit hole... Even assembly is not exactly what used to be these days (there's lots of magic happening behind the scenes in Intel CPUs, assembly these days is actually more or less a "high level" interface to the underlying CPU; it presents the familiar "x86 facade" to you that you can use, but the real thing at the lowest level is quite a bit different).
Converting x86 assembly to microcodes was a thing even in the mid-90s anyway but that was never really relevant since what you use to program the chip isn't those microcodes but the x86 instruction set - the microcodes are just an implementation detail, the chip itself is programmed in x86. It isn't like in older much simpler chips you work with the semiconductors directly anyway.
You can't even control electrons one by one with C, so why even bother? Why not just do your coding by doing shitposts on Codex and use GPT-4 to convert those to executable programs. (It's gonna be like Siege of Dragonspear, but even better.) Maybe some abstraction levels are just about right for many people?Converting x86 assembly to microcodes was a thing even in the mid-90s anyway but that was never really relevant since what you use to program the chip isn't those microcodes but the x86 instruction set - the microcodes are just an implementation detail, the chip itself is programmed in x86. It isn't like in older much simpler chips you work with the semiconductors directly anyway.
True, I was just trying to illustrate the point that you can't go "all the way down" when you want to hit the bare metal. But good points.
It's similar to the story I bring up with people who want to write every single line of code themselves and never use libraries. "Ok, but you're still using the OS, so why don't you write your own OS, so that you have more control? Better yet, why not design your own CPU? Or why even stop there, why don't you go mine your own silicon? Of course, that's not ultimate enough, you're still using tools built by others for the mining... But what if... " etc It never ends, and ultimately you'll have to rely on others at some point.
Delphi generates very inefficient code though (source : joined a team to work on a major RTS title in Delphi in the past).
Though I don't know if Go code is good
The code is good enough for 99.9% of the uses, as long as your architecture isn't bad you can optimize the slow parts manually (and if your architecture is bad, it'll be bad with a C++ compiler too).
True, I was just trying to illustrate the point that you can't go "all the way down" when you want to hit the bare metal.
I think there's a sweet spot, and the case of higher abstraction isn't as strong or a no-brainer as it might appear: Given the size of the software industry and the shitty state of modern software, it is trivial to see that productivity per programmer is at an all-time low.
given that inline assembly is a thing in C, "inline C" should have been a thing in higher-level languages.
It's similar to the story I bring up with people who want to write every single line of code themselves and never use libraries.
optimising LISP compilers often approach or sometimes even surpass the performance of the equivalent C code
The sensible approach is to write number-crunching stuff in C or something low-level, then the rest in something much nicer. Some commercial examples that do heavy number crunching is Adobe Lightroom (C++ image manipulation code and some OS interfacing, everything else including the GUI in Lua) and Bitwig Studio (DSP in C++, the GUI and everything else in some heavily restricted subset of Java).
I see your points, but I would suggest that this example proves my point more than yours: What makes these programs *are* the hard, performance-sensitive parts they contain. If you acknowledge that you can't use Python, Java, or JavaScript for performance-sensitive work, but that you can (but shouldn't) use C for stuff like GUI, this is the same as saying these languages aren't as powerful as C. Keep in mind that I did not say other languages aren't worth learning, only that C would provide a programmer with the most programming power over time.
There is nothing wrong with sticking with something like Lua or LuaJIT if all you foresee to be doing is GUI or scripting work.
Seriously no, Delphi was unable to generate half-decent x87 FPU code and was very bad at inlining. Just porting the code to a C++ compiler was a huge gain (and then doing SIMD).
So I'd agree it's enough provided you don't need to crunch numbers.
Umm, quite the opposite:
Powerful is a matter of definition, to me Haskell/Scala/LISP are powerful as in "power of expressivity" of the language. These languages allow me to think "different thoughts", at higher abstraction levels, hence they're more powerful in my view. I wouldn't really call C powerful, in comparison to pretty much everything else it's quite pedestrian. Sure, it's just capable of utilising all (or most) features of the hardware and you can control the memory layout, but that's about it. I still maintain my view that it's a sort of a high-level cross-platform assembler.