why C and not C++?

The place to bring up any design issues, or post your own creations

Moderator: Moderator Team

elhoir
Test Team
Posts: 397
Joined: Thu Sep 13, 2007 7:01 pm
Location: Madrid, Spain
Contact:

why C and not C++?

Post by elhoir » Wed Feb 27, 2008 5:25 am

I am not a developer, so i dont know why is it....
maybe C++ is slower?

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Post by Z98 » Wed Feb 27, 2008 6:30 am

http://www.reactos.org/forum/viewtopic.php?t=4551

That thread basically discussed the reasons why.

lentium
Posts: 26
Joined: Fri Feb 01, 2008 12:17 pm

Post by lentium » Wed Feb 27, 2008 2:24 pm

i think c is more hard but is more faster than c++

but i don't know programing so maybe i'm totally wrong

z180
Posts: 197
Joined: Sat Mar 10, 2007 7:58 pm

Post by z180 » Tue Mar 04, 2008 9:37 pm

sometimes c++ is really more portable ,but much people say the other way

jsimmons
Posts: 4
Joined: Sat Jun 23, 2007 3:49 pm

Post by jsimmons » Tue Apr 15, 2008 11:47 pm

I've been a programmer for almost 30 years, and as of last September, programmed strictly in C++ (18 years). It's equally as suitable for operating systems as is standard C. (Did you know the original version of Windows was written in Pascal?)

As was cited in the other thread, the tools are the restrictions, and even if they weren't, believe me when I say that you do NOT want to mix languages in ANY project, especially an operating system.

HOWEVER, none of the above means you can't write C++ apps for ReactOS (I just hope I can run Visual Studio when I do it).

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Post by Z98 » Wed Apr 16, 2008 3:21 am

Actually, you'll need to convince us you have a valid reason for using C++. C++ code is the likeliest to cause breakages and problems because of the differences between GCC's C++ and MS' C++ compilers.

EmuandCo
Developer
Posts: 4355
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Post by EmuandCo » Wed Apr 16, 2008 8:56 am

Or to sum up. We dont use C++, because GCC's C++ Compiler sucks.
Image
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

Post by oiaohm » Wed Apr 16, 2008 11:41 am

jsimmons sorry C++ in OS design is common claimed as good as. When you look at the poor poor C++ standard you find its broken all over the place.

How C++ mangling is not in standard. So where in most cases with C compliers were you can mix and match compliers and get it to work with all features. C++ does not it fails badly.

So interfaces between C++ parts to use different compliers has to return to C standard interfaces.

Exception handling between C++ compliers does not have to be compatible. Of course you might say C standard does not cover that true it does not. But there are advantages of not saying you can use this and then not defining how completely.

http://en.wikipedia.org/wiki/C%2B%2B0x Then you have the upcoming over hall of C++ standard that most likely will cause more headaches. Lots of the problems from the GCC C++ compiler vs MS C++ complier is coming from the standard difference.

Original version of NT was C. The lead developer that formed it came from Digital where he developed VMS. So knowledge in languages of Bliss, VAX macro and C should be expected. Bliss was a special lang create just for the task of creating a OS. C++ bits of windows are latter things that were added.

http://en.wikipedia.org/wiki/Dave_Cutle ... ngineer%29 He is the source of NT. Reactos is following the NT line. Windows having exception handling added to the C complier is really taking part of the Bliss idea into C.

The pascal is the line that lead to windows 9x that is now a dead OS. No where in the NT line is pascal part of it. Later on in NT live did some pascal developers prove that windows drivers could be built in pascal.

Really it makes no sense when coping a OS to use a different programming language to what it was built in without good reason.

z180
Posts: 197
Joined: Sat Mar 10, 2007 7:58 pm

Post by z180 » Wed Apr 16, 2008 5:43 pm

The shell 2.0 (shell2.dll 16-bit,later shell232.dll 32-bit)was programmed in C++ (that made it so big)and today windows users have the shell32.dll wasting their ram.
MS Developers said that the richedit dlls were first written in C
and in win 95/NT 4.0 rewritten in c++.In the first versions of
windows there was no C++, only MS C.Borland C++ 3.0 was the first C++
compiler for windows that I know of.

Some parts of reactos are in C++ and rbuild made me trouble.
The annoying C++ parts are rbuild pipetool sysreg and explorer
(maybe more).
I think that they could be rewritten and i said it in previous posts.
Also I think that it is a good idea to write reactos only in C for
varios reasons that I do NOT explain here.

I recall to have read that the NT exeption code is extended from OS/2
like some other NT stuff.

The first C++ from AT&T was called translator because it generated
C code and not ASM. I downloaded the source from 1985 but
it is written in C++ and i could not get it to compile.

oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

Post by oiaohm » Fri Apr 18, 2008 3:55 pm

z180 I would like to know where shell32.dll is so called built in C++ all the exports on it I have ever seen are C interfaces. It does not appear to have classes or other tell tail signs of C++. I more suspect its C code miss identifed.

Most of the recoded ones I have seen ended up with C++ class interfaces as well as the old C code interfaces.

For some reason people over look that borland and MS C complier have built in try catch and finally and when they see that code call it C++. Note lot of coders who know C++ mixup what is C code and calls it C++.

There are good reasons to Forbid C++ due to its standard defects. I would be more liking of objc but it did not take off on the MS platform.

z180
Posts: 197
Joined: Sat Mar 10, 2007 7:58 pm

Post by z180 » Fri Apr 18, 2008 8:19 pm

Hello oiaohm!
I only think that shell32 is c++, i dont work at ms
but i believe that shell32 is c++ since the august 1993 beta.You are
right by telling that shell32 exports only c functions.
I find it good that reactos is much c and not like the haiku project
which recreates BeOS, in which only some kernel parts were in c.

oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

Post by oiaohm » Sat Apr 19, 2008 8:51 am

From memory 1993 was the year try catch and finally appeared in the ms compler the c section.

Ged
Developer
Posts: 925
Joined: Thu Sep 29, 2005 3:00 pm
Location: UK

Post by Ged » Sat Apr 19, 2008 5:05 pm

most of MS's dlls are written with C++, including shell32

etko
Posts: 154
Joined: Thu May 26, 2005 3:43 am
Location: Slovakia
Contact:

Post by etko » Mon Apr 21, 2008 5:27 pm

Is writing them in C bad idea? What approach WINE uses?

Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Post by Z98 » Mon Apr 21, 2008 5:48 pm

While the devs here avoid C++ for compiler reasons, Wine seems to have a phobia of C++.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest