A little information on C++

lol. The problem with C++ is that C is a techie language designed in abbreviations. Excellent C code is meant to be as concise as possible. It goes back to the days when memory was at a premium, so if you could design a program to run in two lines of code with the proper algebraic formula rather than 5 or 10 it was considered a great hack. C is based off B, which stands for UC Berkeley. It was with B they designed Unix back in the 60's.

C++ is Object Oriented and was developed in the mid-80's. OO is a step up in structured programming from the Linear of Turbo Pascal to divvying up a program into running classes and such.

Since C is designed to be abbreviated and concise and OO programming is a method to divide a program into a proper system for easy modularity (which by design takes on more code) there is a conflict of philosophies.

A language like Small Talk, on the other hand, was design as an OO language from the beginning (I am told) and does not have this inherit conflict.

Java and C# are, of course, modelled after C++.

I had forgot to mention Cobol. Cobol was suppsoed to be on the way out and no one taught it anymore because it wasn't important. We all know what happened with Y2K of course. I was told for years that Basic is not something good to put ona resume and the head of my University's CS dept won't accept my old Pascal credits from 13 years ago.

Like Cobol, history has taught as that none of the skills ever stop being useful If there's not old code out there then there's always attempts to update these languages for whatever reason.
 
Joined
Oct 19, 2006
Messages
5,215
Location
The Uncanny Valley
Back when I was getting my CS degree in the early 90s, Pascal was still being taught as a "first language". But just a few years later it was phased out in favor of teaching C/C++. I eventually did take an (elective) class in C and was grateful for it as C became my main language.

I dabbled with C++ some while still in school, but didn't become comfortable with it until years later when I was working. It is a very powerful language that can do wonders in the hands of someone who knows how to use it. C/C++ is really the best choice if you want to have (near) complete control over the internals of your application/system.

Of course not every application requires this level of awareness so alternatives like Java, TCL, and Python can produce stable/functional apps more quickly.

I'm not that familiar with C# but I understand its syntax is similar to C++. If its taking over from Java (which I only know superficially), then I definitely want to see what the fuss is all about.
 
Joined
Oct 18, 2006
Messages
389
Location
North Carolina, USA
seems i got alot of feedback :)) anyway thank you all for the links etc

and please continue discussing on this issue... it is interesting for me!
 
Joined
Jan 10, 2007
Messages
383
C# is the Microsoft version of Java.

My programming languages over the years:

1982 C64 Basic
1983 Simons' Basic and C64 Assembler / C64 - early steps
1983 UCSD pascal / Apple 2e - learned to make real programs
1984 Turbo Pascal / IBM PC - I loved it
1987 Aztec C and Amiga Assembler / Commodore Amiga 2000
1988 Kick-Pascal / Commodore Amiga 2000 - Best Amiga language
1990 Draco / Commodore Amiga 2000 - cool Pascal/C Mix
1992 Fortran 77/90 / IBM PC - necessary for fast math programs
1993 Visual Basic 3.0 / IBM PC - a revolution
1995 Visual Basic 4.0 / IBM PC
1998 Visual Basic 6.0 and Visual C++/ IBM PC - cool for RAD
2002 Ansi C - LCC32 / IBM PC - good freeware compiler
2006 Visual Basic.Net / IBM PC - sucks a bit and can't compile an .exe file

Actually I am searching for a good new language - I don't like runtime OO languages (.NET and Java) so much. Maybe I return to C++.
 
Last edited:
Joined
Oct 18, 2006
Messages
20,068
Location
Germany
In the 80's, I did everything in ASM. GWBASIC was simply to limited. In college, I learned C and C++, and those have been the languages I've used close to 100% of my career, but then I work on embedded, real-time systems -- I absolutely need that ability to write fast, efficient code, and be able to poke hardware registers.

Granted, I've also learned Fortran, Pascal, Modula, Ada, Lisp, Scheme, Prolog, and others I can't remember off the top of my head. And never used any of them outside of the required classes. When I got out of college, I spent quite a few years learning every API, SDK, library, and language extension that came out of Microsoft. And almost never used any of them. All the while watching Microsoft deprecate them, replace them, deprecate the replacements, etc.

Not to mention the stack of programming languages I've invented and the compilers I've written (it's a geek thing).

Eventually even someone as boneheaded as myself learns to stop wasting time learning things you'll never use. Now I only learn what I need, when I need it, and spend my now-substantial free time doing far more important things (games, man, games!).

While I've had to use some C# .Net on a few things (and write a number of DLLs in C++ to bypass the fruitiness of C# so I could actually interact with hardware), I was not enamored with it. Looking through it, I found so many recycled Microsoft design tropes, wrapped with a truly monumental collection of interfaces/classes/packages. I quickly realized why all of my coworkers loved how C# was integrated into DevStudio -- trying to write anything in C# would be extremely tedious without Intellisense offering up helpful suggestions and auto-completing what you're typing.

C# is just another programming language -- once you've really learned how to program, you can pick up any language and be productive with it. Some less painfully than others. I personally love C++, but I know it inside and out. And C#? I've got better things to do than learn all of the ins and outs of yet another convoluted programming language, all the while knowing that there's a mighty good chance Microsoft will deprecate it to help push people into upgrading to whatever OS they develop to replace Vista.

Or take it this way: You can like/hate any language you want, but it's your boss that dictates what language you program in at work. When my boss tells me to use C#, I use it. The rest of the time, I use the language that makes me the most productive.

In the end, programming is like everything else. You'll always fondly remember your first love (ASM) and your true love (C++). And you'll laugh at the foolish lads excited over their chance to shag the new girl, 'cause she's cute and easy. Eventually they'll learn their lesson -- if you want more than a roll in the hay, you have to find the one with the right personality.

And if all you want is a roll in the hay? That's fine too. Just remember: she's easy... so exercise a little caution, you may be getting more than you bargained.
 
Joined
Oct 25, 2006
Messages
250
Location
Indianapolis
I never understood why Java forces you to use OOP even for the simplest program, in C++ you can code most programs without using classes, another problem with Java is the fact that you can't know every library and all codes , you have to check a book for how to use this and what's the code of that unlike in C++, although I am in networking but I have to work in programming I'd prefer C/C++ over GUI languages
 
Joined
Jun 19, 2007
Messages
122
Location
UAE-Dubai
When spouting trash about C being a 'dead language', don't forget that these communiques wouldn't be possible without it :) C is still in *wide* use and for good reason.

Not trying to start a language war, and I am speaking as a salty administrator and a fledgling C programmer, but the operating systems of choice for many folks are still written in C/Assembly.

Respect.

See: bind, OpenSSH, GCC yada yada...

LoTek,
 
Last edited:
Joined
Jan 6, 2007
Messages
63
Location
Saint Louis, MO USA
COBOL is still used here - and Assembler, too - in the area of money institutes, I am told.

A member of my classs at school told me that she actually had to program in Assembler for a German "Sparkasse" money institute, and a friend from my training time actually had learned COBOL during her internship.

As far as I've heard, COBOL is nowadays an dying language (well, wasn't it that 10 years ago already ? ;) ) ids rather used for migrating databases to other platforms, if I remember correctly.

Personally, I find OO cool. :) It's a neat thing, imho, that an object (I mean a function or a module) "knows what to do" (given it is properly programmed) when I need it. :)

Sadly, I never really got into using C++ and VB their "visual" counterparts in depth.
Same goes for HTML. I would still need to write it down manually, because I never really learned to use those nifty IDEs.
(Well, to some extend I did: VC++ and VB/VBA. But not really deeply.)
 
Joined
Nov 5, 2006
Messages
21,964
Location
Old Europe
... And how about this, Fortran is making a comeback!

The british computer scientist Tony Hoare supposedly once said: "I don't know what the programming language of the year 2000 will look like, but I know it will be called Fortran."
 
The only thing that matters is the ability to learn new languages. Thers always somthing new (or old?) coming from around the corner. The latest language I had to learn was created in-house and before I didnt even know of its existance. Personally the only thing I hope for in language is that its object oriented. Of course thats not often the case.

Hardest language so far has been symbian. The working enviroment was like a ghost from the past. Took som 4-5min to compile/run the code/emulator start just to see som error been generated. I might have gotten better tools to make the process easier but I gave up due to shortage of time.

If Id be interesting of spending my freetime with programming I might make it a hobby to learn the symbian. Theres som real salaries to be made with that language. I kind of envy people who find themselves able to code on their freetime. I rather spend my time writing nonsense on internet forums.
 
Last edited:
Joined
Dec 28, 2006
Messages
3,160
Location
Europa Universalis
C++ is still the shit. I'd wage most programming still is done either in C++ or some C variety, especially if you take all the non-PC software into account. Other languages tend to be confined to niches (like databases, GUIs, or whatnot).

Just looking at the job ads from the Swedish association of engineers it seems that as far as serious programming goes the companies want C, C++, C#, and Java. Too bad I dont know C# and only have cursory knowledge of Java...

The languages I've struggled the most with were LISP (where () has a different meaning than (())) and Haskell. Both languages felt awfully convoluted to use.
 
Joined
Nov 4, 2006
Messages
2,013
...
Too bad I dont know C# and only have cursory knowledge of Java...
...

In my experience, going from C++ to C# is easy. The main challenge is IMO learning to fully make use of the huuuuge library of classes in the .NET framework.
 
The languages I've struggled the most with were LISP (where () has a different meaning than (())) and Haskell. Both languages felt awfully convoluted to use.

LISP - Lots of Irritating Silly Parentheses. Ooh, I remember that one. I literally wept in joy when I found an editor with a "matching brackets" functionality :biggrin:

If you want power, performance, flexibility and/or care about program size, C/C++ is the only way to go. There is, of course, a price for all those benefits and that is in the complexity of the language and the vital necessity of the programmer knowing EXACTLY what he/she is doing. You can do almost anything with C/C++ but even the tiniest of mistakes can make the entire house of cards come tumbling down in no time.

Even today most game engines are written in C/C++, not because it can't be done in other languages but because you can usually get more bang for your buck in C/C++ (i.e. get more performance out of a fixed hardware setup).

There are exceptions of course. "Severance: Blade of Darkness" was written in Python (if not entirely then at least in large part) ... and in Spanish on top of that. O_O
 
Joined
Oct 19, 2006
Messages
805
Location
Just outside of Copenhagen
If you want power, performance, flexibility and/or care about program size, C/C++ is the only way to go. There is, of course, a price for all those benefits and that is in the complexity of the language and the vital necessity of the programmer knowing EXACTLY what he/she is doing. You can do almost anything with C/C++ but even the tiniest of mistakes can make the entire house of cards come tumbling down in no time.

Even today most game engines are written in C/C++, not because it can't be done in other languages but because you can usually get more bang for your buck in C/C++ (i.e. get more performance out of a fixed hardware setup).

Yep. I'm a professional programmer and a game developer, the majority ( > 95%) of game engines are written in C++. For business apps you might want to look at something like Java, it is more friendly (the cost being it is more bloated and significantly slower). C# is decent, but again not as efficient as C++, so it isn't really used as much with more performance-hungry applications. And if you really need bare metal maximum speed you go all the way down to assembler.

They've always taught us in U that C++ is the mother of all languages and taught us everything (except object oriented programming and databse) with C++...but that's probably because they don't have enough resources to teach us with Java..

Java is C++ with more hand-holding. Basically, it makes life easier for the programmer, but the trade off is that a skilled developer can do what needs doing without the hand holding MUCH more efficiently. Training purely in Java is a bad idea since the "hand-holding" stuff it hides is important to know about. Students who don't learn about memory management and suchlike are somewhat crippled when having to deal with those aspects :

