C++ is the superior language - And I’m tired of pretending it’s not.

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
I am OK with typescript tbh. Had to work with it at ton recently, and having a node typescript backend vs a pydantic fastapi backend, for me theres no real difference. I work on prototype and MVP dev though, so I'm rarely involved with optimization or prod deployments. I should ask how those teams feel lmao.

I have been writing some Go also, and I happen to like it as well. Tbh I like pretty much every language i have worked with. Maybe I'm a retard.
What you like as the developer does not equate to me as the consumer.

I want to read a news article. I don't want it to reload a thousand times because you can't get your threading and advertisers to align at even a basic level.

If your shitty advertising causes my page to jump up or down while I am reading it, then I am blocking all advertising.
 
  • Agree
Reactions: Ombatubus
What you like as the developer does not equate to me as the consumer.

I want to read a news article. I don't want it to reload a thousand times because you can't get your threading and advertisers to align at even a basic level.

If your shitty advertising causes my page to jump up or down while I am reading it, then I am blocking all advertising.
That's just bad HTML/CSS having the content define the size of the ad container. Even Google discriminates in ranking for this behavior.
 
it doesn't matter what language you use (as long as it doesn't start with the letter p)

what matters is what you build and what you get in the end, that's it

sperging about muh scripting muh webshit muh rust is mega retarded
What do you have against PASCAL?
 
I'm late to the thread and was originally going to give detailed responses that would ultimately be read and responded to by no one but instead I just figured a lot of you might get a kick out of this old, apparently very Jewish book based on the authors' names, called The Unix-Haters' Handbook, which is a bit of a mix of a funny roast acknowledged by Dennis Ritchie himself and an actual serious critique:
https://web.mit.edu/~simsong/www/ugh.pdf (ugh? anyway)
One of the laments against Unix (and by extension C and C++) that hasn't become obsolete is that it deals so much in lots and lots of text rather than a more highly abstracted system like Smalltalk where everything is based on what I understand to be a biologically inspired model of objects that should need worry about only their own internal state and so are like living cells and message passing is the intercellular communication that makes programs run effectively. While I think that's a brilliant concept, I have dicked around with the modern Smalltalk implementation Pharo a bit and constantly I was always wanting grep and find and other such raw text-oriented tools at my disposal. IIRC, one of the reasons observers said that Smalltalk didn't achieve what it maybe ought to have is because of the extremely insular virtual machine/virtual image model it has (with a few exceptions like GNU Smalltalk) that basically makes itself its own operating system everywhere it goes. Maybe that could have rocked if everyone went along with it but we didn't. Here's a paper on implementing neural networks in Pharo Smalltalk:
Head on down to pages 29 through 31 (as labeled in the document) and tell me that isn't a fucking clumsy way of interacting with the host file system not well-integrated into the overall programming environment of Pharo. For the longest time Git / GitHub integration wasn't all there too and even now certain things aren't super obvious like they should be. If I wanted to put a Pharo implementation of Project Euler solutions on my GitHub, what would be the best way of putting needed input files on there? I'm still not entirely certain. With Python or Ruby or anything else, though they have their own debts to Smalltalk, I have already done this and it's as simple as putting a corresponding text file in the same directory as the code. Consider also what I posted just yesterday:
That was me pretty casually using a combination of Unix text tools, the text-oriented Unix file system and Python which is an OO language partly inspired by Smalltalk but still playing ball with the overarching system to quickly figure out how many times there were attempts to pwn me in a few weeks and from where. Doing the same in Pharo would be a bit of a research project, beginning with figuring out how I want to use VNC or the like instead of hammering shell and Vim commands into the remote terminal. Perhaps Bjarne Stroustrup's dictum is true: "There are only two kinds of languages: the ones people complain about and the ones nobody uses."
c++-bjarne-stroustrup-book-forest-fire.png
 
One of the laments against Unix (and by extension C and C++) that hasn't become obsolete is that it deals so much in lots and lots of text rather than a more highly abstracted system like Smalltalk where everything is based on what I understand to be a biologically inspired model of objects
Working with text in Unix is just a natural design decision when you're typing commands into a terminal, when you're working to create more complex compositions of commands it falls apart, which is a consequence of the design. In functional wank land they're more interested in designing systems that no one wants to use, in Unix it was about designing a system to fit a particular problem (how do we use a terminal efficiently?). In simplified terms it's research (smalltalk) vs engineering (unix/c). In an ideal world the text output from a command piping into a terminal would be a particular view of the output of a computation, not the output itself, meaning you can 'grep x < file.txt' in a terminal to get a text representation of matches, but you could also use grep as a component of a larger composition of commands and use the output struct 'struct { char** matches }' to work with memory and not the text representation of the memory, making it much more maintainable than using a sh script. There is a large cost to doing it this way, which is why in the past you used the terminal to hack it and you used C when writing more complex programs that weren't efficient to write in a terminal. This is all to say that the separation between terminal commands and a program (C) is antiquated in the modern world, but no one has bothered to re-engineer the design for the powerful machines we have today.
 
  • Informative
