Oh, they are moving towards C.
That is awesome. +1
C vs c++ (again)
Why would that be awesome?
Are there somewhere some real world test showing real (and especially consistent) performance gains for using C instead of C++?
Or do I have to suppose the usual, tiresome “I’m an old C goon, simply I’m too lazy to learn C++?”
There will be no performance gains and code will be more verbose.
C is much better than the shitstorm that C++ is, C++ is a huge clusterfuck. http://harmful.cat-v.org/software/c++/linus
Good luck writing server software in C.
I wonder how many crashes, leaks and security holes it would have comparing to modern C++, not mentioning more safe languages like python/Java/whatever they use now I don’t keep track.
Who talked about writing servers?
My point was that C++ is a clusterfuck, a bloated language that brings pain and suffering to the universe. for me C is much better because it is MUCH more simple, but also not my favorite language btw
Writing servers is just an exaggerated example. Server software pushes requirements to limits. It’s just when you write other apps you may ignore some issues. They are still there tho, just less relevant.
Does C have ways to guarantee resource release? No. Does C have safe pointer management? Again no. So, given the same magnitude of the project, you can write more secure, safe and stable code in C++ comparing to C.
oh dear god, nevermind
Quoting Torvalds:
" I’ve come to the conclusion that any programmer that would prefer the project to be
in C++ over C is likely a programmer that I really would prefer to piss
off, so that he doesn’t come and screw up any project I’m involved with.
C++ leads to really really bad design choices. You invariably start using
the “nice” library features of the language like STL and Boost and other
total and utter crap, that may “help” you program "
Can a mod move this stuff to an off topic thread? Thanks
nginx, apache.
I agree that C ++ is a little safer than C, but it also requires very careful use.
I think let C die in peace!
Yes, but the majority of android apps are not create from C.
The reason why C is popular in research and development, and hardware driver interface is because there is not many alternative. Most hardware libraries are created in C.
In terms of software application, there are many language variant. Some people love pascal, fortran, C++, Java, C#…
A C library can be wrapped and hidden away, as most of our third party libraries should be hidden away regardless of if they’re C or C++. Unless someone is seriously considering re-writing Urho3D as a C library, then this isn’t really a useful argument at all. There hasn’t been a productive or interesting C vs C++ flame war in the history of the internet, so I don’t know why anyone would assume now was the time to have one.
You can write great code in C++ and you can write garbage code in C. You can also write garbage code in C++ and great code in C. However it is much harder to do it in C. Quoting Torvalds is one thing. Thinking you could live up to his standards only by switching a language is laughable. Programming language is just a tool. If you cant wield C++ well, what makes you think you can do better with C? After all, C++ is a superset of C. If you like - write a conservative C++, using only good stuff. C-with-classes (which is basically C-with-RAII) is much easier than C already.
“Within C++, there is a much smaller and clearer language struggling to get out.” – Bjarne Stroustrup
Good job attacking a strawman. My point still stands, C++ it is a bloated language, a huge clusterfuck
And? What of it? Are you saying it is impossible to write clean code in C++?
I hope that one day people like brokensoul will stop treating languages as anything else then tools that you pick for specific jobs, and other peoples opinions as something else then their subjective views on said tools due to their specific needs, and stop embarrassing themself by going to forums and starting “holy wars” like this thread.
Oh god, i don’t believe you asked this. Have you ever worked in legacy codebases ? Or in a team ? Or even in codebases that your team inherited from other team ?
Life is not simple, you will have to deal with other’s people code, and C++ is terrible in this kind of situations. C is also not the best in this case, but is not even close to being as bad as C++ in this regard.
I’m done with this discussion, you are obsviouly completly lost.
Can someone please make me understand what is the point of this topic here? In relation to the engine itself. Are we looking into converting Urho to C? Is that why people here try to pitch the C language? I just don’t get it. How did we get here and what’s the point.
Are we really that dumb that we must debate performance of C vs C++? As if that’s where the bottleneck actually is (for a game/engine).
By that logic. GNUC is made in C. Clang is made in C++. I wonder who has a reputation for being the fastest.
Is listing some libraries that were made in C somewhere between 90’s and 2000’s going to solve anything?
By that logic GTK was made in C, Qt and Wx were made in C++. I wonder who has a reputation for being easier to use or has a higher adoption outside of Linux where it’s the default for last decade distributions. So you’re kind of forced to use it.
Do you see the stupidity of trying to flex a few libraries made two decades ago and saying they’re more widely adopted or faster.
First of all. Those are open source and the only thing you can flex with. Considering there are better closed source/proprietary software that overshadow either of the mentioned libraries/software. What makes you think that those closed source libraries/software are not made in C++. Thus, showing you can do better in C++.
But all of that is pointless. As it was already mentioned. A language is a tool. Stop treating it like a fking religion and trying to convert everyone to it. You are exhausting to everyone around you.
Man I hate what this forum has become.
I would like examples
Actually I would like a C example to which I (or someone else) would come up with C++ counterpart. As pointless that may be.
Clearly I haven’t made expressed my complete disinterest to such behavior. But oh well. Why not entertain ourselves
Actually I would like a C example to which I ( or someone else ) would come up with C++ counterpart. As pointless that may be.
openssl
Can you actually mention an actual software? Something what wasn’t meant to run on any and all possible platforms and architectures. Which includes the Linux kernel because you need a platform or openssl (or any ssl) to have a secure communication layer. These being the two main domains that aren’t created in C++. Not for performance reasons. But simply because of where and how they have to be used.
Was that not implied?
Oh, now my example is wrong? First you made a statement, then I myself have to look for an example, and when I gave an example, it turned out to be wrong.
It’s not wrong in the way you think. It’s simply that you mentioned a piece of code that needs to be available in absolutely every possible place and/or language. Thus C. Because of its simplicity. Therefore, no one bothers do one in C++. Just as no one bothers to do a Linux kernel in C++. One exists already and there is no market for another one to make it in C++.
Let me rephrase myself: Mention an actual software/application/game engine or something that doesn’t have to act as the foundation to everything else. Rendering any duplicate as absolutely pointless or a simple curiosity.
The whole discussion seems to have stemmed from a rendering(?) library being converted to C. And the benefits of that.
You turned that into kernels or libraries that everyone (must) use. Therefore (as mentioned already) rendering any duplicate as absolutely pointless or a simple curiosity.
That was your goto because you had no other choice in terms of actual software.
Goddamnit this is already (as mentioned) getting exhausting.
You made a statement that I do not believe. Prove or admit you were wrong. Nobody has to prove your claim for you.
Considering there are better closed source/proprietary software that overshadow either of the mentioned libraries/software.
I actually refuse to admit to being wrong. Just because you’re stubborn, trying to avoid the obvious and trying to further continue a pointless debate does not make that statement false or wrong.
You simply puled out a library that there was no need to be done in C++ (again). As I’ve mentioned. You knew that and that was your refuge. The refuge of every C fanboy trying to force a stalemate in an argument of C vs (insert language).
I wonder why Rust is trying to replace C. When C is absolute perfection.
As expected. Pointless and exhausting. Just leave it be.
My stubbornness lies only in the fact that for the third time I ask you to give examples that illustrate your words
Considering there are better closed source/proprietary software that overshadow either of the mentioned libraries/software.
And why did you decide that I am a fan of С?
Omg, another strawman argument, you people are getting really pathetic, basically you want him to give a example to confirm your believes. Listen to your own advice and go do something better with your time.
Nobody is saying that C is perfect, and nobody said that we should convert Urho to C or anything like that. This whole discussion started because someone, from nowhere started a C flamewar. Just look in the second post, what @johnnycable said
So you are saying other people write better code in C than C++?
Are you arguing that C ++ is easier to write good code?
Its at very least easier not to leak memory.
In a complex program, you will not be able to keep track of the hierarchy. And you have to use one smart pointer and weak refs. Or you will get circular references (memory leak). How this differs from using a raw pointer (except overhead)
It is different in a sense that you can not forget to free a smart pointer.
In both approaches, an object is created and destroyed in one place. The programmer may forget to destroy the object in this place. Such a programmer may forget many other basic things. And smart pointers won’t save you from that. It’s just going to be a bad programmer.
In real life its not that simple. You know that very well. This is why it is not uncommon to see goto
in C because people go out of their way to try and not make mistakes because language just does not do enough.
You shouldn’t have mentioned goto, because there is cases when it is needed. And if you try to avoid it, you get 15 nested loops.
Well it should not be needed. If it is - that is a lacking programming language. If i wanted to use goto
i might as well write assembly.
What exactly is the difference between C ++ and C, which eliminates goto. I hope you don’t mean an exceptions.
Once again RAII. Exceptions are also fine. People do misuse them, so what? On one side we have a powerhouse language loaded with complicate features that people often misuse. On the other side we have a language that has nothing beyond basics. It is impossible to misuse a nothing as it is impossible to use it. However having some options is always better than not having them.
I searched among the c++ libraries that the engine uses. goto
is used in Bullet, SDL, PugiXml, SLikeNet, Assimp.
Exceptions are also fine
Where is finally
? In C# I can. C ++ offers a stub that cannot be used.
Does this thread have any purpose? Unless you’re planning to rewrite the entire engine in C, C++ is the language used and the structure chosen years ago by the author is class based. If it really bothers you, then you can use raw pointers and pointer arithmetic in your code and ignore all the features that come with classes and streams. Either way, the compiler will just output the same assembly and replace all your loops with jumps and gotos.
Oh my god this place reminds me of /g/
Clearly we have no better things to do than debate pointless stuff
Of course you do, you just don’t C it.
I think we need to look at big software application. OpenSSL is just a small library.
e.g. CAD, Word processing, or design software
Solidworks, MS word etc…
Now people can develop in any language they wanted. There are like more than 30 different types of languages out there.
Only reason I can think of for C is that it’s the only place the GNU compilers aren’t falling behind and are actually staying ahead/on-time with standards/compliance, in which case it’s just a "give GNU hugs" agenda.
We’re a long long ways from the bad days of MSVC-2005 when compliance was so bad that STL-Port was mandatory to avoid heisenbugs with Boost.
Port it all to objective-C and use clang.
Everyone loses. Problem solved.
Thus, do you think that there are no open source analogues for this software?
Not everyone is using opensource software, maybe Linux. But most people at work probably are using Unix rather than Linux.
If windows is opensource, it can kill Linux. But it is late in the game for that.
What statistics do you base your conclusions on?
Can I use open source software on Windows?
Based on my experience. I used other OS before Linux is created.
Why not? you can use any opensource software on Windows if you want to.
Maybe we should keep on topic. Haha.
C is ok, but we should think it as a tool that solve certain problems. It is not a solution for everything.
Then I don’t understand at all what you’re trying to convince me of. How the above proves
Considering there are better closed source/proprietary software that overshadow either of the mentioned libraries/software.
And why does everyone think what I’m talking about C
I don’t know, someone started the holy C and C++ war.
To me, I love pascal better than C. But don’t really care. They are just tools.
Maybe Op can just close the topic
The reason is rewriting software is too costly.
Indeed.
The reason for using C is is you’re forced to because of hardware programming. No other sane use case.
goto lol…
just a couple of weeks ago I was considering using one…
that would’ve been very funny…
but it the end I’ve added a do while and kept my two-level recursion…
goto
is great! embree
has dozens of them, because it’s software raytracer and it really cares about performance.