Welcome, Guest. Please login or register.

Author Topic: Anti C++ sentiment?  (Read 13396 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline csirac_

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 154
    • Show only replies by csirac_
Re: Anti C++ sentiment?
« Reply #14 on: January 26, 2003, 01:18:43 AM »
@cycloid:

Check out Anjuta on Linux. I hate MSVC :) The only real feature I would like in Anjuta that MSVC has is the class/method suggestion drop-down box-as-you-go sorta thing. But Anjuta absolutely rocks in every other respect!

BTW how does such an "industry standard" tool have such ABSOLUTE ####e printing support??! My options are, after clicking "print" from the file menu: OK, Cancel. WTF? I wanted to print some code syntax highlighted with page numbers and filename in the header. I ended up using the freely available Bloodshed DEV-C++ package for WIN32 (I didn't have access to my Linux box at the time).

I would love to learn C++ properly but haven't got around to it... think I might do a wxWindows project. wxWindows looks cool; I think it needs an AmigaOS4 port ;)

- Paul
 

Offline iamaboringperson

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 5744
    • Show only replies by iamaboringperson
Re: Anti C++ sentiment?
« Reply #15 on: January 26, 2003, 03:24:06 AM »
@EntilZha

Quote
The way C++ handles OO (i.e. structures with data and functions in one entity) is really more of a procedural approach than an OO approach.. That's why I think C++ is in fact relatively easy to learn when you know C...

i think you may be a bit confused as to what OOP is all about?
data and methods put together, called a class, is probably the main advantage of OO, you cant have and OO language without classes & objects!
java is just another OOP language that also has classes and objects
that is what OOP is all about!
Quote
The problem with C++ in the system is that it can't be done without locking out other languages, i.e. if you have a C++ interface, you can't use it from C without troubles..

what i acctually mean, is that you could have both c++ & C includes, the C ones would form the basis for includes for other programming languages
Quote
Plus, you have the non-standardized way that name mangling and object layout is handled...

?
 

Offline Fozzy

  • Newbie
  • *
  • Join Date: Apr 2002
  • Posts: 12
    • Show only replies by Fozzy
Re: Anti C++ sentiment?
« Reply #16 on: January 26, 2003, 03:51:05 AM »
I have noticed that people tend to attack or dismiss things that they do not understand. I can understand that "C" is a better selection at the system level, since overhead required by the VMT and extra constructs tend to produce larger and (a little) slower binaries. However, regardless of the language, it has been shown that good object oriented design princples produce extensible, robust, reusable and reliable software. To dismiss or claim hatred of "C++" seems narrow minded.
I prefer java when perfomance is not a consideration, but "C++" has been the tool for me when speed is required by the application.  
Well, I\\\'ll be bound and hogtied... It\\\'s still alive.
 

Offline Waccoon

  • Hero Member
  • *****
  • Join Date: Apr 2002
  • Posts: 1057
    • Show only replies by Waccoon
Re: Anti C++ sentiment?
« Reply #17 on: January 26, 2003, 08:10:24 AM »
I've never used C++, and I'm just a casual programmer, so I can't say too much about the difficulty curve.  What I think most people are griping about is using OO code when it's not needed.  C++ programmers really want to use OO design for everything when a simpler C program will do it just as well.

That's a coder dicision.  Good programmers know to use a language that fits the task.  I really don't know what happens when you try to mix C and C++ together.  I presume that's a bad thing to do?

All I know is, when I complile a C program with a C++ compiler, the program turns out huge.  I mean, just for fun I wrote Hello World in MSVC with default values, and it compiled to over 250K.  WTF?  Or is that just because it's Microsoft?
 

Offline DavePTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2116
    • Show only replies by DaveP
Re: Anti C++ sentiment?
« Reply #18 on: January 26, 2003, 08:27:30 AM »
Quote

That's a coder dicision. Good programmers know to use a language that fits the task. I really don't know what happens when you try to mix C and C++ together. I presume that's a bad thing to do?


Not at all, mixing C and C++ is half the fun of C++. The freedom of both languages. So the fear is the OO bigot view of the world - everything is an object! I understand a bit more now.

Design patterns should be applied where they are best suited - this includes OO.

Oh and the compiler bloat, that IS because of the compiler implementation and not the language.
Hate figure. :lol:
 

Offline JetFireDX

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 232
    • Show only replies by JetFireDX