Report

>>
What we observed at New York University is that the Java programming courses did not prepare our students for the first course in systems, much less for more advanced ones. Students found it hard to write programs that did not have a graphic interface, had no feeling for the relationship between the source program and what the hardware would actually do, and (most damaging) did not understand the semantics of pointers at all, which made the use of C in systems programming very challenging.

If you know C++ well you should pick up Java without any real effort, same with C#.

In the end it really depends on what you are trying to do. :)
 
Joined
Dec 6, 2007
Messages
195
I'd wage most programming still is done either in C++ or some C variety, especially if you take all the non-PC software into account. Other languages tend to be confined to niches (like databases, GUIs, or whatnot).

The language you use is heavily dictated by which part of the industry hires you. Insurance, financial, and telecom companies cover all manner of "dead" languages and platforms (even this far past Y2K, 20-year-old assembler code on mainframes is still in use, slowly being migrated to newer platforms and languages). Anyone who programs embedded or specialized hardware is likely using C and C++ (I'd never consider writing a video driver in any other language). All new Windows graphical interface-level work seems to be going on in C# with .Net, since it easily takes the route of Java by automating memory management and algorithms, making it quick and easy to get all of those buttons and widgets on the screen.

Given the sheer size of insurance, finance, and telecom industries, you'll find that assembly, COBOL, and mainframes are still very much alive. Or at least trying to gnaw on your brains. Lots of non-C++ languages are confined to niches, but some of them are very large niches with epic levels of inertia against change.

As NN indirectly pointed out, there's a very large industry demand for tech-school level programmers to do simplified programming, where the quantity of code and total number of features implemented is important, with relatively little complexity in the code. It becomes a matter of industry driving education -- most companies need a core team of skilled programmers for the complex work, and a team of trained code monkeys who pound out the simple stuff so the senior programmers don't get bogged down with shoveling monkey poo.

In a perfect world, the "code monkey" role is taken by recent graduates so they get experience with the real world, learn what college didn't teach them, and get promoted up to the more challenging roles.

Industry, on the other hand, is more than happy to hire in code monkeys with a minimum of training, so they push education to teach the minimum of knowledge, focus on simplified languages like Java and C# (since those are the languages they need), and in the end you have a lot of programmers who are competent to do the intro-level programming jobs, but lack the knowledge and background to get promoted out of the intro-level work. It also makes them cheaper to hire, and eliminates a lot of specialized knowledge, making them interchangeable -- companies love it when employees are simply resources that can be reassigned and replaced without risk. Or outsourced.

But teaching C++ as a core language is not a solution in and of itself. I used to work for a company whose hiring practices could be best described as "start with scraping the bottom of the barrel, then get out the pick and shovel" -- they obtained skilled employees by acquiring companies like mine, then watching the talent hemorrhage away. And that's the job where I developed a seething hatred for templates, STL, and Boost -- a rage that really applies to all programmers who have no clue what they're doing, rely on all possible crutches, and don't understand memory management ("What's wrong with caching an iterator?"), algorithm complexity ("It runs fine on my test set. Why does it take CNN three days to import their clip library?"), data structures ("I'm just indexing into this linked list."), and so many other things.

Whenever you hear anyone preaching about how awesome C++ is, there's generally two things at work. First, there's the elitism -- you can't really get away from that anywhere, can you? Second, most of us who've been around long enough to easily recognize the shortcomings of specialized languages have learned enough other languages to understand the value and problems inherit to specialized languages.

That's the main issue with only teaching specialized languages to programmers: they won't learn the trade-offs of specialized languages. Anything you want to do, you can do in C++, which makes it both powerful and unwieldy. It's both a scalpel and a rocket launcher at the same time (polymorphism at work, folks). The value of specialized languages is that you can design them to make certain tasks easy, while not supporting operations that are deemed unnecessary or dangerous (Java's pointers). A specialized language can make you very productive for its intended purpose, but hampers you if you try to do anything unusual -- especially shoehorning in a feature deemed "essential" by marketing, but not directly supported by the language.