Reactions: Belisarius Cawl
This is all to say that the separation between terminal commands and a program (C) is antiquated in the modern world, but no one has bothered to re-engineer the design for the powerful machines we have today.
It sounds like you're actually describing what is now PowerShell but Microsoft still hasn't made it fully cross-platform in the same way that you can't just run C# LINQ queries using .NET Core or Mono. Again, it could be really sweet in principle but the documentation and so forth isn't all there.
 
  • Thunk-Provoking
Reactions: Jones McCann
it doesn't matter what language you use (as long as it doesn't start with the letter p)
I was going to try and make a case for Prolog but then I realised, no - Haskell is better. :)

PHP did actually turn into a pretty solid language from around version 7 onwards. It's on 8.3 now and has a lot of good features and some of its worse inconsistencies finally sanded away. It also goes like shit off a shovel these days if set up right. But the reputational damage was done long ago. Anyway, back on topic, I'm surprised nobody has posted the old spoof interview with Bjarne Stroustrup.
On the 1st of January, 1998, Bjarne Stroustrup gave an interview to the IEEE's Computer magazine. Naturally, the editors thought he would be giving a retrospective view of seven years of object-oriented design, using the language he created. By the end of the interview, the interviewer got more than he had bargained for and, subsequently, the editor decided to suppress its contents, 'for the good of the industry' but, as with many of these things, there was a leak. Here is a complete transcript of what was was said, unedited, and unrehearsed, so it isn't as neat as planned interviews. You will find it interesting...


Interviewer: Well, it's been a few years since you changed the world of software design, how does it feel, looking back?

Stroustrup: Actually, I was thinking about those days, just before you arrived. Do you remember? Everyone was writing 'C' and, the trouble was, they were pretty damn good at it. Universities got pretty good at teaching it, too. They were turning out competent - I stress the word 'competent' - graduates at a phenomenal rate. That's what caused the problem.

Interviewer: Problem?

Stroustrup: Yes, problem. Remember when everyone wrote Cobol?

Interviewer: Of course, I did too

Stroustrup: Well, in the beginning, these guys were like demi-gods. Their salaries were high, and they were treated like royalty.

Interviewer: Those were the days, eh?

Stroustrup: Right. So what happened? IBM got sick of it, and invested millions in training programmers, till they were a dime a dozen.

Interviewer: That's why I got out. Salaries dropped within a year, to the point where being a journalist actually paid better.

Stroustrup: Exactly. Well, the same happened with 'C' programmers.

Interviewer: I see, but what's the point?

Stroustrup: Well, one day, when I was sitting in my office, I thought of this little scheme, which would redress the balance a little. I thought 'I wonder what would happen, if there were a language so complicated, so difficult to learn, that nobody would ever be able to swamp the market with programmers? Actually, I got some of the ideas from X10, you know, X windows. That was such a bitch of a graphics system, that it only just ran on those Sun 3/60 things. They had all the ingredients for what I wanted. A really ridiculously complex syntax, obscure functions, and pseudo-OO structure. Even now, nobody writes raw X-windows code. Motif is the only way to go if you want to retain your sanity.

Interviewer: You're kidding...?

Stroustrup: Not a bit of it. In fact, there was another problem. Unix was written in 'C', which meant that any 'C' programmer could very easily become a systems programmer. Remember what a mainframe systems programmer used to earn?

Interviewer: You bet I do, that's what I used to do.

Stroustrup: OK, so this new language had to divorce itself from Unix, by hiding all the system calls that bound the two together so nicely. This would enable guys who only knew about DOS to earn a decent living too.

Interviewer: I don't believe you said that...

Stroustrup: Well, it's been long enough, now, and I believe most people have figured out for themselves that C++ is a waste of time but, I must say, it's taken them a lot longer than I thought it would.

Interviewer: So how exactly did you do it?

Stroustrup: It was only supposed to be a joke, I never thought people would take the book seriously. Anyone with half a brain can see that object-oriented programming is counter-intuitive, illogical and inefficient.

Interviewer: What?

Stroustrup: And as for 're-useable code' - when did you ever hear of a company re-using its code?

Interviewer: Well, never, actually, but...

Stroustrup: There you are then. Mind you, a few tried, in the early days. There was this Oregon company - Mentor Graphics, I think they were called - really caught a cold trying to rewrite everything in C++ in about '90 or '91. I felt sorry for them really, but I thought people would learn from their mistakes.

Interviewer: Obviously, they didn't?

Stroustrup: Not in the slightest. Trouble is, most companies hush-up all their major blunders, and explaining a $30 million loss to the shareholders would have been difficult. Give them their due, though, they made it work in the end.

