Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / i have a cunning plan... and i'll call it C++

Author
Message
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 25th May 2003 09:38
I admit it, I hate C++. I have used C++ and concluded it is useless--complicated to the point you might as well use ASM, and serving no role that cannot better and more quickly be served by BASIC.

Only cross-compatiblity serves as an argument in favor of C++.

But, then let's just admit it: when was the last time anyone did anything with Linux, UNIX, Mac OS, and Windows?

And the Linux argument dwindles because there are several console and X implementations of BASIC that are available for Windows, also.

C++ is godless.

I like DB, but for the most part I use it as a separate EXE called from VB because I'm too lazy to code the DX7 stuff for VB.

This what I don't get (itemized):

One: the whole "DarkBASIC built on C++ argument". DarkBASIC is at best bloatware sufficient for modeling, and at worst a toy. Fallacious argument.

By that logic, let's then say that all languages trace back to machine code. So: everything in BASIC can be done in C++ can be done in machine code. Why not skip the middle man?

Why not code new versions of BASIC (since many old versions were) in machine code? Answer: almost no one even knows machine code any more.

New languages are programmed in C++ or Delphi, leaving us with high-high-level languages.

I remember an argument over this on this forum back in its dark color days. DB's makers said that was the reason!

Problem two: if everything can be done in C++, BASIC, or ASM, why use C++ at all?!?!

ASM is faster; BASIC is easier. C++ is the monkey in the middle.

C++ has become a religion. There is a dogma, and a canon, and even saints and martyrs. And, like many religions, C++ has become an insincere way of retaining power.

C++ serves in computing the role that Latin served in the Middle Ages: empowering a handful of people and separating the masses from what they can understand.

C++ is just an example of man's addiction to complexity. The train of thought is that anything simple cannot be worthwhile.

What I would give for programming to turn post-modernist. Maybe we should start a foundation for dadaist programming . . .

bitJericho
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 25th May 2003 09:53
heh... c++ is exactly what you said...it is the middle man... not quite as complicated as assembler...and not quite as easy or *slow and restricting* as BASIC... a perfect tool if you ask me.. but this is just hear-se...i've never used c/c++ but have studied up on the various languages and this is the conclusion i have... suppose someone with experiance will be able to back me up^_^

The 3D Modeler's Group : http://groups.yahoo.com/group/3dModeler/
The Unofficial DB Newsgroup : http://groups.yahoo.com/group/DBMag/
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 25th May 2003 10:26
More C++ bashing . . .

http://www.ccs.neu.edu/home/matthias/cquotes.html

Best quote: "Being really good at C++ is like being really good at using rocks to sharpen sticks."

http://www.computerworld.com/news/1995/story/0,11280,15308,00.html (out-dated)

Best quote: "These days, $100,000 will usually buy you a lot more additional processor power than code efficiency." [I have spent three times more money on computers than I have on cars, but I have yet to have spent $33,333 on cars.]

http://c2.com/cgi/wiki?CppBashing NEUTRAL

Best quote: "And what would you have me do, program in VisualBasic???"



For C++ the best argument is Java, and their mentally retard cousins like J++, C#, and Visual C++ (one of the biggest screw-overs ever-- a clear misrepresentation meant to parlay the currency of VB into VC++; sort of the programming equivalent of the Adobe suite and Photoshop).

But, this is just beggaring the argument.


Let's just stick with good old fallacies, such as "he obviously has never programmed in it" which is a lot like saying all lesbians need a good man.

Totally a fish and bicycles argument.

Everyone picks sides, and it's just a damn good thing that liberal democracy is slowly making all forms of argument ineffectual rather than violent.

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 25th May 2003 19:16
8truths each time you post you show more and more of your ignorance...

if you have programmed within C or C++ then no doubt you've only done it for a few minutes and not liked the setup - that isn't C++ problem that your poor at it.

i could sit here and explain down step-by-step all the problems in you current arguments, but your not going to listen so i'm not gonna waste me time.

however just for those out there who would like to know

PS2 - Program within C w/ASM plugins for specifics using Codewarrior most oftenly