Re: Anti C++ sentiment?
« Reply #19 on: January 26, 2003, 10:20:58 AM »
My problem with C/C++ is simply the learning curve involved. I don't have time to devote to picking up the language when a much simpler solution could be prodiced from something like BASIC. But then, computers don't ship with easy languages like BASIC anymore, so not everybody gets the pleasure that comes from creating, regardless of the lang used. Mostly, my programming habits are just proof of concept types of things...I don't usually care how fast I get something done, so long as the desired effect is created. I figure if I really created something fantastic, I would then be motivated to learn C++ and recode it. I guess I also don't understand what makes object oriented languages special. Ultimately, I would like to see a language so easy to use there was very little learning curve to it, but mastering it would take time. Also, with so many intelligent people programming in the world nobody has been able (or wanted to) come up with a fast (running) easy to learn and understand language? (Maybe something that parses natual language using a set of keywords, and then converts it to C or C++?) To me, I see it as being a painter in ancient times as to being a painter now. Way back when, you had to have the skill to make your own paint, canvas and tools....now you can buy these things freeing you to simply be creative, and not have to put in hours or days of prep work. Thats what I think it should be about, being creative, not difficult.
 

Offline EntilZha

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 131
    • Show only replies by EntilZha
    • http://www.hyperion-entertainment.com
Re: Anti C++ sentiment?
« Reply #20 on: January 26, 2003, 11:26:15 AM »
> i think you may be a bit confused as to what OOP is all about?

No, not really ;)

OO means objects that have data and methods. Methods are sent from object to object and the object manipulates it's data.

However, in C++, you have more of a procedural interface.

In C, you write do_something(object);
In C++, this becomes object->do_something();

That's a lot less OO than for example smalltalk...

> what i acctually mean, is that you could have both c++ & C includes, the C ones would form the basis
> for includes for other programming languages

Include files wouldn't be enough... there would have to be a class framework as well...

About the non-standardized way of name mangling and object layout:
Every compiler is free to implement name mangling in any way it sees fit. There is (or better was) no standard. So if the system is using a C++ framework, the system would have to define the name mangling, and all compilers would have to implement that...

That's the problem BeOS has: They have their system interfaces as C++, so you were forced for some time to use the BeOS compiler... There's a gcc variant in the meantime, though...
- Thomas
Avatar by Karlos
 

Offline SlimJim

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 752
    • Show only replies by SlimJim
Re: Anti C++ sentiment?
« Reply #21 on: January 26, 2003, 12:48:25 PM »
Very good to hear about the AmigaBook (or whatever it will be called). Once publication is confirmed, this should be put out as news.
.
SlimJim
 

Offline Cymric

  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 1031
    • Show only replies by Cymric
Re: Anti C++ sentiment?
« Reply #22 on: January 26, 2003, 01:18:05 PM »
Quote
DaveP wrote:
Anti-C++-sentiments, why?

I think a quote from Stroustrup himself is in order here: 'C makes it easy to shoot yourself in the foot. C++ makes it harder, but when it does, it blows away your entire leg.' It is indeed easy to abuse C++, or just see the language as a better C. So why would you bother with it then?

I myself don't use C++ for the simple reason that my programs aren't big enough to profit from OO-ness. They would just end up to be same modules, only now embedded in a class architecture. I also have developed a very robust set of input, output, memory handling and error propagation routines, with clear interfaces. You could say I've already programmed in an OO fashion. C++ has a few things going for it (although if you read some of the criticisms on the net, you have to wonder), but I simply haven't felt limited by what C offers me. That said, I think that for many people it's just the fear of tacking on a runtime library to resolve some of the more advanced features. I used to think about performance loss too---now I simply buy a faster CPU  :-P .
Some people say that cats are sneaky, evil and cruel. True, and they have many other fine qualities as well.
 

Offline Treke

  • Newbie
  • *
  • Join Date: Feb 2002
  • Posts: 45
    • Show only replies by Treke
Re: Anti C++ sentiment?
« Reply #23 on: January 26, 2003, 03:25:04 PM »
Hi folks