Interviewer: They did? Well, there you are then, it proves O-O works.

Stroustrup: Well, almost. The executable was so huge, it took five minutes to load, on an HP workstation, with 128MB of RAM. Then it ran like treacle. Actually, I thought this would be a major stumbling-block, and I'd get found out within a week, but nobody cared. Sun and HP were only too glad to sell enormously powerful boxes, with huge resources just to run trivial programs. You know, when we had our first C++ compiler, at AT&T, I compiled 'Hello World', and couldn't believe the size of the executable. 2.1MB

Interviewer: What? Well, compilers have come a long way, since then.

Stroustrup: They have? Try it on the latest version of g++ - you won't get much change out of half a megabyte. Also, there are several quite recent examples for you, from all over the world. British Telecom had a major disaster on their hands but, luckily, managed to scrap the whole thing and start again. They were luckier than Australian Telecom. Now I hear that Siemens is building a dinosaur, and getting more and more worried as the size of the hardware gets bigger, to accommodate the executables. Isn't multiple inheritance a joy?

Interviewer: Yes, but C++ is basically a sound language.

Stroustrup: You really believe that, don't you? Have you ever sat down and worked on a C++ project? Here's what happens: First, I've put in enough pitfalls to make sure that only the most trivial projects will work first time. Take operator overloading. At the end of the project, almost every module has it, usually, because guys feel they really should do it, as it was in their training course. The same operator then means something totally different in every module. Try pulling that lot together, when you have a hundred or so modules. And as for data hiding. God, I sometimes can't help laughing when I hear about the problems companies have making their modules talk to each other. I think the word 'synergistic' was specially invented to twist the knife in a project manager's ribs.

Interviewer: I have to say, I'm beginning to be quite appalled at all this. You say you did it to raise programmers' salaries? That's obscene.

Stroustrup: Not really. Everyone has a choice. I didn't expect the thing to get so much out of hand. Anyway, I basically succeeded. C++ is dying off now, but programmers still get high salaries - especially those poor devils who have to maintain all this crap. You do realise, it's impossible to maintain a large C++ software module if you didn't actually write it?

Interviewer: How come?

Stroustrup: You are out of touch, aren't you? Remember the typedef?

Interviewer: Yes, of course.

Stroustrup: Remember how long it took to grope through the header files only to find that 'RoofRaised' was a double precision number? Well, imagine how long it takes to find all the implicit typedefs in all the Classes in a major project.

Interviewer: So how do you reckon you've succeeded?

Stroustrup: Remember the length of the average-sized 'C' project? About 6 months. Not nearly long enough for a guy with a wife and kids to earn enough to have a decent standard of living. Take the same project, design it in C++ and what do you get? I'll tell you. One to two years. Isn't that great? All that job security, just through one mistake of judgement. And another thing. The universities haven't been teaching 'C' for such a long time, there's now a shortage of decent 'C' programmers. Especially those who know anything about Unix systems programming. How many guys would know what to do with 'malloc', when they've used 'new' all these years - and never bothered to check the return code. In fact, most C++ programmers throw away their return codes. Whatever happened to good ol' '-1'? At least you knew you had an error, without bogging the thing down in all that 'throw' 'catch' 'try' stuff.

Interviewer: But, surely, inheritance does save a lot of time?

Stroustrup: Does it? Have you ever noticed the difference between a 'C' project plan, and a C++ project plan? The planning stage for a C++ project is three times as long. Precisely to make sure that everything which should be inherited is, and what shouldn't isn't. Then, they still get it wrong. Whoever heard of memory leaks in a 'C' program? Now finding them is a major industry. Most companies give up, and send the product out, knowing it leaks like a sieve, simply to avoid the expense of tracking them all down.

Interviewer: There are tools...

Stroustrup: Most of which were written in C++.

Interviewer: If we publish this, you'll probably get lynched, you do realise that?

Stroustrup: I doubt it. As I said, C++ is way past its peak now, and no company in its right mind would start a C++ project without a pilot trial. That should convince them that it's the road to disaster. If not, they deserve all they get. You know, I tried to convince Dennis Ritchie to rewrite Unix in C++.

Interviewer: Oh my God. What did he say?

Stroustrup: Well, luckily, he has a good sense of humor. I think both he and Brian figured out what I was doing, in the early days, but never let on. He said he'd help me write a C++ version of DOS, if I was interested.

Interviewer: Were you?

Stroustrup: Actually, I did write DOS in C++, I'll give you a demo when we're through. I have it running on a Sparc 20 in the computer room. Goes like a rocket on 4 CPU's, and only takes up 70 megs of disk.

Interviewer: What's it like on a PC?