Companies that do web programming want Java/Brew programmers. Those doing Windows apps want C#/.Net programmers. They want them fast, cheap, and interchangeable. Which short-changes the students who get fast-tracked for a corporate code-monkey job.

Maybe it's just my personal C++ elitism, but if I have to work with a programmer proficient in C++, odds are good he has a solid education in computer science (or real-world programming), and will probably be able to follow along if I have to delve into complex subjects -- i.e., fix something that's broken. When I'm working with someone who does not know C++ and thinks C# or Java is the shizznit, odds are good his eyes will turn hazy when I try to discuss any advanced subject that a four-year CS major should know cold -- i.e., explain why his code is broken.

Traversing data structures, for example, is an essential part of programming. If you don't understand data structures or pointers, and your language or STL/Boost is doing all of the heavy lifting for you so you never have to think about what's going on under the hood, you've got a serious problem. How can you debug something if you don't know what's really going on? It's one thing to understand reference counting, but to use smart pointers because you don't want to be bothered. It's something entirely different to use smart pointers because you don't understand reference counting -- and then run into bugs when SQA detects major leaks because of circular references, and the code review reveals that the problem is so pervasive that fixing it would require pushing out the shipping date by a month.

That's the main problem I have with the current crop of programmers -- they're competent enough to do intro programming work, but as soon as any serious problems arise in their code, they're in over their heads and floundering. Give 'em tasks within their comfortable skill set, and they frequently can knock out a whole bullet list of features with impressive speed. Face them with a bug that results from the deep logic in the libraries they're using, and they are completely lost. Unless a google search hits on someone else who faced the same problem and posted their work-around.

The smarter ones eventually learn, but it takes them much longer to grow into being more than just another interchangeable code monkey. And that's why I think that education is failing anyone who goes through a program that focuses on delivering what industry asks for instead of teaching the essentials of programming. It's also why myself -- and probably a lot of others -- do not like hearing anyone proclaim C++ a dead language that is not worth learning. If you're not learning C++, you're very probably not learning a lot of other essential subjects as well.
 
Joined
Oct 25, 2006
Messages
250
Location
Indianapolis
Just as a throw-in : Age of Wonders II and AoW: SM were developed with Delphi.

They're the only games I know of which have been developed in this language/environment.
 
Joined
Nov 5, 2006
Messages
21,964
Location
Old Europe
Is this awfull thread still open? The horror of C++ takes me again. :biggrin:

No, the actual reason why I oppose this language is because I never fully understood it. An friend of mine who studied with me for industrial engineer, went for 'civil' engineer later on. He told me that our teacher wasn't exactly teaching us properly for this language. Still I think it's rather me who just couldn't comprehend it. After all a 9/20 and a 6/20(got it for 2 awfull years) isn't exactly worth a woohoo on graduation.
 
Joined
Oct 19, 2006
Messages
1,539
Location
Belgium - Flanders - Antwerp
I find I have severly underestimated the level of geekdom on the watch. Did I really just read a post comparing programming languages with dating and bedding women?
 
Joined
Oct 18, 2006
Messages
3,508
I guess I had problems with it, because there's so much Math in it.

I have slight problems with numbers, but not with logic at all.

So anytime I had compute things for my own program, I had problems, but the logical layout was clear to me.

This is kind of weird and not easy for me, because everyone assumes that someone who is good with Logic must consequently also be good with Maths.

I'm not.
 
Joined
Nov 5, 2006
Messages
21,964
Location
Old Europe
The languages I've struggled the most with were LISP (where () has a different meaning than (())) and Haskell. Both languages felt awfully convoluted to use.

Have you tried one of the lesser known programming languages, for instance Lithp, where all the 's'es are replaced by 'th'?
 
Back
Top Bottom