C++ Creator Wants To Solve 35-Year-Old Generic Programming Issues With Concepts (cio.com)
C++ creator Bjarne Stroustrup is arguing that we can improve code by grounding generic programming in concepts -- what's required by a template's arguments. An anonymous reader quotes Paul Krill's report on a new paper by Stroustrup:
In concepts, Stroustrup sees the solution to the interface specification problem that has long dogged C++, the language he founded more than 35 years ago. "The way we write generic code today is simply too different from the way we write other code," Stroustrup says... Currently an ISO technical specification, concepts provide well-specified interfaces to templates without runtime overhead. Concepts, Stroustrup writes, are intended to complete C++'s support for generic programming as initially envisioned. "The purpose of concepts is to fundamentally simplify and improve design. This leads to fewer bugs and clearer -- often shorter -- code"...
Concepts, Stroustrup believes, will greatly ease engineers' ability to write efficient, reliable C++ code... The most obvious effect will be a massive improvement in the quality of error messages, but the most important long-term effect will be found in the flexibility and clarity of code, Stroustrup says. "In particular, having well-specified interfaces allows for simple, general and zero-overhead overloading of templates. That simplifies much generic code"
Concepts are already available in GNU C Compiler 6.2, and Stroustrup wants them to be included in C++ 20. "In my opinion, concepts should have been part of C++ 17, but the committee couldn't reach consensus on that."
Concepts, Stroustrup believes, will greatly ease engineers' ability to write efficient, reliable C++ code... The most obvious effect will be a massive improvement in the quality of error messages, but the most important long-term effect will be found in the flexibility and clarity of code, Stroustrup says. "In particular, having well-specified interfaces allows for simple, general and zero-overhead overloading of templates. That simplifies much generic code"
Concepts are already available in GNU C Compiler 6.2, and Stroustrup wants them to be included in C++ 20. "In my opinion, concepts should have been part of C++ 17, but the committee couldn't reach consensus on that."
We'll see.
Bjarne Stroustrup, Doug Lea, Knuth, etc... still make feel like a moron on a almost daily basis....
That's what C++ needs: More features! They had better introduce sidgils like in Perl so they can have room for more keywords.
Templates produce very bloated code. Most embedded programmers working in C++ use a very small subset of the language for a reason. But C++ has lots of other problems. It was nice when it saved you from having to hand-build vtables doing OOP in C. Now after the meta-programming fads have gotten into it the language seems all over the map.
The vagaries and complexities of C++ as it progresses in it's specification is reminiscent of efforts to get epicycles to explain motions of heavenly bodies. Geez, people are snide about Perl syntax. Now we have &ref, &&global_ref, [](args){my_lambda_code();}, copy constructors, move constructors, 'override' to fix virtual function breakage. This is just a mess of a language.
In a band? Use WheresTheGig for free.
I was just saying, "You know, C++ is too straightforward, and there are too few ways to get things done. It needs a few more keywords and paradigms to make it make it work."
What a freakin' mess.
c++ is due for deletion
When a "high" level language require half a dozen or so ways to implement a cast, it's time to go.
Remember when a programming language was truly object-oriented? I mean the object was what it
produced; not itself.. Look at any C++ code lately, you see what I mean. C++ programmers care
more about the screaming during the delivery than the baby.
And we're still waiting for a decent C++ strcpy() implementation! Not gonna happen...
Jeez...
CAP === 'beatify'
https://www-users.cs.york.ac.u...
"Well, one day, when I was sitting in my office, I thought of this little scheme, which would redress the balance a little. I thought 'I wonder what would happen, if there were a language so complicated, so difficult to learn, that nobody would ever be able to swamp the market with programmers? "
New features force . . . you!
Seriously, people, you may decide to forgo those features, but you may be "forced" to maintain code using those features that you need to figure out what that code does.
Another slow addition to an already slow language.
Just program in Java. Java already supports "concepts", this is just another way C steals from Java in order to make it relevant, and appear fast.
Java is the language of the future.
We will all be programming java, using java runtimes written in java, running on java runtimes written in java, because recursion [a concept!] makes things faster!
Java runtimes are written in c/c++. Java needs a runtime written in another language because java cannot "self-host".
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Look at the bright side. It might just be enough for people to take their skills back to the land of C instead, and actually learn how to manage memory instead of depending on all sorts of smart/weak/whatever_ptrs. And bye-bye to the STL and the GoF.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Well, when I was thinking about programming languages a long time ago, I have come to a grudging respect for Windows, and backwards compatibility. Really good compilers, IDEs and debuggers will take many man years before production code can be made. In order to get that fancy stuff, you need a really big market to justify all that expensive development. That god scripting languages don't require such complicated tooling, and one has choices. I'm looking at you Javascript!
I want him to roll in the additions from Cilk++, Aspect-Oriented C++ and FeatureC++, the mobility and personalisation capabilities of Occam Pi, the networking extensions provided by rtnet and GridRPC, full encryption and error correction code facilities, everything in Boost, and a pointless subset of features from PL/1.
If you're going to do it all, might as well do it in style.
Seriously, though, Aspects would be nice.
It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
I never saw that in the many years I was working primarily with C++ and a regular reader of the related newsgroups. When Bjarne did contribute in any forums I followed, he generally seemed direct and reasonable, and it was usually in the more advanced discussions about tricky areas or the future of the language.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
OK, thanks I will correct people spreading such rumors.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
How about first fixing something much more basic, like modules?
I used to be a C/C++ dev, and wrote a lot of COM objects for the financial space back in the day. The ten different ways to cast something was becoming a pain to deal with. .NET/C# for my company in about 2001, liked what I saw and moved over to C# with a short stint in Java along the way, and I have NEVER looked back.
Writing LOB applications is all about delivering functionality for the end user. In C# I've designed the most, developed the most and maintained the most applications I've ever managed to do in my 30 year career in software development.
I was tasked to evaluate
Beautiful generics, LINQ, clean looking code, interoperability with legacy code, ultra-rich APIs and a rock-solid dev environment, ECMA-standardised are clear winners for me and C#.
A greybeard trying to breathe new life onto a now 30 year old language he put together doesn't surprise me, but C++ is never going to get the attention it once had. Sorry Bjarne, I saw it all before with Bertrand Meyer trying his darndest to keep Eiffel relevant. Same thing's happening with your baby, sorrry to say.
This is actually how the GNAA spawns new members. For years, a requirement for joining their group was to first post this spam on slashdot, and it may still be the case. They are a group of dual classed hacker/trolls. As with all the posts, you could be witnessing the birth of a new member, an old member being bored, or a nonmember who just wants to fuck over discussion if possible. In general, it will get modded all the way down, and often deleted. But anyway, this is what these posts have looked like for years.
The key difference between this and interfaces in Java seems to be push vs pull, does a class explicitly declare that it is say sortable or do you just check if it has functions that match something that's sortable. If you look at the example he does on page 8 with Shape.draw() and Cowboy.draw() sure you could be more explicit in the template requirements or you could demand that the cowboy explicitly has to say he's "drawable". To me Stroustrup's idea sounds a bit too much like the story about the blind man and the elephant, if you only touch it in enough places you can be sure it's an elephant. The obviously problem is that once you have a birth defect or amputee with only three legs, it all fails.
For example I might like to define a class "SequenceNumber" that has functions like setInitialValue(), getNextValue() etc. but lacks typical characteristics of a number like being able to add and subtract them, but I can still sort sequence numbers. If it's explicit I only have to declare it sortable and implement the necessary functions. If it looks at the "concept" number it'll say nope, you're not a real number because we can't add two of you together.
This could be trivially avoided by having the possibility to supplement class definitions as implementing additional interfaces, like here's a library with the Circle shape header and I say it's a drawable even though it doesn't say so itself. It'll still have to actually fulfill the interface, but that way you're not bound by the ones supplied by the library. Since that's purely a synthetic check on whether your code should be able to call that code I don't see how that should be a problem.
Live today, because you never know what tomorrow brings
The real problem with C# is forced garbage collection. For your case, it may not matter, but in large memory needs I've seen GC run 30% of my CPU. Sure, you can find ways to pin memory - reuse it - but then you complain about "10 different ways to cast", which frankly is a stupid complaint compared to GC.
C# is fine for many. For performance cases where lots of memory use is required, to name just one, it's not a good choice.
Concepts lets you check that the parameters of a template instantiation satisfy the template's requirements. However, it doesn't let you check that the *definition* of a template is valid whenever the parameters satisfy the template's requirements. So it's really only solving half of the problem.
GCC & clang are written in C++, Windows' kernel is written in C++, python is written in C, linux in "object oriented" C (there is plenty of template/virtual-table/inheritance/constructor/destructor code).
Why would they go back to C, when they could instead just stick to using whatever subset of C++ that they find useful?
The fact that feature X is available doesn't mean you are required to use it.
I don't care if it's 90,000 hectares. That lake was not my doing.
Only the poorly educated say 'learnt' in the US (it's 'learned') here, but using a 't' for past tense is a legitimate British grammar construct. I've seen terms like this in respected British publications. More here.
I want people to not think they understand me when they don't more than I want them to understand me due to the odds involved, so I choose slightly harder to understand constructions. People generally come back with the notion that I am stupid, and that I think my statements are too brilliant for the average mind.
By no means. I think that if the average mind takes an honest stab at what I am trying to convey and asks for clarifications they can readily come to understand what I intend to get conveyed. Very few have gone that route, though.
But anyways the concepts expressed by those people aren't that out of reach and just require some dictionary lookups and Google searches that require reads of still other articles. By this approach the meaning of just about anything becomes substantially clearer.
Trump does tend to oversimplify so that his followers only think they understand. If the parent post meant to say that Trump is like a child who only thinks he understands, that is not the case, but the former is pretty true.
I wanted one I didn't get. I forget exactly which two I have, but besides the one in C there is one in C++ and one in Java. If I recall correctly I have the C and Java one. I think I bought the C one myself and added the C++ edition to my Amazon gift wishlist, but my Aunt thought she had a better idea to buy a newer edition. My wishlist now contains only things that it doesn't matter about editions.
Because everybody knows that QB64 is the most productive language to program in. There's a huge library of code that will compile in it and IBM samples included with DOS will compile with it. Compressed files with IBM DOS and the aforementioned samples are available on the net. https://www.bing.com/search?q=...
Seems everyone I run into these days who says "I'm a software engineer" has zero CS instinct
That's because software engineering has very little to do with computer science. A software engineer solves real-world problem with software.
How many cops do you run into these days that have more than the strict minimum knowledge of the law needed to do their job? Does that make them incompetent cops, or is it possible that maybe a different skill set is required?
If you want to stick to academia and horse around in labs that depend on grant money and alumni, knock yourself out, nobody is stopping you - there will always be a need for abstract thinkers. But out there in the real world, people must build things on time and on budget, and while we all wish that the best algorithms and the most elegant code is the way to achieve that, when push comes to shove, shipping the product is what pays the bills and if that means ugly code, then ugly code it is. Do you think the POS software on the cash register that allowed you to buy grocery this week is a masterpiece, or that the algorithm that decides when and how to to take over your car brakes is flawless? No, it's probably full of bugs and hard-coded passwords and antipatterns. But guess what, you still got that food in your fridge and you've made it alive on the freeway. Good. Enough.
lucm, indeed.
Just because you never encountered the variant "learnt" in your small world doesn't make it wrong, idiot.
Those who do not learn from commit history are doomed to regress it.
Why would we want to do something the compiler can do? There is no bragging rights to stupidly doing what a compiler can do. I can know exactly the scope of some malloc'd buffer, but so can a wrapped type like a vector. Why would I possibly want to waste time writing and testing/valgrinding to make sure every malloc is freed when the compiler can automatically call the destructor for me?
Only idiots brag about doing excessive work.
Those who do not learn from commit history are doomed to regress it.
The concepts thing sounds interesting. But when will C++ run on Node.js and MongoDB? That's the real question.
Why would we want to do something the compiler can do? There is no bragging rights to stupidly doing what a compiler can do. I can know exactly the scope of some malloc'd buffer, but so can a wrapped type like a vector. Why would I possibly want to waste time writing and testing/valgrinding to make sure every malloc is freed when the compiler can automatically call the destructor for me?
Because you have information that the compiler doesn't have. Like what's vital code and what's gilding, and how to prioritize based on business needs. You can free up non-critical code allocations early to avoid background gc impacting performance, or re-purpose already allocated memory in critical code to reduce overhead, or a large number of other techniques that are available because you know more than the compiler.
Why do anything that a machine can do? Because in many circumstances you can do it better. Use automation where useful, but when you have knowledge that the automation lacks, use it. Whether you're driving a car, cooking a meal, composing a song, or writing a program, use your special knowledge and skills. If you think a black box can do it better than you can, you're probably right. And ripe for being replaced.
You can free up non-critical code allocations early to avoid background gc impacting performance
Nothing in C++ stopping from doing that. That's what scope based resource management gives you automatically. In C++, you allocate in the precise scope you need it and when that scope ends it's freed for you. You don't even have to think about impacting gc performance. You kind of proved my point that a compiler just makes that easier while sacrificing none of your control.
or re-purpose already allocated memory in critical code to reduce overhead
Again, nothing in C++ stopping you from doing that. In fact, move and perfect forwarding makes it even easier to repurpose resources but without sacrificing the deterministic destruction. And you STILL don't have to waste time writing clean up code.
Because in many circumstances you can do it better.
None of yours were examples of that and in fact shows its better to leave it to the compiler because it's a waste of productivity in most cases. And given the amount of access bounds and resource management errors in C code written today, it is a fact that it is not better to leave it to humans.
Those who do not learn from commit history are doomed to regress it.
Linux is written in C.
In appearance, yes, but they rely on all kind of compiler extension to really use an object-oriented C, for example __typeof__() to mimic templates. It's also full of function pointers, overload, inheritance, etc.
Why not simply, get rid of curly braces, restrict C compatibility, and just rename it to Ada while you are at it...
In appearance, yes, but they rely on all kind of compiler extension to really use an object-oriented C, for example __typeof__() to mimic templates. It's also full of function pointers, overload, inheritance, etc.
And of course the compilers used to compile it are written in C++ now.
SJW n. One who posts facts.
The problems appear when people with no technical background make the decision of which language to use for a particular project. They base their decision on what they heard from friends or on the latest buzzwords. For example Scala is now imposed on some projects simply because of the word going around that it is the latest and greatest thing.
Experienced developers have already agreed that C++ is great for writing libraries. Personally I use it because I can do everything I need with one language. Handling large data trees, SSE optimizations, OpenGL graphics, all in the same language, but these are all one-person projects.
Go to any large organization and look at a C++ code base developed over 20 years by a team of kept to a size of about 50 developers, when each developer spent an average of 2 years on the job. After a while you can identify what different developers tried to learn on the job.
By the way, I saw similar code bases, but developed in Java. They look just as bad as the C++ ones, and the managed environment which prevents crashes makes the bugs more difficult to find.
"Concepts are already available in GNU C Compiler 6.2," So, it is a standard :-)
Pretty much. I'm sure that this new concepts thing is an improvement over whatever they have; but when I compare it to the equivalent in Haskell I almost want to cry. The way they do it in Haskell seems so much cleaner and less of an after thought.
Any type simply declares that it implements Ord, or Show, or whatever you need, and then functions can declare that they require a type to implement that.
Of course Haskell has it's own problems with error messages not being entirely useful and code being slow as shit if you don't know exactly how to optimize.
That's not necessarily true. Smalltalk VMs have been written in a subset of Smalltalk that is statically compiled for a while, and these days the JIT parts are written in the full language. In the case of Java, the sun.misc.Unsafe package include pretty much everything that the JVM needs to be able to do in terms of bypassing its own safety guarantees to be able to self host. In Jikes, the JIT and GC are written in Java. The main reason that JVMs are written in C/C++ is that you don't get much benefit from writing the bit of code that is explicitly allowed to violate a language's invariants in that language (and it makes bootstrapping harder).
I am TheRaven on Soylent News
Device drivers in XNU (iOS / macOS) are also typically written in a subset of C++.
I am TheRaven on Soylent News
... such that it would be amenable to have a simple, self-contained explanation. He avoided the more hairy subjects.
He did not go over the structure of the proton, or QCD and try to make those accessible.
And for the more accessible subjects other physicists have done a great job at explaining them as well. Landau and Kitaigorodsky come to mind.
Because each person will probably want to use a different subset, so eventually you end up with code that uses a lot more c++ than you ever intended, which means everyone has to be aware of all the peculiarities of all of c++, the stl, etc.
Consistency is a virtue.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
It's not excessive work if you just remember what your mother told you - if you take it, put it back when you're finished with it. Memory management isn't that hard once you keep that in mind. Programs should be deterministic. You don't need valgrind if you know what you're doing. Then again, the same people who think that it's okay to write random shit and then test it in the hope of detecting leaks would freak out if they ever had to write in assembler.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Who cares what the JIT and GCC are written in? In the end, the actual code has to run on a runtime - it can't run itself. Hence the need for a JVM. If Java could compile to runable binaries instead of byte code, you'd have a point, but it doesn't.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
C++ destructors are deterministic. It isn't that hard of a concept.
Having to write clean up code more than once, ie outside of a destructor, is excessive work. I can write a vector, with one destructor, knowing everywhere the vector is used, its destructor will get called when its scope has ended without me having to write it. Deterministic and an efficient use of my time.
Whereas with malloc, you have to write free every single time afterwards.
Do the maths.
And what about shared ownership? Very common pattern in user interfaces. Look at the mess C UI frameworks are with their manual reference counting.
Seriously, if in this day and age you can't understand that scope based resource management is deterministic, maybe you should seriously consider actually learning the concept.
Those who do not learn from commit history are doomed to regress it.
C++ is also a mess because it has to support backward compatibility for a huge amount of code already written for the industry.
Wouldn't that be a problem for the compiler than the language?
Blaming just the committee for it is ignoring history.
A benevolent dictator could pull a Python by declaring a new version C++ that cleans up the language and is mostly backwards compatible.
C++ is many things to many people, but efficient? I don't agree.
https://www.youtube.com/c/BrendaEM
And you SHOULD write free() every time you write malloc(). Allocate it in one place, use it, free it. Anything else is just begging for problems. As I said, if you take something, put it back when you're done. Even Java runs faster if you expressly call the garbage collector when you're done and have only thousands of objects to check to see if they can be deleted rather than waiting for the GC to pile up a million objects and then decide that "oops, I need to free up some space, lets walk those million objects, oh wait, let's lock up the whole UI for 30 seconds because this sucker is running on a computer with a YUGE amount of ram and we took it all .."
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Seems to me like you've never worked on anything large enough that one person can't do it all.
... or anything with libraries.
First, those 10 things aren't "organs", they're just features. Your fingers aren't organs either, even though you probably need them to function normally every day.
Secondly, the article is partly wrong. For #1, it even admits that the "third eyelid" is useful for ensuring tear drainage and sweeping debris away. #9 is flat-out wrong: the appendix, while not essential to life, is very useful when you have big problems with your GI system. It's basically like a first-stage bootloader for your gut bacteria. You may never even need it, but when you do, it's really useful. #10 isn't a misfeature, it's a by-product of the way we develop as embryos. Take away male nipples and you lose female ones too, which really do have an important function. Eliminating them without losing the female ones would probably require a significant re-engineering of the genetic code, which doesn't happen with an evolved system. #4 sounds like #9: calling something "useless" because we don't fully understand it yet. Maybe we really do make good use of the ability to detect pheromones (or then again, maybe it causes us to make terrible choices for dating/marriage partners). For #3, I've read some people claim that armpit and pubic hair does serve some important function WRT bacteria, I forget exactly what now. It may have some truth or may be bunk, I don't know, but as seen with #9 and our complete lack of understanding until very very recently the role of gut bacteria (such as with its effect on obesity), it does seem like our medical sciences have largely overlooked the roles of bacteria on human health over the years.
So back to C++, just because you don't see the need for a feature doesn't mean that it's actually useless. A good example here is the 'volatile' keyword. It's useless in most C++ programming, but absolutely essential if you're doing low-level hardware access on an embedded system.
It doesn't need to be that backwards-compatible. When you compile C++, you can easily set the compiler to use a particular standard (c++0x, c++11, c++14, etc.).
So if you have old code, simply direct your new compiler to follow the older standard instead of the latest one. You don't need to drag everyone else down.
No, because whenever you add new syntax, you have to avoid breaking compatibility with old syntax.
No, you don't. You just need to tell your compiler to use the older standard. GCC does this with the --std= flag. If your code won't work in C++17, just add "--std=c++0x" or something.
And just how successful python 3 is? In every shop I worked in, they insisted on using python 2.
The problem with Python is they didn't do it like C++. To run a Python2 program, you actually have to have a Python2 interpreter/runtime and libraries compatible with it. You can't just take the latest Python3 interpreter and pass it a "--std=python2" flag and make it work. So you end up having to have two entirely separate and parallel installations of Python. It's a big mess. C++ isn't like this; you can even compile your libraries with a different C++ standard than your application code or each other, because the linker will resolve the linkages.
The problem isn't backwards compatibility, the problem is that Python did a terrible job of making a new version of their language.
Here we agree. I don't understand what's the problem with the standard defining something like this:
#include <no_backward_compat>
GHC Haskell has something similar that forces you to specify dangerous and obsolete language features that you want to use. It can easily be applied to C++ as well. The weird thing is that I never even heard of someone offering this.
Avantgarde Hebrew science fiction
Seems to me you're making suppositions without any evidence. There are plenty of projects involving lots of people that didn't use automatic memory management - pretty much all those old programs that got the home computing industry off the ground, when using c++ exclusively would have been far too slow, and way too memory-bloated.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
YOU can't determine that since you don't determine when there are no more references to the code
Yes you can. Most things are not shared pointers, and shouldn't be shared pointers. Most C++ Standard Library objects are decidely NOT shared pointers but use RAII. Get with the times - that was the case since C++98, but apparently you won't bring yourself to accept it. Hell, even in C++98, the "smart pointer" library type was auto_ptr, which is decidely NOT shared, and that's been superseded by unique_ptr, which is NOT shared, which was based on Boost's scoped_ptr, which is NOT shared. Keep staying stuck in your pre-98 knowledge
And you SHOULD write free() every time you write malloc().
Yes, you should, if you're writing malloc and free. But if a compiler can call the equivalent of free for you every time, why stupidly keep doing it yourself? I call "free" every time I "malloc" because I create and/or use types which make that happen automatically. AND THEY DO NOT SHARE REFERENCES. Get that through your head please.
Also, if UI frameworks are a mess, blame the authors.
No, UI frameworks written in C are a mess. Frameworks like Qt are just fine, WITHOUT the use of shared pointers. But, hey, keep ignoring that point because it's inconvenient. Even Linus changed his diving software from GTK to Qt, even though he hates C++. He could not find a UI framework he liked written in C, that's how bad it is.
It should always be possible to know with 100% certainty which piece of code "owns" the resource. . . . Allocate it in one place, use it, free it. Anything else is just begging for problems.
Yet tools like Valgrind exist because that's what C programmers need. In a perfect world, everything would work perfectly. You should be complaining about the world not being perfect.
Even Java runs faster if you expressly call the garbage collector when you're done
Yes, and even better is if I don't even need a garbage collector, especially a mark and sweep garbage collector because I'm NOT using shared resources almost all of the time.
Those who do not learn from commit history are doomed to regress it.
RAII is wrong. It's sloppy. Stop drinking the kool-aid. And I stopped using valgrind a couple of months after I started using it. Write code properly, you don't need valgrind or ANY other memory leak detectors. Also, valgrind introduces bugs because it changes the running of your program, especially multi-threaded code. I never used any sort of garbage collection or STL classes in c++ - I alloc(), I free(), and f*ck new and delete. Not needed, same as templates, same as all the modern build tools, the whole "we have a problem to solve that no language solves, so let's invent yet another language", shit like ruby, the gazillion javascript libraries, etc.
Call me when your *nix OS is written in c++ - then we'll talk.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
RAII is wrong. It's sloppy. Stop drinking the kool-aid.
How would you know? Judging by our conversation, it's obvious you know nothing about it. You obviously stopped learning C++ long before the 98 standard, or you didn't bother to learn something properly.
I never used any sort of garbage collection or STL classes
You use garbage collection. You just stupidly write code that a machine could do for you because you have gross misunderstanding based on an unwillingness to learn.
Not needed, same as templates
Templates can make code faster than C code. Just compare std::sort to qsort. Templates allow high level optimizations not possible with pointer based "generic" code. Templates aren't needed, but they're better.
Call me when your *nix OS is written in c++ - then we'll talk.
Whatever. The compilers used to build those C Unixes are written in C++. GCC has been compiling as C++ for a while now, but you probably didn't want to know about it either.
same as all the modern build tools, the whole "we have a problem to solve that no language solves, so let's invent yet another language", shit like ruby, the gazillion javascript libraries, etc
We are talking about C++ here, so the whole "let's invent another language" doesn't EVEN apply here. But trust you to not bring up any points of relevance.
Those who do not learn from commit history are doomed to regress it.
C++ keeps inventing new features. It's one of the best examples of bloat going.
And you clearly don't understand templates if you claim that template code runs faster. All template code does is allow the precompiler to generate code that could also be generated in other ways, such as by a script. The resulting code runs at the same speed in either case. As for sorting, you can write different sorting routines based on the data and needs that are faster than anything you'll find in std::sort.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
"Good. Enough."
Ah, the cry of the "programmer" who churns out barely functional junk. Let us know how you get on after your non-job is automated.
"Good enough" means fit for purpose. If you go beyond that you're not solving a business problem, you're feeding your OCD on the company's dime, like an office manager that puts barcodes on office chairs.
lucm, indeed.
I see nothing wrong with your OpenGL example. You basically used python to flush out requirements and determined that you needed a more robust language to get you to the next level. That's the "nail it then scale it" approach, which is pure engineering.
lucm, indeed.
C++ keeps inventing new features. It's one of the best examples of bloat going.
Hey, you can keep living in the stone age if you want. Things were simpler then in the good ol' days.
And you clearly don't understand templates if you claim that template code runs faster. All template code does is allow the precompiler
I don't understand templates? You're calling it a "precompiler". Templates don't run in the precompile stage. Macros run in the precompile (or preprocessor, rather) stage. Templates require the full type information that is generated as the compile process goes along. Preserving type information allows for checks and optimizations that are not possible with void pointers, or pointers in general.
generate code that could also be generated in other ways, such as by a script.
And yes template code does run faster because of the "generated code". THAT IS THE POINT. Not just a moment ago, you were decrying the creation of new languages blah blah, and here you are talking about writing scripts to generate code. Where do you think those new languages come from if not because of people like you who would rather do more work for little benefit because it fits into some extremist ideology?
As for sorting, you can write different sorting routines based on the data and needs that are faster than anything you'll find in std::sort.
In case you didn't know, TEMPLATES can choose different routines based on the data. That's the whole point of templates. eg, you can have a generalized copy-range function, but depending on the compile time type, have it choose a fast copy using compiler intrinsics. That's the point of the std::sort example. Not because std::sort is the one and only sort, but because it is a demonstration of templates. Templates provide the ability to have tailored optimal algorithms without having to keep writing zillions of slightly different interfaces, or use void pointers and lose type information.
Those who do not learn from commit history are doomed to regress it.
The JIT and the GC are the two parts of the VM that must be able to escape the constraints of the language model (the JIT must be able to generate executable code, which the Java security model doesn't permit, and the GC must be able to allocate memory and assign it a type and delete objects that are still reachable). Absolutely everything else in a JVM can be implemented in Java fully respecting the language model. You can write almost all of a JVM in Java, as long as you have a small amount of statically compiled Java code that is treated as trusted and so permitted to violate the language invariants. This is precisely how Smalltalk VMs are typically written. There is no requirement for C/C++ to implement Java, it's just an easy way of doing it.
I am TheRaven on Soylent News
Originally, new and delete were just wrappers for malloc() and free(). History - it provides context - and both malloc() and free() still work just fine in c++ - or did you forget that because you're wilfully blind? Same as you thing that std::sort will be quicker than bsort()?
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Check again. Template code is generated before the translation to machine language stage. And I'd rather invoke bsort() directly than depend on a template getting it right - because knowing the type of data isn't going to also know that the data is ordered in such a way that bsort() can be used, which is far quicker than qsort() or any other algorithm. You need to know that the data is ordered properly, or bsort() won't give right results - and the compiler CANNOT know that.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Or don't use containers, duh!
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
And yet as of Java 8, nothing in the JVM is written in Java. It's all c/c++. Almost 250,000 lines.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Than to replace those 50 lines of template compile errors to something the poor sucker who has to try and understand someone else's template code can actually read, yet alone understand. I vote !Yay!
"The first thing to do when you find yourself in a hole is stop digging."
Check again. Template code is generated before the translation to machine language stage.
First, the "compile" stage is not just the code generation phase. The semantic analysis is pretty much part of the compile phase. Second, The type information preserved by templates can aid in the code optimization stage.
You need to know that the data is ordered properly, or bsort() won't give right results - and the compiler CANNOT know that.
Whoop de do. You can write a generic bsort in C++. You can write a generic algorithm anything. But please, keep missing the point as you keep doing.
Those who do not learn from commit history are doomed to regress it.
And YOU miss the point that a human, having better knowledge than the compiler can ever have (no, your "semantic analysis" won't tell the compiler to use bsort()) can do better with a smaller footprint, so fewer code paths to verify, fewer side effects, easier to check for and handle corner cases, etc.
Not my fault that YOU aren't that human. And that IS my point, at this point. You want one size fits all, because that's all you know.
People like you are the reason that people think running Doom in a web browser is somehow cool, even though it runs slower on a machine with 5,000x more cpu instructions executed per second than a 386, 2,000x more ram than that same old 386, 2,000x more video ram, but oh look - web.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
And YOU miss the point that a human, having better knowledge than the compiler can ever have
Which is why there are no bugs, ever.
You want one size fits all, because that's all you know.
Explain why I know Java, Javascript, Python, LISP, assembly, plain-C, REXX, awk etc
People like you are the reason that people think running Doom in a web browser is somehow cool
Why would a C++ programmer want Doom to run in a web browser?
Those who do not learn from commit history are doomed to regress it.
That's the great part - bug counts are going to be far lower if you HAVE to have complete knowledge of what's going on. And you take that one-size-fits-all approach to everything you do, no matter what the language. You just follow the crowd, never thinking outside the box. And seriously, awk? What next - brag about knowing grep? That's just stuff that comes with the territory, same as framing a house, it's assumed you know what a hammer is and which end to hold.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
That's the great part - bug counts are going to be far lower if you HAVE to have complete knowledge of what's going on.
Publish your solution to the halting problem and then we'll talk.
And you take that one-size-fits-all approach to everything you do, no matter what the language.
Coming from the person who obviously thinks everything should be written in C.
And seriously, awk?
Wow, you've seriously lost it in your old (mental) age. You tried to criticize me for supposedly only knowing one language. Then I proved you wrong. Instead of accepting that you come up with yet another non-sequitur. The fact I have used multiple languages to do what is needed is proof I don't have a one-size-fits-all approach.
Remember: YOU'RE the one who went of on a headless chicken rant about young'uns inventing new languages left right and center, but at the same time maintain the cognitive dissonance to also hate people who want to add new features to a language to avoid having to invent new languages all the time. Sort your own cognitive dissonance out first.
I'm done talking to you. This whole discussion has basically been about you being an old fuddy duddy who not only hates learning anything new, but wants people to stay stuck where you are. Here's an idea: FUCK OFF. Why are you even here? If someone wants to add to their language, IT DOESN'T AFFECT YOU.
Those who do not learn from commit history are doomed to regress it.
bsort is a much narrower domain, and is thus far less useful.
bsort() is used anywhere you have indexed data, unless the implementors are complete morons. It's been that way pretty much since the beginning - it's the obvious choice for searching sorted data.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Why use a whole library when you can do it quite easily with a page of code that is simpler, specific to the task at hand, and you don't have to worry about hidden side effects because you don't have to audit the whole damn library to find that one little piece makes the whole thing not thread-safe?
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Actually, I *did* publish my solution to the halting problem, under my original account, years ago. Got into a nice argument with an engineering grad student who couldn't find a hole in it.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Only the poorly educated say 'learnt' in the US (it's 'learned') here, but using a 't' for past tense is a legitimate British grammar construct.
I don't know when I've seen such a glide from prescriptivism to descriptivism in a single (albeit compound) sentence before. Perhaps in Bryson's book on English. (As a professional crank, Bryson's good at freely mixing fact and opinion.)
In any case, DARE[1] shows some regional use of "learnt" in the US, and I dare say[2] that you'd have a difficult time demonstrating that every such use was by someone who is "poorly educated" by any reasonable standard.
Certainly use of the -t suffix has been declining on this continent for more than a century, though in English as a whole the trend is not so clear. And it's not just the past-tense inflection of verbs, as the rarity of "whilst" in this country shows.[3]
[1] The Dictionary of American Regional English, the unassuming name for a mammoth project to catalog regional differences in English usage in the US.
[2] Heh.
[3] Etymologically "whilst" is "whiles" + -t, where -t is still in effect a suffix indicating the past tense. But "whilst", a synonym for "while", is pretty much always used grammatically an adverb, even if etymologically it's the simple past tense of "to while" (as in "while away the time"). All this thanks to the eagerness with which English users move words among parts of speech.
You're right. It's been years since I've been able to code ... (wasn't able to read for a couple of years, had a concussion (and probably seizures from too low blood sugar - 0.9 is scary low, a personal record) that put me out for almost 2 hours, since then all attempts have failed until this week, where it appears to SLOWLY be coming back. Not the algorithms - they never left. Just the "okay, I'm sitting in front of the computer, I want to write some code, start the editor, ... blank - nothing happens." Happened for a year back in the '90s after a sexual assault, the mind can be a strange thing.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
Are you fucking sick? The differences between freebsd and linux are a few header files and some conditional includes - works fine on both platforms. Or do you think that it's mandatory to include windows when writing server software? Which would make you doubly sick.
"Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
than you shouldn't be using C.