Stroustrup: Now you're kidding. Haven't you ever seen Windows '95? I think of that as my biggest success. Nearly blew the game before I was ready, though.

Interviewer: You know, that idea of a Unix++ has really got me thinking. Somewhere out there, there's a guy going to try it.

Stroustrup: Not after they read this interview.

Interviewer: I'm sorry, but I don't see us being able to publish any of this.

Stroustrup: But it's the story of the century. I only want to be remembered by my fellow programmers, for what I've done for them. You know how much a C++ guy can get these days?

Interviewer: Last I heard, a really top guy is worth $70 - $80 an hour.

Stroustrup: See? And I bet he earns it. Keeping track of all the gotchas I put into C++ is no easy job. And, as I said before, every C++ programmer feels bound by some mystic promise to use every damn element of the language on every project. Actually, that really annoys me sometimes, even though it serves my original purpose. I almost like the language after all this time.

Interviewer: You mean you didn't before?

Stroustrup: Hated it. It even looks clumsy, don't you agree? But when the book royalties started to come in... well, you get the picture.

Interviewer: Just a minute. What about references? You must admit, you improved on 'C' pointers.

Stroustrup: Hmm. I've always wondered about that. Originally, I thought I had. Then, one day I was discussing this with a guy who'd written C++ from the beginning. He said he could never remember whether his variables were referenced or dereferenced, so he always used pointers. He said the little asterisk always reminded him.

Interviewer: Well, at this point, I usually say 'thank you very much' but it hardly seems adequate.

Stroustrup: Promise me you'll publish this. My conscience is getting the better of me these days.

Interviewer: I'll let you know, but I think I know what my editor will say.

Stroustrup: Who'd believe it anyway? Although, can you send me a copy of that tape?

Interviewer: I can do that.


It sounds like you're actually describing what is now PowerShell but Microsoft still hasn't made it fully cross-platform in the same way that you can't just run C# LINQ queries using .NET Core or Mono. Again, it could be really sweet in principle but the documentation and so forth isn't all there.
Powershell is pretty good imo but it's a bit of an odd fit for Linux even if made to work. Windows as an OS is Object Orientated top to bottom. Every part of it is exposed as an object and supports pipelining objects. Powershell is spot on for that. But Linux environments, especially if working with GNU tools, not so much. Of course that's what SystemD is trying to turn Linux into but anyway... I've gotten off-topic. My own system programming days are probably gone and never to return and I get increasingly out of date every year. I could probably just about still program in C++ if I had to.
 
  • Informative
Reactions: N Space
I was going to try and make a case for Prolog but then I realised, no - Haskell is better.
One of my friends who is by no means dumb or a noob (a graduate researcher in CS in fact) was trying to get into Haskell but finally called it quits when he found out that writing the Sieve of Eratosthenes (an otherwise easy and therefore inefficient algorithm for enumerating prime numbers) properly therein was the subject of a research paper:
I don't know why people insist on doing stupid shit like this instead of just defaulting to immutable data structures and letting the user decide whether to easily override that default like OCaml, F# and Scala.
 
  • Thunk-Provoking
Reactions: Overly Serious
One of my friends who is by no means dumb or a noob (a graduate researcher in CS in fact) was trying to get into Haskell but finally called it quits when he found out that writing the Sieve of Eratosthenes (an otherwise easy and therefore inefficient algorithm for enumerating prime numbers) properly therein was the subject of a research paper:
I don't know why people insist on doing stupid shit like this instead of just defaulting to immutable data structures and letting the user decide whether to easily override that default like OCaml, F# and Scala.
I can tell that paper is written by a mathematician because on page 8 it says "I will leave experimenting with larger wheels and writing code to generate those wheels as a recreational exercise for the reader." :D

But in defence of it, I'll point out that most of that paper is about producing an optimised version of the sieve, not simply implementing it of which there is a 2 line version on page 1. They just think this is a flawed implementation even though it does work. For fun I tried out an immutable array approach vs. a mutable unboxed array approach. BOTH in Haskell, yoinked from here: https://rosettacode.org/wiki/Sieve_of_Eratosthenes#Standard_Library

For all primes from 2...1,000,000,000 the mutable version took 8.972 seconds vs. 48.131 seconds for the immutable. And for fun, I tried one of their basic Python versions (using array lookup) and it took 2 mins and 29 seconds and amazingly the C++ version also took 2mins and 29 seconds!

They must be doing very different things underneath, I didn't bother looking at the algorithms that closely just taking ones from each language. But there was only one given for C++. I don't think I made a mistake anywhere - they all give the same number of primes found up to 1 billion.
 
  • Like
Reactions: Belisarius Cawl
it doesn't matter what language you use (as long as it doesn't start with the letter p)

what matters is what you build and what you get in the end, that's it

sperging about muh scripting muh webshit muh rust is mega retarded
Delphi. Oh dear.
 
Back