Is C++ a 'Really Terrible Language'? (gamesindustry.biz)
Long-time Slashdot reader slack_justyb writes, "Jonathan Blow, an independent video game developer, indicated to gamesindustry.biz that while working on a recent project he stopped and considered how miserable programming can be. After some reflection Blow came to the realization as to why. [C++ is a] 'really terrible, terrible language.'"
The main flaw with C++, in Blow's opinion, is that it's a fiendishly complex and layered ecosystem that has becoming increasingly convoluted in its effort to solve different problems; the more layers, the higher the stack, the more wobbly it becomes, and the harder it is to understand.
"Blow is the developer of two games so far -- Braid and The Witness -- and developed a new programming language known as Jai in hopes to help C++ game developers become more productive."
With Jai, Blow hopes to achieve three things: improve the quality of life for the programmer because "we shouldn't be miserable like many of us are"; simplify the systems; and increase expressive power by allowing programmers to build a large amount of functionality with a small amount of code.
Long-time Slashdot reader xx_chris calls C++ "the triumph of syntax over clarity," while in the interview Blow calls C++ 'a weird mess.' But the original submission ends with these questions. "Is Blow correct? Has C++ become a horrific mess that we should ultimately relegate to the bins of COBOL and Pascal? Are there redeeming qualities of C++ that justify the tangle it has become?
"And is Jai a solution or just yet another programming language?"
The main flaw with C++, in Blow's opinion, is that it's a fiendishly complex and layered ecosystem that has becoming increasingly convoluted in its effort to solve different problems; the more layers, the higher the stack, the more wobbly it becomes, and the harder it is to understand.
"Blow is the developer of two games so far -- Braid and The Witness -- and developed a new programming language known as Jai in hopes to help C++ game developers become more productive."
With Jai, Blow hopes to achieve three things: improve the quality of life for the programmer because "we shouldn't be miserable like many of us are"; simplify the systems; and increase expressive power by allowing programmers to build a large amount of functionality with a small amount of code.
Long-time Slashdot reader xx_chris calls C++ "the triumph of syntax over clarity," while in the interview Blow calls C++ 'a weird mess.' But the original submission ends with these questions. "Is Blow correct? Has C++ become a horrific mess that we should ultimately relegate to the bins of COBOL and Pascal? Are there redeeming qualities of C++ that justify the tangle it has become?
"And is Jai a solution or just yet another programming language?"
Yeap.
C++ is a terribly documented language. Powell's Bookstore in Portland, Oregon, one of the biggest bookstores in the world, had 16 books about C++. All of them were about the many tiny details of C++, with no attempts to show how the language should be used.
Powell's Books | The World's Largest Independent Bookstore
What can C++ (or Jai, or whatever the flavor of the month is) do that Lisp can't?
And choose your libraries wisely.
Obvious troll is obvious.
Part of the challenge of using a language is not just knowing all of the things you *can* do. It is also knowing which things are best to avoid, and what the pitfalls are.
No C++ is not a terrible language.
It's still IMHO the best general purpose language there is, but it has grown a devilishly high threshold to master.
With "general purpose" I mean a language you can use in both user-mode and kernel-mode, that you can use to express and implement anything in.
It's like a toolchest with so many tools it'd baffle a newcomer, and probably not even half of them would be user by a master craftsman in a single project, but together they create the best toolchest there is - is looking only at a single language.
Perhaps that last point is what most miss - there is no silver bullet.
If one uses every single feature of C++, then it's probably a really terrible language.
If one only uses features that make C++ better than C, then it's usually good enough.
Anyone who thinks c++ is bad lives in a javascript glass house.
It's rare for me to get to read /. comments before the replies to the first comment make it take too long to bother scrolling to find the second comment! /. please fix your mobile experience in the comments section.
C++ is not necessarily a horrible language, but it does allow you to write horrible code. You can also write easy to read well organized code that is "good" - it's entirely up to the developer. With great power comes great responsibility, yadda yadda.
You can write really good or really bad code in pretty much any language. Generally if your code ends up unreadable, you are doing it wrong.
That being said, if the semantics of a language tend to encourage people to write horrible code, does it make it a bad language? Good question. Discuss.
Keep the compiler, keep all the powerful capabilities of C++, and add an alternative syntax - a friendlier one - that people who struggle with C++ can more easily learn and more easily manage. Back in the days of Flash, Actionscript first had one syntax, and then got a 2nd alternative syntax. You could use either one. The same can be done with C++. Create a new syntax for use in the 2020s and beyond. Don't destroy everything that makes C++ great in the process. There is your "new" language - C+++.
Why did the chicken cross the road? Because Elon Musk put an AI chip in its head.
...use Visual Basic.
You can write really great code, short and powerful. You can also write really bad code. In this way it's similar to other languages. However, I've found it far easier to write multiperson, maintainable code in C++ than in JavaScript.
It does suffer some from things like iterators and safe pointers being added... 1/2 way through it's lifecycle. And therefore, they are less clear than they could be.
Your ad here. Ask me how!
C++ is a 1980's language (actually, Bjorn started work in 1979). It's lasted long enough that we don't have to shed any tears for its demise.
We have many better options today. Personally, I am writing in Crystal, and you can see my explorations here:
Bruce Perens.
What you propose exists. It's called the Rust programming language. It's a next-generation systems programming language designed by Mozilla that has achieved the perfect balance between low-level freedom, high-level abstraction, and compiler-enforced safety, all without compromising performance. C++ was a great pioneering language. Rust is C++'s successor, learning from the lessons that C++ has taught us, while adding in the critical functionality we need in the 21st century.
True, but it's not as horrible as all the other languages.
No sig today...
I am no fan of c++, and I agree it is terrible. But, creating yet a other language sounds a bit over the top.
I am convinced this is happening for one reason, companies do not want to train anyone! If they took the the time to properly train people the industry would not be in this state, now we get new methodologies and languages every other day.
When I started out, senior people spent a lot of time with me showing how I can improve my skills and how the business works. These days you are expected to muddle along hoping to learn your job. No wonder we are having large breaches and crappy software
Hey, look kids, another programmer saying the language he developed is going to solve all the problems of that other bad language. In his language, he's not ever going to let anyone write bad code, because it's HIS language, and HE'S obviously qualified, way more qualified than that Stroustrup guy or whatever his name is, who's been writing and maintaining a language for decades!
It's the most practical language that exists. It trades this off for insane learning curve. But if you master it you'll never run into a roadblock that doesn't have a solution. Of course it's possible to make a better language for a different niche, but a person that would make such language for sure wouldn't think that C++ is "terrible" because such opinion can only appear from ignorance of C++, its alternatives and alternative solutions to issues with C++.
The problem today is that there's many jr-middle level developers and they don't really understan languages that doesn't have any sort of Garbage Collectors. GCs are the reason that most of code today have worst quality than those written 30years ago. Developers got lazy
C++ is so big/complex/rich that different people or groups use different subsets, from 'better ANSI C' to 'Object hierarchies everywhere with lots of templates.' I've seen code that obviously started as "my first OO project" with classes including copy constructors and getters/setters for the most primitive structures that were later changed with basic C code and friend declarations so that this code could work around the class structure. And a bit of STL here and Boost there.
Give me C any day of the week; I can handle memory management and pointers with KISS.
thegodmovie.com - watch it
We should build a language better than all others one... soon https://xkcd.com/927/
Rust is a new language developed by Mozilla. It can be seen as the successor to C++, because it puts so much emphasis on zero-cost abstraction and high performance (unlike a language like Java), while also being a lot safer (unlike C). Rust is basically what C++ would have been had it been developed 30 years later. This is why we've seen Rust become so popular so quickly: it gives the benefits of C++, but avoids so many of C++'s problems. You don't have to move to a language like Java or Perl or Go any longer. You can just use Rust, which is like a leaner, more modern C++.
Disagree. It's more convoluted than C, but adapts C's very error-prone syntax. It's more complex than Basic, FORTRAN or COBOL. It doesn't have the simplicity of Pascal nor the consistency of Java or Ada.
It's definitely a 'science experiment that escaped from the lab.'
I've been programming for over 40 years (shudder..) and have always used C. Never seen a need for C++ for the sort of things that I do.
Perhaps it's because I don't do games and fancy graphics. I do things like counting pulses from water meters and getting coordinates from survey instruments.
You could get some really fancy graphics out of Amigas using C, though. :)
If you're a zombie and you know it, bite your friend!
It is one of the things that is easy to learn, but takes many years to master.
The proper way to do things take a lot of discipline, and looking at the culmination of effort bringing really stable and predictable systems is satisfying. It is no longer as "visible" as other languages, but many of the software people use daily is still mostly C++ (and C of course). For Linux there is still heavy C usage (in the Kernel, X11/Wayland, and Gnome). However KDE desktop, LibreOffice, VLC, Firefox and many other projects are done in C++. Similarly for Windows low level interfaces are already in C++, and MacOS kernel and UI libraries also use C++, and Objective C++ (but not exclusively).
Yes, they are not "sexy" software items, but they work, and I have seen much less exceptions, crashes, and failures in proven C++ code, compared to many Java, Python, or JavaScript code.
A few new low level programming languages are trying to change the situation, but the progress is slow. It could be said that D was the initial one, later Go, and Rust came along. But still most non-experimental low level and mission critical software is still developed in C or C++.
So, no C++ is not a terrible language. It gets results, and many organizations still prefer to keep using it. Unlike older generation languages like COBOL (abandoned by banks), FORTRAN (abandoned for R/Python in scientific research), or Pascal (abandoned by Apple for ObjC++), the C++ community is still thriving.
It called me pussy-whipped because I do javascript. That what they done tawt me in the collage of hillibilly city. Yukyuk.
xxx
Throw out all the old C stuff, throw out the preprocessor. Throw out random casting. Do that shit in assembler if you have to.
Better yet, get a real fucking computer with typed memory. Then you can have a safe, fast language.
Before c++11, c++ had great features that helped you write cleaner code.
The last time I bothered in a bureaucratic way with c++ was in 2013 when I was in a committee to send some features in for suggestion.
The meeting had a lot of people yelling at a guy who was part of isocpp iirc half a decade ago, and he flew from usa for that purpose.
I left in the middle of this shit.
Long story short and I am adding here not only my opinion but the opinion of every colleague who wrote c++ in research labs in different hierarchy levels inside an os, C devs do need C++ to help them write code easier, without hassles and give them more tools when they need them.
C++ the last 10 years has been adopting the web dev language cycle.
You have to have the bleeding edge of features to stay relevant...as frameworks languages and apis die and born every day.
C++ has no enemies, yet it's getting tackled by its own people.
Instead of having powerful lean language, just like C, you have a clusterfuck of a language.
I stopped using the bewest and coolest features because most of them are useless and don't worth the extra effort to include them in your programming style and most importantly there are out there a shitload of colleagues who don't know or care about the latest and greatest feature.... Because they are s/w engineers, not programming hipsters.
I don't think c++ will ever recover. It will grow and grow in terms of features and also those features will become more and more irrelevant as less and less people will adopt them.
Tbh C with classes had a negative meaning 15 years ago. Now it seems like the sane way of writing good and intuitive c++ code.
Maybe it's just me.
C++ is one reason why I gave up programming and became a prostitute.
These sorts of stories come up fairly regularly here on Slashdot. And, each time they do, it reminds me of the classic XKCD:
https://xkcd.com/927/
This doesn’t just apply to no-name indie developers... the good folks at Google are some of the worst offenders in this regard.
#DeleteChrome
Even Stroustrup himself has been having second thoughts about building a time machine to go back and kill his own grandmother.
https://www.theregister.co.uk/...
Of course not. If it's 10,000 BC and your opponent is wielding an antelope's femur, having a sword is an overwhelming advantage! But in modern times, that answer changes. Now, a person clearly *can* be very effective with a sword, with a lot of training. But they could be much more effective with a .38, with much less training.
C++ is kind of like the sword of programming. It occupies an important place in history that should be remembered, and in the right hands, it's still fearsome. But gimme a break - in modern times, there are just better options, in every arena of computing. Other languages offer faster learning curves, less ability to blow your foot off because you didn't know some obscure intricacy of the language, and are simpler in pretty much every conceivable way.
C++ is a relic we should regard with a certain reverence, while not taking it seriously for the future.
Bjarne is right: there is a smaller, beautiful language within C++: it is called Rust. Mozilla has taken the best parts of C++ like its fast performance and its flexible abstractions and created the ultra-safe, ultra-productive and ultra-powerful modern programming language called Rust. While C++ will probably never go away, more and more C++ programmers are opting to use Rust instead because it is so much like C++, yet so much better at the same time.
...but really terrible quotes often end up in the media
Jai sounds like a vent for the frustrations of this guy who hates C++. There are no public compilers yet, and the GitHub page is an unofficial source derived from YouTube videos. Sounds like more talk than results.
"What lies behind us, and what lies before us are tiny matters compared to what lies within us." Ralph Waldo Emerson
I'm a javascript developer, for all the crap you guys say about my programming language, at least it works easily and gets TONS of stuff done.
The publisher of the article is spot on, its wobbly with junk and that makes it more of a problem to use than it should be.
I'm going to sit back and eat popcorn now :D
Well-known languages seem to collect cruft as they age. Look up and try to do reflection on C#'s nullable-types for example. Nullable types were an after-thought such that they ended up bastardizing dynamic types to implement them, making for ugly reflection. Granted, perhaps there were other ways to implement nullable types, but I'm sure those would uglify something else.
Table-ized A.I.
Modern C++ looks nothing like C++ of the years past. C++ is a comparatively old language, it's been around for over 30 (!) years.
And for the longest time C++ was gathering dist, stagnating, and remaining basically unchanged. But an effort begun to update the language, and since 2011 in my estimation C++ is now at least three times as big, and as complex as it was before.
Folks who've been around the block for a while started getting someone shocked coming across C++ code that looked nothing like the C++ they knew. And people who attempt to start learning C++ from scratch were confronted with the entire, 100% complexity, of modern C++ right off the bat.
And that's, IMO, is where the current bad rap for C++ is coming from. It is a hard, complicated, language to learn. But it's been my experience that once I spent th effort to learn the nuts and the bolts of modern C++, I found it to be a very powerful, rich, capable language. I don't think I would've been able to write LibCXXW in 2003 C++. It would've taken me five or six times longer than it did. Modern C++ attempts, in made ways, to bring many of the benefits of other, VM-based languages like Java and Perl, and bolt them on top of a compiled framework.
Some time ago, on stackoverflow, I read a question from someone wondering why their C++ compiler was running out of memory compiling their code. I looked at it. The shown code attempted to implement Sieve Of Eratosthenes in the compiler itself. That is, the code was not trying to implement it itself, but make the C++ compiler do it, via templates, with the actual code resulting in a static array of prime numbers. And the question was why the poor compiler was running out of RAM...
Try that, with Java.
Smart pointers are easy and standard even in C++ these days. The not planning these seems like a significant weakness.
There's a certain kind of programmer -- most people have either met one, or are one themselves -- who gets off on mastering complex, intricate systems for their own sake. They believe that complexity implies cleverness and power. They think that if you spend decades mastering every nook and cranny of C++, then surely that mastery makes you capable of doing things that programmers using lesser languages can't do.
They are wrong: complexity is evil. At times a necessary evil, but something to be minimized at all costs. Good languages are built upon a foundation of carefully chosen, complementary, and orthogonal features. And C++ is a trash pile of a language, with every passing year and new revision of the standard, they bolt on yet another poorly thought out feature which interacts badly with what came before. All built on the shifting sands of backward compatibility with C. Now, C is not too bad by itself, but C compatibility is one of the biggest contributors to complexity and error within C++.
But that backward compatibility has allowed C++ to prosper, unfortunately, and we are stuck with it.
Nope, C++ was designed to be a practical language every step of the way.
Most of the other languages you mention really were experiments that got way out of hand, especially Pascal and Java.
ref: http://www.cs.virginia.edu/~ev...
No sig today...
C++ and JavaScript share a common issue, in that both languages have some design problems that they carry with them, but both are popular and have layers of syntax accumulation and libraries, and both will allow you to write some terrible code.
However, if you have a firm understanding of the languages (and the pitfalls particular to each), you can also write solid and elegant code in either language. It's more a matter of avoiding their bad parts than anything else, but it requires knowledge and discipline to confine yourself to the "good" subset within each language.
Does Crystal have an established organization backing it, or is it just a hobbyist project?
Compare it to a modern C++ competitor like Rust. Rust is backed by Mozilla, one of Silicon Valley's greatest success stories. I trust that Mozilla will guide and support Rust in the years to come.
When I use established languages like C++ and Rust, I feel confident knowing those languages will still be supported and popular 10, 20, and even 100 years from now. I don't get that same feeling drom Crystal, at least not yet.
At this point I wout have to go with Rust instead of Crystal.
Gave up on it a good 30 years or so ago, when templates were introduced. Suddenly no 2 compilers gave the same results. Readability? It was as bad as perl. WORA. Write Once, Run Away.
Java gets a lot of crap but damn it, C++ drives me up a wall.
There are no 'Really Terrible Languages', just 'Really Terrible Programmers'
No. C++ is not a terrible language, and never has been. If you find it difficult to program in C++ as opposed to other languages it means you're just dumb.
Freaking wannabe developers. What a joke.
Even the article doesn't have any.
http://michaelsmith.id.au
Yes it's terrible, no Jai or Rust or D or any other "language of the week" isn't going to replace it. They all fail on something. D has garbage collection. Rust comes with politics and really annoying fans. C++ doesn't even have fans. Plus C++ is well-entrenched; it'll be harder to dislodge than Fortran
And yes, there is a smaller and more elegant language inside C++ screaming to get out. It's called "C".
Almost two decades ago a I had a Thinkgeek C++ round bumper sticker on my car because I thought the language was the bees' knees. Today I'm finding myself holding my tongue in watching videos from C++Con which quickly go from 1 to 10 in terms of complexity; where only the smartest of developers can remember all of the rules and the exceptions to leverage modern day C++. I feel as if the movers and shakers of the C++ language spec have an inner social circle and have lost touch with the wider developer audience.
Having used C#, Actionscript, LUA, Python and dabbled just enough in Swift and Rust, I believe that C++ either needs to have a fundamental change to break the axiom of backwards compatibility or it will be replaced by Rust, Go, or some other (LLVM) language that has been inspired by C/C++ but has a simpler, consistent syntax made for modern day computing.
My prediction: when underlying, low-level OS components are replaced with non-C, non-C++ counterparts, that will be the beginning of a global acceptance for a new language standard. Until then there will always be a place for C/C++. I really hope this change happens in the next ten years; I'm not holding my breath though.
I'm way too lazy to deal with manual memory management and pointers and shit.
Aside from the fact that C++ is a steaming pile of needless complexity, the worst thing about it is the brain damage it does to coders who become proud of memorizing the minutia of said steaming pile, believing that this is equivalent to engineering skill.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
While I agree with the core of your thesis that you can create good and bad code, I have to disagree from the perspective of how applications are architected.
JavaScript requires a different mindset to handle exceptions and handle/recover from errors. I find it quite difficult to make sure that code flags an error properly and doesn't continue blindly on. This is okay for a fairly simple web app (which is what it was created for) but lousy when you have an application that communicates with other systems and there can be errors in responses and response time or in unexpected events.
C++ for all it's follows more traditional execution model that allows for complex applications which communicate with other systems.
Mimetics Inc. Twitter
Maybe I'm crazy for having never needed this, but why is this the first point in "Jai" (which I don't even know how to pronounce)?
"Arbitrary compile-time code execution – Any function of the program can be made to run at compile time with #run"
It's definitely charming that you can't even fucking compile the source code in this language without vetting it carefully to be sure that it won't own your box, and that's its NUMBER ONE FEATURE.
C++ is, IMO, terrible.
I hate that it allows polymorphism. Worse, it makes people think that polymorphism is a desirable feature that helps create clear, readable code.
It encourages the creation of functions that operate on classes instead of on generic data types.
For example, if a C++ program has a "car" class that include the elements "miles" and "gas" a C++ programmer is likely to create a function
car::calc_mpg() which requires (seemingly) no arguments, rather than the more generic calc_mpg(int miles, int gas)
The problem is, the first is not reusable, and depends heavily on knowledge of the car class.
It encourages inheritance, which fundamentally breaks the box-model (a.k.a. the black-box-model) of programming.
Rather than breaking things into discrete, understandable chunks, it encourages massive classes that must be understood in their entirety.
Then there's operator overloading, code that can be executed before main(), putting code in unexpected places... I could go on, but I think you get the idea.
The main problem is, C++ adds stuff with the unjustified expectation that more stuff automatically mean better.
Sometimes more stuff is worse.
Mozilla, one of Silicon Valley's greatest success stories
You're funny.
-jcvr
The only title of honor that a tyrant can grant is "Enemy of the State."
I dunno. I feel the need to correct a couple of misrepresentations in that post.
He seems pretty genuine to me.
Results in symptoms identical to Stockholm syndrome.
Not every software component is best represented as a new data type (class).
It depends which version of C++ you are talking about. The language has changed considerably from the 1990's C with classes to todays template meta-programming language of sorts. I think C is a great language. It does exactly what it is supposed to do and those of us who basically need a portable assembler with structures use C. It's the workhorse that device drivers, kernels, and all sorts of low-level software is written in. And for that it's just fine.
C++ started out as a way to fix a few sins of C and to introduce a simple, thin set of OOP constructs. In the 80's and 90's, it did just that. As an older guy I can't even make heads or tails of C++ code written today. Before people jump up and down saying "This guy doesn't get the power of meta-programming!" I certainly do. I've programmed in Scheme and FORTH. Both languages have meta-programming.
The problem is C++ tries to do it with a sort of "declarative language" -- noble in approach, terrible in practice. Now before those same people jump up and down saying "This guy doesn't get the power of declarative languages" of course I do. I like languages like Prolog and SQL where you don't bother with the "how" component.
But for meta programming C++'s approach, syntax, historical baggage, and (the worst) design by committee has rendered it a pile of crap. And I'm a guy who likes VHDL and Ada syntax!
Go back to pascal already. Programmers could have conquered the world with that language if it had not been for C++ aka COBOL for the modern era.
Let's take this language and light on fire inside a dumpster somewhere already.
Another ridiculous argument since by the time BWK wrote that book, Wirthian languages had already hit Modula-2 and were well on their way to Modula-3 and Oberon. That's like arguing that you shouldn't use Fortran by pointing out the deficiencies of Fortran 77.
Ezekiel 23:20
Mozilla is starting to rewrite important parts of Firefox using Rust. I think that once more programmers see how using Rust has let Firefox's devs get to be so much more productive we will start to see other software be written in it, too. I know this might be hard to believe, but I think within the next 10 years we'll see a big push to port the Linux kernel to Rust, and I think it will be fully ported to Rust by 2030, with no C code left at that point.
Nope, C++ wasn't designed at all: it was accreted.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
that C, C+, C++, etc., ad nauseam, are "write only languages": you can write code in them, but you sure can't read most of it.
Dang! Our embedded systems only have 2 Gigabytes of memory and 512Mbytes is reserved for the OS and display memory.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
FUC
Creating a new language is hard, but getting people to use it is even harder, even if it is pushed by a corporation. Blow seems to fail to understand that language adoption is not just about syntax and paradigms but also ecosystem and libraries. You need people willing to make libraries for the new language so that even more people get interested in using it for their projects. This could take a decade or more. As far as I know he is working on that language by himself, or is there a community or at least some other contributors? Blow is a guy who writes his game engines from scratch and it seems that he wants to make a language that would suit his own needs, but even if other small developers like it most of them would still need 3rd party libraries to be able to use it for their projects.
Of course, C++ isn't a "really terrible language", it is an industry language used in big projects where performance is paramount and has been around for a long time. It has a lot of flaws but people use it because it's portable and has a huge number of libraries available. You cannot just replace it with a new better language because of all the legacy code, so the C++ standard committee is trying to improve it by modernizing it, expanding the standard library and deprecating features while maintaining backward compatibility. Whether this process is going in the right direction can be questioned, though.
Mozilla, one of Silicon Valley's greatest success stories
You're funny.
If you are not aware of the history, then it might seem somewhat humorous to consider them a great success story. However, Mozilla came out of the wreck that sank Netscape. As the WWW was fast becoming important to both businesses and the general public, they decided to stop rewrite their entire application. This strategic error allowed Microsoft completely dominate the WWW for the better part of a decade (go read Spolsky's Things You Should Never Do postings for a very insightful analysis of the whole thing). Recall the Use IE for best experience with this site and other such things that were common until even a few years ago.
Mozilla came from that, clawed their way back into the fight and today they are driver for practically every useful and interesting privacy-oriented feature in just about every web browser. Either because they first implemented or because the popularized it.
I cannot think of another company (Mozilla has both a non-profit arm and a for-profit corporation under the same umbrella) that has managed to rise from the ashes after being pulverized by Microsoft in the way that they (or really their predecessors) were.
So around 15 years ago, when I was starting my career in the games industry, there was a post here on slashdot about how someone had finally proven that the language did not have a bad recursion in it. In the comments was a programmer who I think may have been working at Microsoft talking about how every compiler programmer would go into writing a C++ compiler excited to be the first one that implemented the full language specification and having the Hope slowly beaten out of them, until they finally arrived on a sufficient compromise. And so compilers would all implement their own specific subset of the language and there was virtually no cross compatibility.
So the language started as an unimplementable mess of a spec, and unless someone has been doing some very hard work to make the language LESS complex, I greatly suspect that it has stayed that way, despite the smattering of quality of life upgrades that have been thrown to us.
In my mind, the greatest sin will always be template metaprogramming, a discoveredâ"not plannedâ"feature that was the consequence of a problem that should not have existed in the first place. They planned poorly in the beginning, threw some more bad planning on top, and ended up with a monumental clusterfuck that will be obfuscating codebases until the end of time.
tl;dr Yes, goddamnit.
Long time C++ developer. In truth: It's an awesome, very capable language and immensely powerful language. I wouldn't use it for scripting tasks but for serious computing it's amazing
The truth though: Bjarne and the committees have added layers and layers of unnecessary crap over the years which bloat the language, replicate existing functionality like lambdas did and in some cases force rewrites like the stream debacle, and streams were an overcomplicated mess from day one.
But all that new function the have piled on over the years? You just don't need this shit. I avoid it Most tragically: I don't need it anyway. And it turns people off.
What they really do need: Serialization. At the moment you must do this manually. It's a pain in the butt but you can do it. An automated serialization system would be much better. Yes, I know Boost has a serialization system but it's verbose. Whole point of using a library function is to have less and simpler code.
People who whine about dangling pointers and the like need to grow up. It just isn't a problem for me. I code so it isn't a problem. Yes if you've been brought up using scripting languages I can see why this would be a problem for you. But to learn any new language you need to adapt. If you can't, stay where you are. If you don't it's like moving to France and complaining they speak French there.
I used to code on Delphi, based on Pascal, but also did some C++. The main difference I found was that if I made an error in Delphi the compiler found it and the big fix cycle was a few seconds. In C++ the compiler would find a way to interpret my code (as something I hadn't intended) and I would only find the error in unit test, with a big fix cycle of minutes. The benefit of C++ was that you could do ten things in one line. So Delphi was simpler and more verbose, C++ was briefer. But coding in Delphi was an order of magnitude faster.
The problem with C++ is things which should be simple are complex, not that there are too many features. With Perl or Python, if you want to create a variable and stuff data into it, its very easy to do, syntax is very straightfoward, like my $var="hello"; $var="hello2"; The variable automatically allocates memory, resizes as needed, and is reference counted so there is never a hanging pointer . Want a dictionary? In perl, its my %hash=(key1=>"value1"); Hash allocated nice and easy, automatically resizes as needed. How to do that in C++? The syntax is more complex and convoluted. In Perl or Python, the simple is easy, the hard is possible, there are a lot of advanced features but you don't need to use complex syntax to do the simple stuff.
When one hires chimpanzees to write code, one gets code written by chimpanzees. No language tool will make up for lack of understanding. The more flexible a tool, the easier it is to write code that is simply horrid. To turn around and blame the language is disingenuous at best and at worst, promulgates the idea that good code is easy and within the grasp of just any old person.
Anyone can play a scale on a piano. Anyone can figure out what the notes on the music mean. That does not mean that anyone can play Frédéric Chopin's Minute Waltz. More to the point, a "better" piano won't fix this.
Don't take life too seriously; it isn't permanent.
Hehe it was literally the stupidest thing Iâ(TM)ve read on the internet in a while
All you have to do is not use any of the libraries that try to make it look like assembly, Fortran, Pascal, Lisp, Ruby, Basic, Modula, java, or Ada.
But seriously, C++ suffers from "look what I can add and make this work like something else"
We all think in different ways, so there's never going to be one language that is everything to everyone. I had to take a COBOL class in college, but before that I had taught myself a couple of different languages; and damned if that COBOL class didn't help me to understand certain concepts better. Every language has its own set of strengths, weaknesses, and quirks. Sometimes Language X works in a way that is more in line with how Person A thinks, but Person B may be more of a Language Y type. Just use what is closest to the way you think and stop worrying if other people are the same.
Anyone can play a scale on a piano. Anyone can figure out what the notes on the music mean. That does not mean that anyone can play Frédéric Chopin's Minute Waltz. More to the point, a "better" piano won't fix this.
Perhaps not, but I'd rather listen to a professional concert pianist play the Minute Waltz on a Steinway grand than a 1980s synthesizer.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Consider what Linux was at the start, and what it is now. That's how Open Source works. I think the quality of the language will assure its growth, as Linux grew from the hobby project of a pimply computer science lecturer at a Helsinki college whose wife is much more macho than him (she's a martial arts champ), to the OS behind an industry. It happens there is a company behind the Crystal developers. But they are a small team, and they collect money donations from the public.
Bruce Perens.
Yeah, as I always have said:
A good craftsperson does not blame the tools — not because you could hand that person terrible tools and get the same results as with great tools, but rather because the person would know what various tools do well, and would find ways to work within their limitations to create something good.
The same is true for programming languages. Different languages are good at different things. I'd rather smash my head repeatedly with a ball-peen hammer than deal with giant steaming piles of templates, but stick embedded C++ in the kernel without all that STL baggage or exception handling or multiple inheritance or RTTI or any of the other junk that makes the C++ runtime so bloated, and you end up with a halfway decent language for writing device driver stacks.
Need to use piles of regular expressions for some reason? Perl.
Need a lightweight template-based web backend language for a small-ish website? PHP.
Need a language for writing client code? Objective-C.
Need a language for writing enterprise-scale server code? Java.
Need a language for full-stack development by a single development team? Javascript, but don't do that. Really. Don't do that.
And so on.
Check out my sci-fi/humor trilogy at PatriotsBooks.
This is one try at comparing many languages at different benchmarks. Crystal is still in development, but it's based on the LLVM compiler, which of course also compiles C. I think they're still going for functionality, rather than optimization.
Bruce Perens.
C++ is horrible. Just stating the obvious.
It's not horrible it is just mature. Good languages, like C++, start off with a very clear syntax that greatly simplifies some important programming tasks. As people get more familiar with the language they identify new programming patterns which the language cannot handle well and so new syntax or features are added leading to bloat.
C++ has been around for a while and has had lots of new things added to it making it a mature language. At some point, someone will come up with a new, general purpose language that incorporates many of the advantages of C++ in a coherent syntax and which is useful for lots of people and not aimed at just developing just games, or web, or any other specialized function and then the cycle will repeat.
BASIC on a chip that got sold with a computer? Slow and it often faced low hardware memory.
Try some POKE?
Go for assembly?
C++ let a smart generation escape limitations and work on really great code.
That was fast and allowed the USA export code that a world of computer users needed and would pay for.
A code that was faster, let people try new things and that they could give away, sell. Their software sold well and with skills could really work well.
C++ made code fast and gave more freedoms to try things to smart people with advanced skills.
Domestic spying is now "Benign Information Gathering"
especially Pascal
"Why Pascal is Not My Favorite Programming Language" was written in 1981 and the criticisms are out of date. Pascal has moved on since then. Try FreePascal (with Lazarus) or try Delphi.
You could have just written, "No."
> ry that, with Java.
Why? You just said how terrible was the result.
Hey, you have to congratulate me for never even once mentioning WORLD DOMINATION.
Bruce Perens.
> Rust comes with politics and really annoying fans
1. Replace Rust with anything (not just any programming language) and the statement is equally true
2. I still find it to be the most interesting "new" language out there that is the only real competitor for the space the C++ currently fills with the "right" design to exploit future hw architectures where an emphasis on parallel and concurrent computation is important
Need a language for writing enterprise-scale server code? Java.
It's funny that you expressed the opinion that people should not write fullstack purely in Javascript, but were OK with writing enterprise scale software in Java. Java is a decent language if you have more compute power than you really need, but not enough to run Python. If you are writing enterprise scale code in Java, then you are wasting a lot of compute power. The point of Java was not to make performant code easier to write, but to make code more maintainable. Any competent C++ developer can get you both performant and maintainable code. The secret really is in the template meta-programming. It allows you to do high performance things that simply can't be done in any other language, including C. I can beat the performance of any implementation in Java, using C++, by at least 25%.
A prime example of why I can do that is garbage collection. If you implement a linked list in Java or C++, as each node is created, it will have memory allocated for it from the heap. When you are done with the list, each node must then be freed. With a million nodes, that is a million memory allocations and a million frees. Using custom allocators in C++, I can avoid all of those allocations and frees, and use a single memory pool for all of the objects. This requires extra effort, but fundamentally cannot work with Garbage Collection, so in Java, you simply can't create an implementation that can compete. This is just an example of one of the many ways in which Java ties the developers hands in ways that guarantee sub-optimal performance.
All the things that people complain about being too complicated or "dangerous" in C++ are the very things that give the developers the power to write software that doesn't suck. In all, if a programmer doesn't understand the complexities of C++, then I would argue that they don't understand the complexities of programming for performance, because the first derives directly from the second, and if you fully appreciate programming for performance, then all of the mysteries of C++ will be open to you.
I wish I had a good sig, but all the good ones are copyrighted
Maybe he should take up ASM programming, then he can talk about level of programming difficulty, the fucking n00b.
Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
As far as I'm concerned, the language went off a cliff when it started incorporating elements of STL in its basic definitions. One good example of this is the ranged for loop, introduced in C++11, which requires iterators that conform to APIs established in the STL. IIRC, these are statically bound to the for operator, which prevents developers from leveraging inheritance and polymorphism when designing their own iterators.
STL was a great improvement in its day, but I haven't been a fan for years, nor for Boost. Both are often cryptically written, poorly documented, and overly abstracted compared to modern frameworks. But, instead of improving on these standards with lessons learned from more recent efforts with languages and development kits, the C++ standards committee has doubled down on antiquity.
I haven't looked back.
> today they are driver for practically every useful and interesting privacy-oriented feature in just about every web browser.
You know, like making a sham buyout for a Web 2.0 fancy bookmark pyramid scheme then forcing your entire user base to use it despite the fact that it spies on you. Can't thank them enough for that.
Should have left c well enough alone. All the extra shit in c++ is just gibberish.
C++ is fine as long as you stay at a feature level before C++11 and don't use STL (well maybe simple use of containers like string a vector are OK but definately stop there).
He says:
"People think a programming language should be a complicated ecosystem," Blow said to the audience. "I don't want to learn an ecosystem for a year, I just want to put 3D graphics on there."
With Jai, Blow hopes to achieve three things: improve the quality of life for the programmer because "we shouldn't be miserable like many of us are"; simplify the systems; and increase expressive power by allowing programmers to build a large amount of functionality with a small amount of code.
The application:
"Companies have very large game engines that would be very costly to replace. So a game like Assassin's Creed, last I heard a couple of years ago, was like ten million lines of source code... It's probably bigger now."
I can see why publishers like EA are so nickel and dime, and push sequelitis. They have to write enormous amounts of performance optimized code for the PS4 and Xbox One. That codebase probably costs hundreds of millions of dollars to write. That is the market for C++.
He'd probably be happier writing less optimized code in Java, or C#, and use the standard library. They are certainly easier to debug.
Kinda agree, but just want to point out that there are ways to tune and minimise the impact of garbage collection and make its impact negligible.... though sometimes that is hard and have other trade offs.
I've said it once, I've said it 1000 times: C++ is the product of troubled minds.
It is an absolutely horrific language. It is second only to Perl.
Nah, PHP has them both beat, by a large margin. And then there is MUMPS...
My objection is more to do with trying to do multiple disparate types of programming in the same language than with JS as a language or its performance. Performance-wise, compiled JS is pretty good these days.
LOL. To some degree, yes. Like scripting languages, Java has some nice advantages in terms of not caring whether you're running on x86-64 or POWER10 or ARM. If you're deploying across a heterogeneous server fleet, this can be a significant advantage. That said, whether it outweighs the performance penalty is certainly debatable.
But the main reason for picking Java is that a lot of CS programs teach Java as their main programming language. This makes it somewhat easier to find large numbers of junior-grade programmers with CS degrees who know Java than Python.
Check out my sci-fi/humor trilogy at PatriotsBooks.
Let me put it this way...
Their documentation is organized like a slideshow. Pass.
Aside from Hello World, their other simple example shows how to set up an HTTP server. Everything in the 7-line example is obvious and explained in detail, except for the weird part "do |context|". You have to sift through considerable amounts of documentation to figure out what the hell that does. Why gloss over the only interesting/confusing thing in the example? Pass.
Here we have some people developing a programming language, and their web page directly downloads jQuery from a 3rd-party site, rather than hosting the library locally. LOL... pass.
> programming isn't some inherently dangerous activity that only those who get special schooling should be able to approach it. It's like any other home utility
If you're writing a utility to use on your own desktop, sure. Code up your own crappy hex to binary converter - no problem with that.
As soon as the code is exposed to the internet, the situation completely changes. Code that is part of a web application or anything else reachable via the internet will be attacked multiple times per day. It must be designed and coded with attacks in mind. When it's not, it results in another headline "Acme Corp leaks 10 million customer records".
I feel for newer programmers trying to learn today. In my first five years of programming, I wasn't qualified to write secure internet-accessible code. That's hard to do, because attackers constantly scan for code with weaknesses. These days, it seems most code connects to the internet. That's not a safe place to learn.
Java is an example of idiots writing software. It is not appropriate anywhere.
All languages have been an experiment at one time, but C++ is really a kludge solution on top of C.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
You haven't seen NORD PL then.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
Learned it, was appalled by the shockingly bad and complex design (I learned C and Eiffel before, among others) and decided to use this mess only when there was no other choice. To be fair, the "crap for the masses" (Java) is not really any better.
These days I use Python with embedded C modules for larger things or plain C or Perl or Python for smaller things.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Blow is right.
Now, C++ is an excellent language, the problem is the complexity of the ecosystem that's grown around it.
But who can follow through that labyrinth of objects? Whoever can, is a *real* champion.
Although I don't agree with the parent, I think he makes a lot of extremely valid points.
Therefore I think it's an abuse of moderator privileges to mod it to -1.
tl;dr: -1 does not mean "I disagree."
Not forgetting SSDP streamcasting your computer screen. I know for a fact wheneven I had Firefox running on my PC, a contractor at work was able to see the contents of my screen. He would be standing next to my coworker practically reading out a list of things on my TODO list.
Cool, but you also take 2 months/years/never to do that.
False. Java is worse : it doesn't have multiple inheritance.
Totof
Rust? unless they get rid of their toxic SJW community it'll simply implode the day when someone realizes some piece of code is better than some other piece of code and it's a form of intimidation and because intimidation is a something historically associated with cis men, it's also transphobic and against women.
What non-trivial Rust code exists apart from bits of Firefox? Exactly.
Context is critical. As a language for hobbyists like me, it is truly a mass of steaming vomit and feces. On the other hand, the fact that it has been able to (sort of) keep up with the enormous changes in what is being asked of it is just as amazing. It's like having a mother, girlfriend, wife, secretary, and nurse in a single package. Like having a 1000 tool, 50 pound Swiss Army Knife. I don't want either one, thank you very much.
You're welcome to relegate Pascal to the equivalent bin as COBOL, when there is another language that offers what Free Pascal and its corresponding Lazarus IDE offer: cross-platform RAD resulting in lightning fast native executables on more platforms than any other development solution that I know of - all of it at no cost.
That was a really strange book. In the first edition, he was selling Eiffel, which was made by his own company. In the second edition, due I guess to criticism, he continued to use Eiffel to write the examples, but never named the language he was using until the last word of the book, and various anagrams including the first letters of the title of the final chapter and the first letters of a series of consecutive chapters.
There is still lots of language research going on, and as a result closures are accepted in a number of productive modern languages, type inference and global optimization are seen more often, and there is a lot of work on functional programming because of the fact that it's the only sort we can prove.
Bruce Perens.
Is C++ a 'Really Terrible Language'?
Yes, C++ is a really terrible language. But it's also a really good language. Which is why this same argument comes up so often here on /.
It's a terrible language because you have to concentrate on the programming domain instead of the problem domain. It's a really good language if what interests you is the programming domain and how to get C++ to do something.
Over all, that makes C++ a really terrible language for everyone because it's bad for solving the problem.
Instead of that crappy streams
No doubt, C and C++ are a messy hodgepodge of PLs. Historically grown over 30+ years and quite a boast mix of tools and concepts. Truth is, we know more about PLs today than we did back then, hence Kotlin, Go and Rust.
However, you have to see a PL in its historic purpose, and for that c++ is pretty neat. Especially C++ 14 GSL and newer. Yeah you can do lots of crazy shit with C++ that will trip you up, but that doesn't mean you have to. If you don't know what you're doing, don't do it. C languages (excluding c#) are little more than updates to assembler. If you don't know the background of c++ you are bound to screw things up. That's not a bad thing per se.
I personally think C++ is pretty neat and it basically was the first of modern non-trivial PLs that built some awesome stuff. I won't learn it anymore since Rust seems more sophisticated to me.
We suffer more in our imagination than in reality. - Seneca
Yes, because only apple gadgets are ever used as client machines.
Oh fuck off
C++ is a horrible language, but it’s also an important one. I agree it’s convoluted; but the situation is more complex than what people have said here.
Yes, it was already convoluted and too complex in the early years. But people tried to improve it - the one problem was backward compatibility. If what() returns a char* instead of a string& that’s because we want existing code still to compile with a C++17 compiler.
BTW, once you embrace a library like Boost (which you will need to do, since the standard library is too spartan), the same app in C++ might well be fewer lines of code than in Java, because the latter is full of fluff syntactic (public static void main() { ... } anyone?).
The argument people should move to Rust has some merit, but again things aren’t that simple: C++ is a standard language with enormous support in terms of compilers, ecosystem, and most importantly, trained developers. “Exotic” languages are always risky to use because you can’t find experienced staff (and there won’t be those answers one needs on Stack Exhange).
C++ is also important:
- Google uses C++.
- Many large banks use C++.
- The only reason why Python is productive is most libraries in Python are written in C/C++. As soon as you need to maintain/fix a library, you’ll need to learn it.
C++ is also difficult (and not event taught by universities anymore). Because of these reasons, there’s actually a shortage of capable C++ developers in the market.
PS: If you propose to throw C++ away, it would be offensive to put it in the same bin as Pascal - Pascal is beautiful and small. Use the COBOL bin.
Why is COBOL and C++ compared with Pascal? The first are languages with problems that were once popular and are now legacy with plenty of good positions. Pascal existed mostly in schools.
Avantgarde Hebrew science fiction
Aftrt having worked two decades in a world of C++ and its cousins, learning Haskell taught me, how insanely limited C++ makes the minds of those that think it is the greatest, and how insanely cumbersone it is to use.
Going back to C++ is worse than going back to the child of Basic and JavaScript.
I'm certainly not hailing Haskell as the perfect language. I would not even recommend it for your bread and butter projects. But it certainly opens your eyes and mind, real wide. And with that, monstrosities like C++ or PHO or JavaScript, and even C (strings as char* + int? seriously??), become really really unbearable.
C# does really well at putting lipstick and makeup and a dress and high heels and a smile on a C++pig.
It's still a pig.
C++ is a very good language. But it's not a good choice for many circumstances. Use it where it makes sense, don't use it where it doesn't.
No, you donâ(TM)t understand. When I say it had newly been proven that there was no catastrophic recursion in the grammar, I mean that until that point, nobody had proven it was even technically possible to implement the full spec. It was an open question as to whether the language was just fundamentally flawed in its definition.
Opinions are like assholes, we all have one and they all stink. Who gives a rat's ass about what this guy thinks, unless you want to make C++ better, or you think like him and have your favorite language that is not C++ you wish everything is written in.
-- Many men would appreciate a woman's mind more if they could fondle it
>With a million nodes, that is a million memory allocations and a million frees.
So what? If the application meets all of the necessary requirements and SLAs, is supportable and maintainable, then why do you care if it is doing a million allocations and a million frees? Those allocations/frees aren't causing wear and tear on the memory chips.
I'm not sure about the word "kludge" but yes, compatibility with C is both what made C++ successful and where most of the warts came from.
But most of those complaints are only syntax. You can get used to any syntax. The real problems in programming languages come when they're too limited and don't allow you to express your ideas in code. That's when the real kludges are created - when some legacy app hits a brick wall and goes into a downward spiral of bad code due to limitations of the language. I've not seen it happen in C++.
(mostly because the people behind C++ were computer scientists, not a bunch of hackerclowns, eg. PHP)
No sig today...
>It is not appropriate anywhere.
That's why 90% of Fortune 500 companies use it.
Sounds to me like someone is butt hurt about their favorite toy not having the traction Java has.
If you are writing enterprise scale code in Java, then you are wasting a lot of compute power.
I assure you that enterprises don't care about that.
The point of Java was not to make performant code easier to write, but to make code more maintainable.
No, Java was designed for embedded code in interactive TV sets:
https://en.wikipedia.org/wiki/...
The fact that people tried to use it for enterprise code was mostly down to Sun's aggressive marketing, not because Java was designed for it (or even suitable).
No sig today...
Java has some nice advantages in terms of not caring whether you're running on x86-64 or POWER10 or ARM.
Neither does C++.
No sig today...
The disadvantage of doing maintenance is that all other developers are utter idiots who do it wrong on purpose. The advantage of doing maintenance is it exposes you to things you wouldn't have used yourself if you were developing it.
Once in a while, you might even come across something that's useful.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
Performance-wise, compiled JS is pretty good these days.
True, but:
a) To get that performance you have to try and program using as few dynamic features as possible.
b) The expressiveness of the language is terrible: Inheritance and code-re-use is non-existent ("prototype"? LOL!), building proper data structures in Javascript is impossible, at the end of the day everything devolves to closures and there's nothing maintainable or readable about that.
Go search for "douglas crockford javascript" on youtube and see how many knots he ties the language in towards the end. He keeps using the word "elegant" but it's not true.
No sig today...
So what that it takes 10,000 times more cycles to complete the task. Customers are used to buying more hardware any time we write more code.
There was a complete Objective-C toolchain available as an installable package with Slackware 95.
Did the OP type "Modula-2"? I must have missed that.
No sig today...
"Why Pascal is Not My Favorite Programming Language" was written in 1981 and the criticisms are out of date. Pascal has moved on since then. Try FreePascal (with Lazarus) or try Delphi.
So... just like most people's criticisms of C++ then?
C++ has moved since the 1990s, too.
No sig today...
About your prime example:
A prime example of why I can do that is garbage collection. If you implement a linked list in Java or C++, as each node is created, it will have memory allocated for it from the heap. When you are done with the list, each node must then be freed. With a million nodes, that is a million memory allocations and a million frees.
Not necessarily.
C#, for instance, does it smarter. Whenever your list is full, the next add will internally allocate memory in larger increments. Which has its own drawbacks, but it gets around the performance problem you described.
C - the footgun of programming languages
The C++ language standard is like petrol or dynamite. You can use it to do great things or disastrous things. It's productive use depends on the skill and judgement of the user. The language standard provides many temptations for mischief. But well hidden in the standards committee cruft is a tool set capable of making high performance maintainable code solving complex problems. That hidden subset is a pretty high standard which few, if any other languages meet.
What's terrible is that the only way I can get this subset is by continually fending off temptations. This is near impossible in a team environment. And definitely to be avoided (Python?) if performance is not necessary.
Given the size of the C and C++ codebase, I suspect this problem will be with us for quite some time. Instead of complaining how terrible it is, what can be done to improve the situation. For problems that require large code bases and direct hardware level performance, what other options are available? What can be done the refocus the standards committee on something productive?
So... just like most people's criticisms of C++ then?
No.
That's one of the nastiest things I have ever seen anyone ever imply about a programming language.
Why would someone say such a vicious thing about COBOL and Pascal?
> nobody had proven it was even technically possible to implement the full spec.
Like I said, I believe G++ has always implemented the full spec.
A computer language is supposed to make it easier for the human to program the computer, thus it should be human-friendly and use language, syntax, and concepts from the human world. Otherwise, why not just write code in assembly? Or hand-coded binary machine-language?
My biggest bitch about C and C++ and all its siblings is case sensitivity. I'm not promoting Visual Basic, but at least it gets the case problem right. (And yes, I've read all the arguments about why case sensitivity is supposed to be a good thing, and I think they are all bull**** trying to justify it after-the-fact.) I would love some sort of compiler switch or IDE option to turn it off. I Can rEaD someTHinG no maTtEr how sCreweD up tHe caSe, whY cAN't tHe ComPilEr?
I also don't care for all the {braces} which are awkward to touch-type.
I would change just one thing.
Don't use java for anything, and just let it die.
My first languages were assembly (z80 and IBM 370). Assembly language forced me to understand the context of the language (hardware). The representations and abstractions were well defined by the context. I wrote my own macros and subroutines, which became libraries. Life was good. My best work was a 'Carbon Copy' like program that ran in less than 200 bytes of memory by effectively using the BIOS routines.
I documented my code well, as it helped me understand what I did better. I tried very hard to accomplish something with as little code as possible and explained why I thought it was best. In school, I challenged others to find ways to do it 'more elegantly' with less code and simpler logic flows. Of course, beyond writing a device driver, assembly language becomes complex in ways that rival C++ or even Objective C.
Later, I tried Forth. I could write really tight code, sometimes as efficient as assembly. However, I had a hard time with RPN and couldn't even document it well. I called it 'write only' code because it was so hard to read. By then, I had begun using C (also COBOL and PL/1). C was good for writing device driver utilities like configurators, and could be mixed with assembly for larger device drivers like video controllers (though I did not feel comfortable mixing languages). COBOL was good for writing business logic because it hardly needed much supplemental documentation. I liked PL/1 because it was the first language I used with strong typing and a checkout compiler. PL/1 forced more discipline into the start of my coding but made debugging easier. C++ was like that, but I had gotten so accustomed to C that it felt like my lover had become a dominatrix.
My point is that programming languages are as much for the programmer as for the target. When it is just me and my target (machine), the programming language is like a cerebral videogame controller, very intimate connection and control. As soon as you have a programming team, the code is no longer so intimate, as other humans must understand it. In my opinion, that is a huge compromise. However, that is life, human life.
The ideal might be a language that puts the machine on the same level as the programmers. It becomes part Product Owner and so some degree the Scrum Master, though the Scrum model would change quite a bit. Beyond the ideal, machines program themselves, and their code looks like this 010010101000110001010. Just a thought.
Anyone can play a scale on a piano. Anyone can figure out what the notes on the music mean. That does not mean that anyone can play Frédéric Chopin's Minute Waltz. More to the point, a "better" piano won't fix this.
Perhaps not, but I'd rather listen to a professional concert pianist play the Minute Waltz on a Steinway grand than a 1980s synthesizer.
So basically, a good tool lets an expert produce better output, but doesn't help a novice. Sounds about right for coding too ...
- The Sigless Wonder
No it hasn't moved or yes the 1990s C++ criticisms are still valid?
No sig today...
the real reason C++ is a dumpster fire gonzo crazy language is the language designers hate adding keywords, so they overload existing ones and add punctuation as syntax - that's where C++ went horribly wrong - a few breaking changes to add sane, descriptive keywords to replace punctuation would have helped - i looked at lambdas in C++ and just gave up
And from time to time people try to use the wrong language in the wrong way.
Jai is specifically meant to be a good tool for experts.
Nothing quite like putting PMP after your name.
http://projectmanagementplus.com/
So... just like most people's criticisms of C++ then?
C++ has moved since the 1990s, too.
Yes except exactly backwards. Much of the problems of C++ is how it has moved since the 1990s.
I'm convinced that you could design a language about a tenth of the size of C++ (whichever way you measure size) providing roughly what C++ does.
- Bjarne S.
It's call Lisp.
So what? Nobody writing performance critical software use Java, Java is just another one of those pesky bacteria that infest our infrastructure. Large companies use many languages and are pretty much forced to use Java in some contexts.
No kidding. Netscape was originally in C. They bought Collabra and allowed the failures from Collabra to do the rewrite in C++. This gave precious time to Microsoft.
227-3517
If one thinks C++ to be hard.. save everyone's time.. and leave Tech field. If learning that is hard for you thatn you are worthless with dealing with anything really difficult.
They use java because colleges churn out tens of thousands of java monkeys every year.
That is the ONLY reason.
See subject: Neither has the buffer overflow problems C has (security issues & unless you send 2 pointers into a string to determine its length (1 being 2x the size of the other & wait for error on larger + double size of smaller former)) = hassle!
* NOTE HOW HE HAS TO SAY "IN PASCAL'S 'STD. FORM'" LOL - the ABOVE is PART OF WHY HE HAS TO TRY THAT BULLSHIT!
I also love his STATIC bullshit - Variables that are LOCAL to a proc/function STAY THAT WAY (& destruct @ proc ending, even if ABORT or EXIT is used - their SCOPE is limited there). You have global vars IF You need them OR GLOBAL CONSTANTS too (so much for that CRAP too). HOWEVER - you CAN PASS variable values to other procedures (via functions), again, so much for his BULLSHIT!
No sensible way to deal w/ files? BULLSHIT - I do it everyday using Object Pascal & it works (as do 100's of 1,000's of my users too).
No way to compile LARGE programs? What is ticketmaster?? It's done largely in Delphi (& I've done programs that number into the MILLIONS OF LINES that run entire companies' info. infrastructure using DELPHI).
NO ESCAPE?? WTF is EXIT or ABORT I noted above??
He's FULL OF SHIT!
* I'd take that FOOL on any day of the week on Pascal vs. C & utterly DESTROY him (see above).
Object Pascal in Delphi DESTROYED MSVC++ in string & math performance BY DOUBLE - explain THAT Mr. K., please (every program works in them) in VB Programmer's Journal Oct 1997 issue "Inside the VB5 Compiler" w/ Delphi WINNING 4/6 tests & tying in 1 (losing only 1 which C++ lost to VB too).
APK
P.S.=> REPEAT - Kernighan is FULL OF SHIT - bring him here & I'll rip him a new asshole in seconds with the list above, easily... apk
If I want to develop fast, I use C# or Java. Absolutely wonderful languages, mainly C#. If I want to go low level, Iâ(TM)ll use C. I still find C to be an amazing language. While not as productive as higher level languages, C is a very clear programming language, and powerful. As for C++, it is simply trying too hard to be too many things at the same time, while not being really good at none. Not as clear and simple as C. Not nearly as productive and elegant as C# (or Java).
I mean, if I think, C, I think procedure oriented. If I think C#, I clearly think about objects. When I thick about C++, yeah sure, it is object oriented, but itâ(TM)s not focused... its kind of a mesh of ideas, itâ(TM)s a mess.
See subject & APK Hosts File Engine 2.0++ 64-bit for Linux h t t p : / / a p k . i t - m a t e . c o . u k / A P K H o s t s F i l e E n g i n e F o r L i n u x . z i p (remove spaces between characters & download).
Yields more security/speed/reliability/anonymity vs. any SINGLE solution (99% of threats = hostnames vs. IP address that most firewalls use) more efficiently/FASTER + NATIVELY 4 less!
(Vs. "Bolt on 'MoAr' illogic-logic" competitors slowing you, hosts speed you up 2 ways (adblocks + hardcodes u spend most time @) vs. competition loaded w/ security bugs (DNS/AntiVir) + overheads (messagepass ('souled-out' to advertiser addons) + filtering drivers) & their complexity leads to exploitation).
* ONLY 1 of its kind in GUI on Linux!
Better vs. Windows model in speed/efficiency/merge.
APK
P.S.=> I chose Object Pascal over C for 2 reasons: BETTER string (& math) PERFORMANCE vs. C++ & C bufferoverflows (stated @ outset of https://developers.slashdot.or... )... apk
Your software is just fine - well written, functional... I'm going to continue using the Host File Engine by mmell February 17, 2017
Your premise that hostfiles are a good way to deal with advertising and malvertising is quite valid - by JazzLad April 20, 2016
his hosts program is actually pretty good by xenotransplant August 10 2015
his hosts tool is actually useful for those cases in which one does indeed want to locally block stuff outright while consuming minimum system resources by alexgieg September 25 2015
I like your host file system by Karmashock September 09 2015
that APK guy, I use his host file by rogoshen1 Tuesday March 03, 2015
I personally use a HOSTS file blocker produced from a genius called APK by 110010001000 October 27 2017
* Best part = Linux 64-bit model's faster/more efficient (2x work in 1/2 the time)
APK
P.S.=> For a faster/safer/more reliable internet... apk
Several other languages have been mentioned as alternatives, or improvements, over C++. But it is not completely clear in this discussion, where Java is so superior to C++, other than obvious hardware interfaces.
This discussion should focus on problem solving solutions, not on low level hardware interfaces or on performance issues related to virtual machines or bytecode.
The best quote of this discussion was from Bjarne Stroustrup's interview at MIT, page 12 on the need for expert programmers. He favors C++ as an expert friendly language.
http://www.stroustrup.com/MIT-TR-original.pdf
You can also say that the C language is also an expert friendly language. Each language has it's niche, and C has a niche in system software not shared by C++, Java, or Javascript (barf).
So this discussion should focus on what niche C++ fits in, and what niches it doesn't fit in.
.....and you need a lot of books to elarn C++. It is a great experiment in language design.... and if you need to do actual programming, there's always C and COBOL and Java.
Hmmm. I think the -1 in this case means
"You are wrong and a fucking idiot"
But, he was trolling, you were trolling. Am I trolling?
List one of these extremely valid points he brings up. Should be easy since you said he's stated a couple ;)
We will wait....
"... C is designed to be the most powerful tool possible and it's up to you to apply it to some model."
Then there should be books about C and C++ "models". If you know of such a book, please post the title and author.
I prefer PLANC.
Anybody have that crabby patty recipe? :bad joke I know. Sue me Bruce. ;)
. If you are writing enterprise scale code in Java, then you are wasting a lot of compute power.
Why would that be the case?
If you implement a linked list in Java or C++, as each node is created, it will have memory allocated for it from the heap. When you are done with the list, each node must then be freed. With a million nodes, that is a million memory allocations and a million frees. Using custom allocators in C++, I can avoid all of those allocations and frees, and use a single memory pool for all of the objects.
I can do the same thing in Java, by reusing "freed" nodes by keeping them in a free list. learned that around 1984 when programming in Pascal, where we had a "new" keyword" and pointers but no corresponding free/delete.
Otherwise I agree with you. If C++ had a standard cross platform Windows/Widget library, threading, and reflection (and everything that comes from it like serialization) and would compile to a VM, preferable the JVM (LLVM is not enough): I only would program in C++
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
Or better yet, write a great piece of music.
Electronic music has allowed people who don't know how to write music to nonetheless compose vast pieces that are currently more popular judging by concert attendance and revenue than classical and jazz.
Western music notation is a little tricky to learn and harder to read spontaneously for players, who if not improvising act as playback device.
Composing (coding) music in western notation has allowed people to create horrible and great music -- skilled composers versus lousy composers, all using the same language.
Some avant guard composers invented new notation for experimental pieces but these weren't adopted outside of tiny circles of composers.
Perhaps the questions should be (1) what computer language most limits the accidental creation of security flaws by Average programmers and (2) what language provides the best performance?
The answer to the latter used to be assembly language back in the day.
Poor developers and libraries plague every language except those that are overly simple or poorly supported. As someone who has been writing software professionally for over 25 years Iâ(TM)ve seen very poorly designed libraries (packages, assemblies, or modules) in many languages, from Bash and Perl, to Java and C#, to C, C++, and assembly. The cause is always weak design and analysis skills, a rush to get something done, and poor or non-existent testing environment. Historically, C++ was the most widely used and supported of the early OO languages and this shows in the legacy features of pre-C++17 standard. Many lessons learned by users of early versions of C++ shaped latter languages, but took time to be integrated back into C++ because of the standards process. The standards process, often lamented, is one of the greatest assets of C++ since no single individual, small group, or company owns C++. Ultimately it is strong analysis and design skills, and a rich testing environment, that produces quality software.
No. The secret to writing unmaintanable nightmares is template meta programming. Its code that's almost not understandable by anyone other than the original author. If you're using templates for anything other than generic container types, you're probably making something no one else will ever be able to maintain.
I still have more fans than freaks. WTF is wrong with you people?
The book C# Programming in easy steps happens to be on my desk. I borrowed it from a library.
That book is about C#, not about C++, but it has the same shortcomings as the C++ books I've seen. For example, that book explains "Joining and comparing strings" on page 74 in a way that is better written than other books I've seen. But everything in the book is explained in tiny detail. There is no example of a finished, useful program.
I would like, for example, a complete, well-documented program for filtering and translating text or html files. That would provide a model for other programs I might write. (I've written such programs, but not with all the features I would like.)
Another example: I would like a sample program that uses SQLite to do something useful, like keeping, sorting, and helping correct the Thunderbird email program email address list. Such a program would quickly teach a model for database programming.
There are many elements of C++ that can be valuable in limited situations. But those who designed C++ never explained those areas of value, and the uses of those elements that should be avoided.
The biggest problem with C++, in my opinion? C++ is not finished. Nothing is finished until it is communicated in a way that makes understanding as easy as possible for readers.
another bad programmer claiming himself a game developer.. Mammoths doesn't fall from sky because of C++..
So around 15 years ago, [...] And so compilers would all implement their own specific subset of the language and there was virtually no cross compatibility
While C++98 conformance rather lagged the release of the standard, your dates are out. By 2003 (15 years ago) I seem to remember GCC being pretty much C++98 compliant (except export!) modulo a few bugs.
The first fully compliant C++11 compiler was released in 2013, the first compliant C++14 compiler in 2014 and the first C++17 compiler in 2017. Even Microsoft who has previously been noted for being a laggard has a C++17 compliant compiler, less than 6 months after the standard was ratified.
So the language started as an unimplementable mess of a spec, and unless someone has been doing some very hard work to make the language LESS complex, I greatly suspect that it has stayed that way,
The existence of three independent, compliant implementations suggest you are mistaken.
SJW n. One who posts facts.
Pocket doesn't "spy" nor are users forced to use it. You just made that up.
What are you talking about? Firefox doesn't implement anything related to SSDP.
Lots, of course. A few examples:
Microsoft: https://github.com/Azure/ioted...
Baidu: https://github.com/baidu/rust-...
Google: https://github.com/google/xi-e...
I have met way too many C++ programmers who think that an elegant design is completely trumped by a sophisticated templated nightmare that requires a deep understanding of what C++ is going to compile into.
They will have fiendishly complicated templates, move, and copy operations built into objects that are instantiated once using the same data types every time. There is no copying, no moving, no variations and yet they defend that their completely unmaintainable code is the only way and that anything else would be amateur hour.
Worse is that these bozos are becoming the gatekeepers for programming interviews. They are pretty much lining up the candidates like a firing squad to blow them all away saying, "Ha he couldn't do a second degree variadic template with a half twist of lemon... loser" at the same time rejecting concepts such as code coverage measurements in unit tests.
Unless you are pushing the bleeding edge of performance, nice simple C++ code that smells more like python, has great unit test coverage (branch checking and all) and doesn't cause your customer or marketing team grief, is the only way to go. Anything else is just some selfish dick ensuring job security.
Java has some nice advantages in terms of not caring whether you're running on x86-64 or POWER10 or ARM.
Neither does C++.
The heck it doesn't. Ostensibly, if you somehow manage to write code that completely avoids C primitive types (numbers, for example) or are rigorous about always using fixed-size integer and floating point types, it is just a recompile, but it is a recompile, so:
This is a nonzero cost. And that's the best-case scenario.
The worst case scenario is one in which you get subtle truncation bugs that occur only on some of your machines and cause data corruption that goes undetected for six months, and in which, once you detect the corruption, you are contractually required to freeze your entire website in read-only mode for three weeks and hire a team of ten thousand temps to go through all of your database records manually, correlating six months' worth of logs with data from six-month-old backups to compute what the correct current values for those fields should be.
Reality is usually somewhere in-between the best-case and worst-case scenario.
Check out my sci-fi/humor trilogy at PatriotsBooks.
I have always liked programming in C++ (and Iâ(TM)m talking about way back when it first appeared). Poorly written C++ code that has to be maintained by others is definitely a drag but thatâ(TM)s a different issue. I would concede that long, nested template instantiations for predicates can be hard to parse. Macros, typedefs, and the new auto keyword help and should be used. Otherwise, does C++ make it easy to write write-only code? I donâ(TM)t think anymore than any other language. Well written C++ is no more difficult to understand than any other 3rd generation programming language.
C++ gives you C-like performance _and_ the ability to use high levels of abstraction. Of course, it needs quite a skill to achieve both simultaneously, but at least it's _possible_!
Is there any other language out there that gives these two diametrically opposite features? As long as there isn't one, C++ will continue to be used as heavily as it currently is.
Its code that's almost not understandable by anyone other than the original author.
With the corollary that the same person a year later is not "the original author" either?
Ezekiel 23:20
C++ is a very beautiful language and one can produce beatiful code if he is using a subset of the tools the langugage provides. But even with this compromise one cne can always have to posibility to harden a bit and solve a problem that need better performance. That's the beauty of C++. You will never hit the wall of limitations you can reach easily with other languague. With C++ limitations are far away. So I write simple code and develop simple UI applications and you write vey complicated algoriths with graphics. But we speak the same language right? What is the problem with that?
Are there better or easier to use languages that weren't created by using C++? Python was created with C++ (I believe) so isn't any appeal to another language that was built in C++ just a praise for a library of C++?
When all you have is a hammer...
I always think of this when these programming language debates come along on here. Different languages are better at different things.
If I want to quickly throw something together with a pretty limited scope, you can do that with VB. If you're making something that is more critical, large, or fast, use something else.
I've found that two factors basically make not so much bad code, but bad applications:
The first usually happens with scope creep. Someone tacks something together using some high level language that solves some interim problem that works, but is only meant for that one thing and typically for a short period of time. Then because that thing works, gets used forever, gets bastardized into doing other things, and eventually you get a mess because it was never meant to be used that way using the technology it was built with.
The second thing I forget because apparently my brain has decided to not cooperate.
Anyway the other big difference between some languages is some are very "forgiving" while others are decidedly not. This means using one, a coder might make a lot of say bad decisions, yet still make something that "works", though perhaps not so optimal (and as mentioned, may run into trouble later). The other, in most cases won't let you get something that "works" unless you've more less done it "right" making for some better code. However at the same time, usually if you've done something wrong and it does work, it is something really bad. If any of that makes any sense...
Anyway I don't code much anymore, and when I do it is of the lighter smaller variety. Mostly just to make my life easier through automation of horrible repetitive tasks using VBA or Python. I use those mostly because of convenience and compatibility with other leveraged software. You could technically do more less the same thing with any number of languages, however it would probably take longer and would probably be overkill in most cases. The last time I used C++ was probably 17 years ago lol (along with a another scripting language that doesn't really exist anymore)
We'll never know because it doesn't exist.
that does not actually falsify parent's statement...
and arguably lacking multiple inheritance is a feature. (Though it's weakened a bit. At first you could only multiply inherit interface, then they added a way to multiply inherit implementation. At this point the only thing you can't multiply inherit is data storage.)
In short, if you write your code portably, it will be portable.
Really everyone should be using width defined integer types at this point. If the switch from 32 bit to 64 bit computing didn't beat that through people's heads, I don't know what will.
For most cases, I think it is. I learned programming with C++, so it was a little rough at first, but when concepts clicked, it seemed like an unstoppable force. You could write any code exactly how you wanted it to run, and had all kinds of features where you could essentially create your own language within C++ specifically for your project. As I've grown up I've learned that's not always a good thing though.
My career took me into more research and prototyping of ideas, and there I realized in 99% of cases, worrying about memory and speed at the level that C++ can provide over its counterparts, was always less productive than running more experiments or trying a different algorithm. The underlying library calls from Python are often written in C++ -- but the drivers and top level design never needed to be. I also have become less tolerant now when I see a new machine learning package written in C++ on Github. Most times it's a real pain getting it to compile with millions of dependencies, and run with the as-advertised performance. And if you want to modify them, there's usually a steeper learning curve.
That said I still don't really like Python's lack of typing, but it's what everyone in my field uses now. Maybe one day we can switch to F#
I'll just chime in with a table by Vincent Lextrait of the languages that world's largest and most famous projects have been developed in: The Programming Languages Beacon the collective choice of people working on these projects is somewhat more valuable than the opinion of a one man / two games shop trying to promote his new project.
How can C++ be a bad language when it provided me with a very good income for the majority of my working life (after some years of COBOL) ? :-)
Looking at it from a more technical viewpoint, I really don't care so much about what language I use.
The most important aspect of software development is the design of the software.
C++ is just one of many languages used to implement a software design. Typically, bad workmen (or workwomen) blame their tools.
... embedded C++ in the kernel without all that STL baggage or exception handling or multiple inheritance or RTTI or any of the other junk that makes the C++ runtime so bloated, and you end up with a halfway decent language for writing device driver stacks.
so C?
No disagreement here. The point was that some languages enforce safety, and some gracefully let you shoot your own foot if you want to.
Check out my sci-fi/humor trilogy at PatriotsBooks.
Mozilla, one of Silicon Valley's greatest success stories
You're funny.
If you are not aware of the history,
If you are not aware of who JCR is, you might want to google it. He was the person who guided Mozilla came out of the wreck that sank Netscape....
You have me confused with someone else. I've never been involved with Netscape or Mozilla in any way at all.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Regular expressions: Snobol hands down.
Web development: Colt 45 to the head Russian roulette style, alternatively Python.
Client code: Simula.
Server code: Simula again.
Full stack: Lisp or APL.
Popular doesn't mean better fuckstain.
Go listen to that whore Taylor Swifts latest abortion. Total hack job by a mediocre singer and shit songwriter.
Or go listen to any of that inbred shitheel country 'music'.
numbnuts
With the really terrible attributes, c++ is a miracle is still living (yes, I am developing in it for full time for 20+ years). - context sensitive grammar? - hierarchic system of include files, causing incredibly complex and almost untrackable actual implementations? - zillions of non-intuitive language rules? - lack of fun while trying to mentally compile your stuff because fearing to start compilation and waiting for minutes just for the simpliest modifications to produce a binary? All this crap is still breathing because main goal for c++ is performance. Other languages, like c#, gives you FUN, because - lacks context sensitive grammar - lacks #include madness - has perfect interface and implementation separation - has truly multiplatform API and ABI compatibility (a C# exe compiled on Windows runs unmodified on Linux) - well thought out libraries from scratch, covering almost all aspects of everyday tasks On some days, I feel myself like a COBOL dynosaur, waiting for extinction in an extremelly well-paid position, but prostituting myself and wasting my brain cells for memorizing pointless c++ rules,,,