GameCube - Program within C using the Nintendo's SDK ide oftenly

X-Box - Programmed normally within VisualC++ using a DirectX SDK exporting NT32_OS exe's and then converting to XBE

PS2 uses most oftnely the EmotionEngine Libraries, however sometimes use DirectX or OpenGL when they want a starting point APi - however the DirectX APi is now outdated from the Playstation (makes it slower)
The GameCube uses most oftenly Nintendo's own APi which is based upon OpenGL.
X-Box DirectX

i mean just a good point of reference for anyone who wanted to know, and would like to laugh at 8truths first comment a bit

another reason you'd want to laugh at it would be that Linux/Unix/Solaris are actually the main business sector Operating System - Windows generally is only sold to the public & public relation jobs.

in otherwords if you work in an office your most likely to use Windows with Works or something just because they don't want to pay to train employees to use it - but almost anyother aspect of computer based jobs, graphics, multimedia, design & research, etc... will use more oftenly than not a Unix based OS.

infact an SGI Machine with SunSolaris running nVidia technology can push almost double the polygons a similar WindowsNT based system could which makes them a popular choice in 3D Development Offices.

most programs which you run on windows that are used in a professional capacity are always programed to LOOK like windows but i can guarentee you they'll run on multiple OS's and were never programed directly for that OS.

for total compatiblity when you program crossplatform you'd use C not C++ - but then anyone who's been programming for a while will be able to explain why

Within the Epic battle of the fates the Shadow and the Angel will meet. With it will harbinger the very fight of good vs evil!
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 25th May 2003 21:18
Thank you. I never said anything against C.

Quite a few folks who push the "I hate C++" cite the value of C.

I do love the concept that my viewpoint can only be ignorance . . . The old "C++ can't be blamed because you suck". This assumes I suck, thank you.

C++ programmers have a radicalism that makes me fear it when I see them near planes.

This is the argument that beer stops tasting awful if you drink enough of it.

I have taken the time to learn C++, but I have never taken the time to write any robust, useful program in it. So, I have built a whole ton of dumb file i/o programs because I had a use for them, and have done some API calls just to prove they were doable, and whatnot. I tinkered with C++ as a small EXE to handle the occassional item; and then realized it was no better than what I get from any other program. So, I gave it up.

My apologies I don't hate myself enough.

"Most businesses" is a big claim.

Most businesses use Linux/UNIX as a back office server. Linux and UNIX are synonyms for "server".

Repeating that claim is allowing a common myth to go forward (gee, what am I saying about C++, too?). I like Linux enough, but when I am done playing with it, I do have to wonder what it is good for other than fetching people's mail.

I have been around very few businesses whose front-end work was done on anything excepts Windows or Mac OS. And let's not get into Mac OS X . . . Nobody uses Mac, and a lot of people who do still have not made the switch.

I have only ever been around one system that was Linux through-and-through (I did tech work on a point-of-sale system that ran a console version of Caldera). And most of the time they were threatening to give it up and go to paper!

Techies push a lot of crap for a lot of reasons. C++ is one of the items they push.

"C++ is not very cross-compatible". I know that, but it is one of the arguments pushed. Remind me not to cite opposing arguments, since they will be taken as signs of my ignorance.

Tmythology of C++ needs challenged. Far too many folks have developed a chauvinism that C++ is the only true programming language, and everyone else can just screw themselves.

The problem is so many people have wasted valuable hours of their lives learning it that confronting the possibility that GW-BASIC was all they ever needed makes them very sore.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 25th May 2003 23:20
8Truths:

Complicated huh? Addiction to complexity? But I thought that C++ came about in an effort to make very large projects easier to produce. Hmmm...

map<string,string> MyTree;

Hey, look. I've just created a binary tree that lets me store and retrieve string data using a key in string format. Wow, it's more complicated to explain than setup. Now lets use it.

MyTree["hello"]="How hard is this?";
y=MyTree["hello"];

Wow again! I've just stored some text in the tree for data stored under the key 'hello' and then retrieved it.

