What do you all think about C++? I'm just starting off on programming and was going to use C++ as my first. When it comes to programming, I know little to nothing about the technical, in-depth details. In some places (mainly /prog/), I've heard C++ isn't all that great and isn't worth learning. But again, what do you all think?
If you'd like to learn C++, that's fine, but not as a first language.
C++ is fiendishly complicated, and it takes a lot of work to do very little; it's not a tool meant for neophytes. Starting with C++ will probably only confuse and demoralize you.
Oh, I see... so, something like Python would be better, then?
I'm not a fan of Python, but yes, Python is a good choice. It has a relatively simple surface and a plethora of libraries, so you'll get a lot done with little effort.
C++ is a terrible language from every possible aspect.
So many C/C++ hatersô☺Vx0♦(1TxT1A É1A L ↕ |3@ ¼ L ↕ |3@ ¼@8 ♦P$"\↕ ┤'TxÇ ↕
> Why is that, though? That's what I was wondering.
c++ is objects tacked on to the side of an old (pre-ansi) version of c. actually not really tacked on, it's more like they just smashed them into each other and hoped they'd stick together somehow.
c++ is so bad there are about a million languages that are designed to be a "better c++" (java, d, objective c, c#, etc.)
If you want to do it, I say just go for it and don't let anybody discourage you. There is some difficult stuff that arises from the amount of control that it gives you, but you will learn a lot about how the compiler works and how memory management works by screwing up so much. If you want this sort of challenge, go for it. When I started really programming (like, studying it in college, around 1995-1996), they'd teach you Pascal as a sort of primer, and move you to C (you'd do a lot of that), and you'd have like one class of C++ to teach you object-oriented programming. Java was something "new" (yes, I know it had been around since 1990 or whatever) and "hot" at the time, but I remember thinking that I didn't like how much it did for you (garbage collection) and that it was too easy. Someone at the consulting company where I worked later was teaching us Java 1.2 and they were talking about how they were deprecating things from Java 1.1 to prevent people from writing code that had too many bugs in it, and I thought that that was lame that they were going so far to prevent you from "shooting yourself in the foot". I'm not trying to get in that argument now, but that's where I was when I was 22 years old. The point is that in a few short months, you can be at that point where Java looks too easy, and not be scared of C++. People weren't scared of it then, and there's no reason to be scared of it now. A lot of these languages people are suggesting to you didn't even exist, or were unpopular back when C++ was the most common object-oriented programming language. People back then didn't need a stepping stone to C++ like all these people are telling you that you need now. They did just fine.
Actually the only advice I'd give you other than to learn C++ is to learn C first. You might gain a better appreciation of objects after you've worked a while without them. Or if you are going to make mistakes that you learn from, C will give you a smaller subset of mistakes to learn from at first so that you won't be as overwhelmed.
If you want an intro to programming, VB6 is a good choice. It's really straight-foward and easy to learn. Cons would be that it is a M$ product and that it is not really object-oriented, but has psuedo-OO elements.
There's nothing wrong with a language not being object-oriented.
I hate C++, nothing against object-oriented. But I think C is much better.. C++ is just overly bloated and much slower to me. That and it seems to be a microsoft-product nowadays, and I am very anti-microsoft.
If you want object oriented programming do python, ruby, or lua.. or Java or C# if you wish. But I don't think C++ is that great, in my honest opinion.
> That and it seems to be a Microsoft product nowadays, and I am very anti-Microsoft.
Maybe I'm about to make the mistake of feeding trolls, but... What the fuck?
> C++... seems to be a microsoft-product nowadays, and I am very anti-microsoft.
> If you want object oriented programming do... C# if you wish.
i lol'd
> That and it seems to be a microsoft-product nowadays, and I am very anti-microsoft.
Assuming you are serious, I don't really see that. Windows programming nowadays seems to be all about .NET, and C++/CLI (the .NET version of C++) seems to just be an also-ran in that world. I love C++, but I can't really think of a compelling reason (for my own purposes) to start a project in C++/CLI rather than C# if I'm going to use the .NET Framework. Plus, C++/CLI it doesn't support multiple inheritance, which I feel is it's big distinction amongst the major object-oriented languages.
I'm not so sure, but ever since the "officialization" (I know it's not a word XD) of C++, everyone learns it, everyone overuses it's features (classes, templates, etc) and it turns out really crappy and slow. There is better OOP languages out there, that is all that I am saying.
Personally I have a dislike for C++ because it forces you to do the memory managment yourself. Most OOP languages use some sort of garbage collection system, wich is handy and can, to some point, be controlled and finetuned to meet your own needs.
The pro of C++ is that you can write very fast very memory efficient code on it. This basically stems from a) doing the memory managment yourself, so you know exactly what is going to take up how much space. and b) C++ incorporates C, wich in all due respect is quite low-level and thus allows lots of finetuning.
Most OOP languages nowadays however are much easier to learn and master than C++. Take up Java or C# and you'll see they're very much alike. I learned Java first, only then to move on to C++. I was horrendously annoyed by what I COULDNT do in C++ that I could in Java. Well sure I could program it all myself, but that would take alot of time, and time is money in the business world.
Therefore whenever I program I use Java or C# for high-level stuff, and in the event that I need to work low-level, such as on an embedded system, I use C. I don't touch C++.
That being said, knowing C++ is still important in today's job market sadly. Most companies still stick to it even though C# and Java are far superior IMO. Fortunately my current work works fully in Java.
>> That being said, knowing C++ is still important in today's job market sadly. Most companies still stick to it even though C# and Java are far superior IMO.
I've gotten the impression that C++ is predominant only in the game industry these days. Is that not true? Are there other software industries where C++ still reigns supreme?
>>17
I haven't personally worked with C#, but I hate it anyway. C++ might be an abomination, but at least it's portable. I don't condone the Mono project, because it gives C# programmers the false impression that their code will compile on Linux.
Java is just fucking slow. Other than that, I guess it's alright.
My language of choice is C, but I can respect C++. It's produced some good stuff, like bsnes and Dungeon Crawl.
> C++ might be an abomination, but at least it's portable. I don't condone the Mono project, because it gives C# programmers the false impression that their code will compile on Linux.
the machine i use c# on the most is an ARM linux machine.
the other machines i use it on run freebsd, solaris, and linux.
i use the .net runtime for testing on windows, but all the code is compiled on *nix machines with mono.
> I haven't personally worked with C#, but I hate it anyway.
you sound like an american president talking about fiscal responsibility.
I'm a game developer, and the game development industry these days almost exclusively uses C++ as the core development language, and numerous scripting languages layered on top for concrete game logic code. On older consoles like the N64/PS1, we mostly used just C as GCC 2.95.x's C++ compiler really sucked back then, and CodeWarrior's C++ compiler was pretty crappy too.
At the current studio I'm at, we're also using a lot of C#/.NET for tool development.
It's easy to shoot yourself in the foot with C++, it takes quite a bit of experience to be able to use C++ effectively. And a lot of game development studios have crappy C++ developers, let me tell you!
> Personally I have a dislike for C++ because it forces you to do the memory managment yourself.
You sound mighty intelligent.
> Originally alphabets were written entirely in capital letters, spaced between well-defined upper and lower bounds. When written quickly with a pen, these tended to turn into rounder and much simpler forms, like uncials. It is from these that the first minuscule hands developed, the half-uncials and cursive minuscule, which no longer stay bound between a pair of lines.
> These in turn formed the foundations for the Carolingian minuscule script, developed by Alcuin for use in the court of Charlemagne, which quickly spread across Europe. Here for the first time it became common to mix both upper and lower case letters in a single text.
tl;dr: back to france, please.
>>25 better yet lets not use punctuation either just like the good old days what do you think does this look good to you based on your post i would imagine your creaming your panties over this
i think ill alfo ftop vsing the letter v fvbstitvting v in its place and ill vfe olde fafhioned long fs in the middle of my words how is this looking to yov i think it is qvite pleafant
whyftopthereifhovldntevenvfefpacesbetwixtmywordsohmygoodnefsitisfobeavtiful
...You're a fucking idiot.
Before anyone bitches at me for it, I'll point out that I accidentally used "your" instead of "you're" (or "youre"). It's 5 in the morning, bear with me.
Now back to your regularly scheduled argument.
and lots of other things i'm not even going to go into because you're obviously just an uneducated french troll.
>>28
Similarly, you're obviously a schoolgirl who primarily communicates with MSN and Myspace.
>>11
why the fuck do you sage everything?
>>30
obviously because you should always use sage unless people who aren't following the thread are likely to care about your post.
>>26
þou hast forgotten þy þorn, eð, and æ.
ᚨᛣᛏᚢᚨᛚᛚᛁ·ᛚᛖᛏᛋ·ᚷᚩ·ᛒᚨᚳᛣ·ᛏᚩ·ᚢᛋᛝ·ᚱᚢᚾᛖᛋ⋮
As for me being a French troll: comparing the timestamp on your post with the actual time you posted, and comparing the timestamp on my post with my statement that it was 5 o'clock, there is only one possible explanation. You're a fucking idiot.
>>33 I have no idea what this says, but you win.
Or you feel you've lost an argument and seek to get the last word by letting the thread fall of the main page and hoping no one is following the thread.
>XNA
Xna is intended more for independent games, often from one man development teams.
Most large studios will either write their own engines, or license middleware, like Unreal 3, or something similar.
C++ was my third language after C64 Basic and Pascal, respectively. While it is a very powerful language, it does come with a lot of responsibility on the programmer's part. In part, that is why people are slowly moving away from it. It is still a de-facto standard in games and operating systems, but that will slowly change as well (google Microsoft Singularity and Microsoft Midori). Also, its syntax can be a bit verbose and the standard libs are a bit archaic.
I have also learned C, Java, JSP (basically Java for webapps), C#, Perl, and Ruby. Out of all these languages I like Ruby the most. It feels very natural to program in it once you get used to its syntax and the fact that it is dynamic. I'll give you a (contrived) comparison/example between C++ and Ruby
C++
for(int i = 1; i <= 10; i++)
{
cout << i << " ";
};
Ruby
1.upto(10) { |num| print "#{num} " }
If you read both pieces of code aloud, you will arguably conclude that Ruby sounds more like English and it's code seems more compact. I could give you the same example in other languages, but (with exception of Perl) they are all more or less similar to C++.
Good luck with whichever language you choose.
>>39
c♯ (which you apparently don't know as well as you think you do):
foreach(var i in Enumerable.Range(1, 10)) Console.Write("{0} ", i);
prolog:
numlist(1, 10, L), forall(member(N, L), format("~d ", N)).
haskell:
mapM_ (putStr . flip shows " ") [1..10]
factor:
10 [ 1 + pprint " " write ] each
Dude, no need to brag. We all know you da pro. I wasn't giving an example of each/foreach and I was doing a C++ vs Ruby comparison, but I guess you are too lazy to read the post. Plus, I said the example is contrived.
Anyways, you brought up a good point with these examples. Only factor comes somewhat close in simplicity/succinctness to the Ruby example.
Oh yeah, I forgot to add 'each' version of Ruby:
(1..10).to_a.each { |n| print "#{n} " }
or
(1..10).to_a.each do |n|
print "#{n} "
end
(dotimes (n 10)
(print n))
If you have implemented the map0-n utility, then you can write it as:
(map0-n #'print 10)
>>41
the c♯ one was just to point out that you were wrong when you wrote
> (with exception of Perl) they are all more or less similar to C++.
all four examples of those examples are simpler than your ruby example, and two of them are more succinct. you don't seem to realize that neither "simple" nor "succinct" are directly related to the number of characters. for example, for i in 1 2 3; do echo $i; done
is a lot simpler than :(){:|:&};:
, which is much shorter.
and the prolog one isn't as simple and succinct as it could be:
forall(between(1, 10, N), format("~d ", N)).
We can spend a whole day debating the meanings of simplicity and succinctness. I realize that your views are not open for interpretation. Thus, there's no room for debate.
>>(with exception of Perl) they are all more or less similar to C++.
What I meant by this is that other languages I numbered (Java and C#) are syntactically quite similar to C++, which is no surprise considering that they share same (read: C) ancestry. It is my view that C#'s version of foreach follows quite different and, arguably, more verbose syntactical patterns when compared to Ruby. I am sorry it sounded like an attack to your favorite language that C# obviously is. It wasn't my intention at all. On the contrary, I prefer it to Java.
I do not agree that all four examples are simpler (at least, in my view of simplicity). I do agree that factor example is shorter (i.e., less verbose) but not necessarily any more obvious than the Ruby version is. That said, it might very well be a matter of being used to one favorite language. It is, therefore, hard for any programmer (not only me) to be entirely unbiased when it comes to rating programming languages.
>for i in 1 2 3; do echo $i; done is a lot simpler than :(){:|:&};:,
I wouldn't base my understanding of a language, its syntax, and the fluidity it gives to coding on a contrived example. Ruby code is actually quite clean and you can always omit line noise by simply doing a do...end construct instead and you can also omit (). Back to my example,
1..10.to_a.each do |n|
print n
end
And there you go, no {}(). I do not want to be misunderstood here. Ruby is no cure to cancer. Things can be bettered. But, I think it is quite natural to code in it, once you have been exposed to it. I must say I am intrigued with Factor and will definitely give it a try as I will with Scala, Erlang and Clojure.
On a related note, there is a very good presentation by Ola Bini on JRuby (Ruby running on JVM) which extends to the differences between Ruby and C-based languages. Check it out (it's over 1hr long though):
The Ruby example does not need a to_a().
Here's a slightly different implementation, similar to Factor's:
10.times { |n| print n+1, " " }
> Ruby code is actually quite clean and you can always omit line noise by simply doing a do...end construct instead and you can also omit ().
for >>44's prolog code, you only need to know forall
, between
, and format
.
for your ruby code, you need to know ..
, .to_a
, .each
, do ... end
, |...|
, and print
.
"line noise" has nothing to do with it.
ITT: Faggots arguing about shit that doesn't matter
>>48
Take this kind of garbage back to 4chan, please.
>>49
HI 4CHAN IS DOWN LET'S ARGUE ABOUT SHIT HERE? DICKDICKDICKDICK
>>51
I would gladly but I think all the guys here would mind
OP, learn C++ if you are man enough.
Meh.
Honestly, C++ is a tad hard to start off as a first language.
Maybe try learning C# (or Java), it might be a bit easier.
Learn C, object-orientation is for fag
>>55
Well, C++'s object orientation isn't that savory. You could easily teach Smalltalk to a beginner (and that's a good way to start too.)
>>56
Or you could teach something like Python or Java, which actually has uses in the real world.
C++ is great language to learn all round. You can interface into any other language using vanilla c, and then you have the added bonus of going c++ if you need it. At the end of the day c++ programmers make the best java/c#/python/ruby programmers in the marked because they understand exactly what it is they are doing. If you want to learn something easy... you're better of learning python.
C++ is used a lot for constructing games and graphical applications where speed is a must. I'm a student right now taking Java courses, and it's pretty complex actually, well, for me at least. I think C++ code looks a lot cleaner than Java code, so I would say start with C++ before you take Java. Java is used heavily in the business applications world, but then again C++ probably is too.
Right now I'm learning Python from Mark Lutz's "Learning Python", and it seems pretty simple stuff too. It teaches some pretty good programming concepts and how to think like a programmer.
I went from python to C++. Python is easy and intuitive but slow as hell, however it is a good way to learn object orientated programming and other programming concepts.
If you learn Java you will appreciate C++ more since it's not fucking retarded, but that is all it does I'm afraid.
> We are sick of language discrimination, more so the PHP/Java bashers. There will be little tolerance of blatant and repetitive insults.