With OO I mean polymorphism (Wasn't ment as an allusion on morphos, Thomas ;)) ). That's the tool it gives to me.  
 I'm sorry to say that here, but it seems to me that C# is nicer than Java (even with these delegates, which according to James Gossling, break the OO principle).   I think C++ will slowly retire (but not entirely) when everybody becomes more negligent to the the performance aspects of SW. The process has started. Even when it is an OO  language which gives a developer the greatest freedom.

re

Treke
 

Offline DavePTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2116
    • Show only replies by DaveP
Re: Anti C++ sentiment?
« Reply #24 on: January 26, 2003, 03:54:33 PM »
@Treke
Quote

I think C++ will slowly retire (but not entirely) when everybody becomes more negligent to the the performance aspects of SW. The process has started. Even when it is an OO language which gives a developer the greatest freedom


Simplified dialects of C++ will in my view become more popular over time. C will never die, it is too tied to the heart of Win32 and Unix. Java will not die as it is used at the core of many enterprise days ( e.g. WebSphere ).

I see the future as a simplified C++ and complex C++. C++ will be taught in simplified form with auto-pointers and single inheritance ( and pure virtual classes for interfaces ). With perhaps a decent class library with reasonably rich function like the Java class library.

No, I think C and C++ are here to stay, Java too. C# will become a nother VB - something that there is a market for and people use but it will not be the be all and end all dominant spirit of the marketplace.

Perhaps I am wrong, I hope not.

As for SystemjProgramming, yes I can see that the naming issues with classes makes it difficult anyway. In theory you could have a structure with function pointers to class methods and all that but it would be a nightmare.

Hence there will always be a place for procedural C/C++.

IMVHO of course.
Hate figure. :lol:
 

Offline mdwh2

  • Hero Member
  • *****
  • Join Date: Jun 2002
  • Posts: 565
    • Show only replies by mdwh2
Re: Anti C++ sentiment?
« Reply #25 on: January 26, 2003, 05:27:54 PM »
Quote

All I know is, when I complile a C program with a C++ compiler, the program turns out huge.  I mean, just for fun I wrote Hello World in MSVC with default values, and it compiled to over 250K.  WTF?  Or is that just because it's Microsoft?

But what are you comparing to? And is it the exact same hello world program (ie, still using stdio and no iostream)?

Using Amiga gcc, compiling the same hello world program produces a program size 2704 bytes in C mode, and 2716 bytes in C++, so hardly an unreasonable difference, and I guess what you get is just because it's Microsoft.

In Borland CBuilder, compiling a Hello World program using stdio/printf takes 54272 bytes, but using iostream/cout takes 111616 bytes. So there is a significant difference here, but down to using different libraries, and not necessarily just that it's C++.
 

Offline Treke

  • Newbie
  • *
  • Join Date: Feb 2002
  • Posts: 45
    • Show only replies by Treke
Re: Anti C++ sentiment?
« Reply #26 on: January 26, 2003, 05:38:19 PM »
@DaveP
Quote
No, I think C and C++ are here to stay, Java too. C# will become a nother VB - something that there is a market for and people use but it will not be the be all and end all dominant spirit of the marketplace.

I think oposite, C# has future, because:
1. From the language point of view it is an improved Java, for M$,  years of experience with Java were enough to see, what to improve in desing of new, similar language
2. It is an inherent part of .NET, which is a big movement towards real distributed SW systems (without the COM Hell). Don't missunderstand me, as an old amigan, I do NOT like M$, but some things I have to admit ;). The MS's millions that went into research must yield somewhere.
3. It has one of the best IDE's
4. It has a giant with money behind

Off course Java will not die.

Quote
Perhaps I am wrong, I hope not.

I also hope, that  you are not wrong.

Quote
Hence there will always be a place for procedural C/C++.

Sure.

re

Treke
 

Offline N7VQM

  • Sr. Member
  • ****
  • Join Date: Dec 2002
  • Posts: 272
    • Show only replies by N7VQM
Re: Anti C++ sentiment?
« Reply #27 on: January 26, 2003, 07:43:46 PM »
Quote

Waccoon wrote:

All I know is, when I complile a C program with a C++ compiler, the program turns out huge.  I mean, just for fun I wrote Hello World in MSVC with default values, and it compiled to over 250K.  WTF?  Or is that just because it's Microsoft?


I wrote two Hello World! programs using printf and cout in MSVC6.  There were exactly the same size:  28,672 bytes.  Perhaps you need to set the active config to release?  Debug config always creates large files.
\\"...an error of 1 is much less significant in counting the population of the Earth than in counting the occupants of a phone booth.\\" - Michael T. Heath, Scientific Computing...
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16867
  • Country: gb
  • Thanked: 4 times
    • Show only replies by Karlos
Re: Anti C++ sentiment?
« Reply #28 on: January 28, 2003, 09:33:02 AM »
I love C++. I've written tons of code that is fast, compact, tidy and efficient in C++ that could not be written in C without great effort and the risk of introducing tons of bugs.

People who dismiss the language out of hand, especially on performance reasons are living on another planet.

To all the C coders, there's no non-trivial C program that could in no way benefit from some of C++'s features. Even without classes, there's stuff in there that's damn handy, such as function name overloading, declarations as statements, references to name but a few...

int p; // A
 

  • Guest
Re: Anti C++ sentiment?
« Reply #29 from previous page: January 28, 2003, 10:49:26 AM »
I LOVE C++!
I am software developer and C++ is my favorite language. The more I learn about it the more I love it. And more languages i learn to program in, the more I recognize how much C++ is better than anything else. (Have you ever programmed in PowerBuilder? It's horrible.)
I like Java too, espacially this reflection thing and the ability to have native 64 bit integer support.
But as DaveP stated you can create your own dialect of C++ and implement other datatypes.

The only thing I would prefer is an ISO norm for variable names that says: [vartype][bits] e.g. int8, int32, int64 instead of char, short int, long, etc. and an extended support for string objects so that companies such as M$ don't create their dialects in their IDEs and you have a lot of work to be IDE independent. The CString class in the MFC is a good string class, but as I want to be as platform independent as possible when programming GUI apps I must do workarounds to read strings from controls when not using CString but the string class of the STL.