Of course, I don't just have to retrieve a string or key by a string. I can replace either part with any variable type I want - even my own user-defined ones. I can't believe that C++ makes it so complex

If all you did was produce a few small and occasionable programs, no wonder you missed it.


Quote: "when was the last time anyone did anything with Linux, UNIX, Mac OS, and Windows?"

Well, excluding the Mac, every day at work and in my own time too. The developers in my team depend on cross-platform code - it removes the need to produce different application code for every OS. I'm not about to get into an OS bashing post though, so I'll not make any comments on which platform I prefer


Quote: "DarkBASIC is at best bloatware sufficient for modeling, and at worst a toy"

Then why are you here? As for it being a toy, let's see you produce the same level of effects that DB can produce in another language - excluding of course all the other languages that you've put down. If you don't like bloatware, why do you use VB?


The reason that C++ exists in all the places that it does is that C++ is flexible/powerful/safe enough to do it - *if* you program within your limits. This is the mistake nearly all C++ newbies make - I did the same myself


Quote: "Let's just stick with good old fallacies, such as "he obviously has never programmed in it" which is a lot like saying all lesbians need a good man"

Actually, this sounds more like your argument than mine or Ravens. "All programmers need BASIC"? I have never (and will never) say that one language is better than any other, unless I am pointing to a specific example. For example, DBPro is the best language for *me* to produce 3D effects. It may be C++ for others, or even some other language.


The reason I'm continuing to post on this subject, is not to convince you. You have already made your decisions. It's to counter the negative image you are giving of C++ to anyone else following this discussion.

I can't say that C++ is the best language to use for every situation. I can't deny that C++ is hard to learn. I can't deny that you can write rotten code in C++ (as you can in any language). I can't even deny that it takes a while to become competent in C++ let alone advanced. But the fact is, whether you like it or not, that C++ is more popular and widespread *without* corporate backing and propaganda than Java or VB are put together, and as the number of C++ programmers is continually expanding, this may always be the case. Like Linux, this is one of the few areas that is expanding due to user pressure instead of corporate pressure, and long may this democratic choice continue.


Raven:

IMHO C++ is more capable of producing cross-platform code than C, because it has something that C doesn't have - templates.

You can write code that will automatically adapt to the types you are using according to the platform you are compiling for - mixed with the preprocessor, this is a powerful combination.

Have a look at www.boost.org for examples of cross-platform and cross-compiler code.
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 26th May 2003 00:04
Aside from the "let's see you" argument, all good points.

Really, the C++ argument is moot.

Given the role it plays in both the Windows and Linux OSes, whether we like it or not-- and even if everybody decided suddenly to convert to anything but C++-- it would be essential to maintaining computers at least for the next decade due to slowing adoption habits among average users. Just look at the number of folks still using Windows 95, Mac OS 8, and even the old Solaris systems. If Linux ever does anything on desktops, maybe it will enable people to have an up-to-date OS.

I like C. I love BASIC. I despise C++. DB is good in a specific role, and would be far handier if 3D Studio Max did not cost $$$$$$$.

C++ is simple as long as it doesn't fail. Even when you see something hiding in a debug log about xxxxx.cpp, it's OK.

But, when you compile, and the deugger is screaming about something in xxxxx.h, I am inclined to wonder if C++ is so simple by the time you retool headers . . .

Debugging C++ tends to become a gauntlet. And, in a day and age when no one codes one line a day, that gauntlet becomes more brutal.

And this reverts to the old argument about AI buried way back in this thread . . .

If something has to run forever (no stopping at the next exit for the 3rd Service Pack), it is required to have a high tolerance for failure.

Yes, it is possible to use exceptions, but those have to be coded in on a failure-by-failure basis (remember, no stopping for service packs).

C++ does not have a high tolerance for failure -- essentially that is the argument both for C++. Corporates say it is good, because no one wants to lose $1B over a single line of code.

They'd much rather the debugger frustrate me into not coding C++ than allow my ego to lose their money.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th May 2003 01:37
C++ has exceptions for a very good reason.

The amount of C code that I *still* see that does not check return values for errors, it's amazing that it runs at all. However, it is not always preferable to deal with all errors in the lower-level code.

Exceptions give you the ability to have a library of code that does not pass back error values - it instead throws an exception. Whether the user of your library wants to deal with this or not is up to them, but the result of an uncaught exception is the program exiting immediately.

Code that is written within the company I work for has to pass a code review before release (no matter which language is used) - this includes catching *all* exceptions when using C++. Although it *is* possible to put in place 'catch all exceptions' code we do not allow the programmers to do so, because this just masks the error - exactly like ignoring the return codes in C does.

In reality, the number of exception blocks needed is usually small.
Ignoring errors is not a valid way to deal with them - and you are saying that this is a strength of BASIC. I see this as a weakness.

As a contrived example, imagine a section of code that reads a specific amount of data from two files ignoring for now the possibility of buffer overruns.

First in C:


Now there are plenty of ways that the code could be reduced in size, but only at the expense of readability. If I happen to accidently miss one of the 'fclose' calls when writing this code, I will eventually run out of file handles when running it. I'm also hoping that the user of this function is paying attention to the value I'm returning.

Now in C++:


OK, it looks like I've cheated here. But all I've done is used a piece of library code that deals with *all* the error checking for me. It's the users responsibility to deal with the errors, as with the previous piece of C code, but this time they are forced to, and cannot just ignore the error. And with all the error checking code removed from the logical flow of the C++ code, which is easier to read?

Also note that the file is not being closed by me - it is being done automatically by the library code, so that I don't have to even think about it - that in itself is a good reason to use objects.

OK, here's the missing code that is written once, and reusable forever. Please note (for my pride's sake ) that I do not consider this production level code.



I've even given the coder the choice of dealing with a general FileError or a specific error of FileOpenError or FileReadError, AND THIS WOULD BE DOCUMENTED - it is library code after all. That's the key to producing bomb-proof code.

Normally, I would also include the class name, source file name, and the actual filename in the exception object returned - but this would not complicate the MyFile object itself.

Back to the buffer overruns - In C, you just hope that the user of your code has passed you buffers that are large enough to hold the data. In C++, you could use either a string or a vector to store the data - both structures that can resize themselves to hold the required data. Which is safer here?


As for error messages and warnings, we also require code to compile cleanly *without* typecasting. Because of the way C++ does typecasts, it is easy to locate them in the review, and each one must have a reason to be there.


The problem with a lot of code is programmer assumptions or lazyness, not the language. If any C++ program crashes because of buffer overruns or invalid data, the programmer deserves a good kicking because there really is no excuse anymore. Unfortunately, I think we'll see these types of errors for a long time, because of old code, and the fact that there *are* lazy programmers out there.


Last point - debugging C++ code is currently a nightmare, but this is a fault of the tools, not the language. It's getting better ... if only it could get better faster
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 26th May 2003 02:41
I can say I have never had an over/under-run. But, then I have never pushed my C++ too far.

As for letting errors pass . . . Is it really all that bad?

Consider the Win32 errors, such as the ones associated with dial-up networking. A ton of them are really just bad moments that can pass; however, Windows 95/98/(damn it ME, go home!) forces you to close your browser. Many users have learned to just drag the error msg box off to the corner.

Now, I realize this is the MS isuee, and we all know what that means -- just leave it be. It's just an example of an error that can slide.

In the original argument over the role that failure/ambiguity tolerance plays in modeling intelligence, my thought is that BASIC has a strength in its goofy acceptance of nearly anything.

Yes, the opposite of this is the strength of C++ -- in fact it is the reason C++ is widespread.

The logic of the argument is that in modeling anything that requires a tolerance (and probably a blind acceptance) of failures (debugging) and ambiguities (C++ has a tendancy to tie things inextricably together, as in a>>b>>c>>d>>e; while BASIC compels you to at least go through and cause those relationships to change, as in a=b, b=c, c=10 does not cause a=10) you need a language that will allow that all to slide. C++ assumes those equivalencies exist in perpetuity (sp?).

In fairness, intelligence requires an a world where a=b=c and a<>c (is this the mathematical representation of the enemy of my enemy is not necessarily my friend?).

BASIC allows things to slide; C++ does not unless you go through the code and tell it to let it slide.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th May 2003 04:29
You are right about some errors not really mattering - but they still need to be dealt with. In your example, a dialog box pops up because of just this scenario, and the user can choose to ignore it. This holds true even if you use BASIC to code in.

You have 'on error ...' and 'raise' in most BASIC's ... or the equivalent. In C++ you have try and catch. In both BASIC and C++ you can set things up so that the error is ignored. Where is the difference?

If you don't set up a global 'on error goto' then your program will fail on an error. The same as C++.

(Side note: In VB.NET the same exception handling structure as C++ has been included, which MS now recommend you use)


Not all errors can just be ignored though. Imagine that you have tried to allocate a chunk of memory. The standard action of most OS's is to return a pointer to the memory (except for DB - memblocks are a damned good idea). But if all available memory has been allocated already, it returns a zero. What is BASIC to do with that? OK, it can ignore a poke to address 0, but when the user adds an offset to it, it's no longer the special value of zero and no longer easily detected as an invalid address. If undetected, this could cause the program to trample over memory that doesn't belong to it. This is the same behaviour as C.

In C++ however, it throws an exception - this allows the programmer to code a case where memory can be freed to allow the program to recover, or save the work so far.

So sometimes, it's best to *not* let things slide.


When you say that C++ ties things inextricably together, you are missing the point. If I say a=b+c, then I don't need to know what hoops the code jumps though to provide me with my result - just that it gives me the correct result.

If a,b and c are all integers, that's fine. a will be equivalent to c added to b.
If a,b and c are lists of data, then that's also fine. a will be equivalent to the lists b and c combined. I don't need to know how it combined them, just that it did. This is why C++ is especially good in large projects. The c list could even be stored on disk, with a and b stored in memory - I don't care. I just want to add them together.

Of course, if I try and combine objects in relationships they aren't coded to accept, I'll get an error at compile-time, not run-time.


As for equivalence (if a=b=c, then a must equal c), then this does not have to be true for any language, especially when multi-threading or classes are involved.
Also, there is an example in standard C++ where this is *not* the case ( autoptr<> ). I could also contrive cases where this is not true for classes/types I create myself.
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 26th May 2003 08:24
OK. We've recentered the debate.

Here's the main thought I had: in a specific case, a hypothesis about using simple languages to improve models of real intelligence-- not game intelligence-- BASIC is less likely to need retooling than C++.

That being said, thank you for affording a more tame defense of the C++ side.

Raven is fun, but more than a tad radical.

aprilfan
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 28th May 2003 07:17
Hey! I love 3d studio max and whats so hard about it? it's at least 10 to 500000 times easier to learn than c++ now get back to your patatoes! Paint...sniff now thats a tricky program let me tell ya...

The Great Schism.- The Earths reaction to Heavons invasion.
8truths
21
Years of Service
User Offline
Joined: 10th May 2003
Location: United States
Posted: 28th May 2003 09:37
Nothing's hard about 3DS. It is just expensive as hell!

And Kazaa smartasses, be warned: it is fine at home, but if you take your copy to work don't be surprised if you lose your job-- I got it for copying Photoshop onto a different machine because I was sick of hotseating!

Companies don't take chances with these things, because they have enough money to be worth taking to court.

That's all I'm saying about 3DS. Discreet charges too damn much for it, and offers not good lite version (whatever that thing was they tried about a year ago sucked).

Aside from that, it has an awesome render engine, and the easiest nuts-and-botls access to all parts of your model.

aprilfan
21
Years of Service
User Offline
Joined: 3rd Oct 2002
Location: Hell
Posted: 31st May 2003 06:24 Edited at: 31st May 2003 06:34
Dumb post has been deleted by me, anjin sorry...

The Great Schism.- The Earths reaction to Heavons invasion.

Login to post a reply

Server time is: 2024-09-20 00:35:31
Your offset time is: 2024-09-20 00:35:31