Thoughts on C++? (63)

1 Name: #!/usr/bin/anonymous : 2009-03-14 13:11 ID:RoT3Fvkt

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?

14 Name: #!/usr/bin/anonymous : 2009-03-19 01:32 ID:Heaven

> 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

15 Name: #!/usr/bin/anonymous : 2009-03-19 16:27 ID:RK18OekZ

> 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.

16 Name: #!/usr/bin/anonymous : 2009-03-21 20:44 ID:aMmO3HI4

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.

17 Name: #!/usr/bin/anonymous : 2009-04-10 15:37 ID:KlJ5iV+7

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.

18 Name: #!/usr/bin/anonymous : 2009-04-10 16:47 ID:Heaven

>> 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?

19 Name: #!/usr/bin/anonymous : 2009-04-15 03:05 ID:vm8UTLkP

>>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.

20 Name: #!/usr/bin/anonymous : 2009-04-15 22:24 ID:9E6emV97

>>12

>ruby

lol

21 Name: #!/usr/bin/anonymous : 2009-04-16 09:46 ID:Heaven

> 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.

22 Name: #!/usr/bin/anonymous : 2009-04-16 14:41 ID:vw3GK7z+

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!

23 Name: #!/usr/bin/anonymous : 2009-04-16 23:42 ID:qqP30UAn

> Personally I have a dislike for C++ because it forces you to do the memory managment yourself.

You sound mighty intelligent.

24 Name: #!/usr/bin/anonymous : 2009-04-18 22:41 ID:lyHkHoKu

>>23
You sound mighty neckbeard. Get with the times, manual memory management has gone the way of the dodo for the vast majority of programming tasks.

>>21
I would consider honoring your opinion if you figured out how to use your shift keys correctly.

25 Name: #!/usr/bin/anonymous : 2009-04-19 03:04 ID:Heaven

>>24

> 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.

26 Name: #!/usr/bin/anonymous : 2009-04-19 09:16 ID:vm8UTLkP

>>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.

27 Name: #!/usr/bin/anonymous : 2009-04-19 09:22 ID:vm8UTLkP

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.

28 Name: #!/usr/bin/anonymous : 2009-04-19 10:10 ID:Heaven

>>26

  1. f ≠ ſ
  2. some of those should be s instead of ſ.
  3. ſh is very wrong.
  4. spaces are a lot older than that gay capitalization.

and lots of other things i'm not even going to go into because you're obviously just an uneducated french troll.

29 Name: #!/usr/bin/anonymous : 2009-04-19 14:35 ID:Heaven

>>28
Similarly, you're obviously a schoolgirl who primarily communicates with MSN and Myspace.

30 Name: #!/usr/bin/anonymous : 2009-04-19 18:58 ID:OXnNupAF

>>11
why the fuck do you sage everything?

31 Name: #!/usr/bin/anonymous : 2009-04-19 22:17 ID:Heaven

>>30
obviously because you should always use sage unless people who aren't following the thread are likely to care about your post.

32 Name: #!/usr/bin/anonymous : 2009-04-19 23:28 ID:Heaven

>>26
þou hast forgotten þy þorn, eð, and æ.

33 Name: #!/usr/bin/anonymous : 2009-04-19 23:37 ID:Heaven

ᚨᛣᛏᚢᚨᛚᛚᛁ·ᛚᛖᛏᛋ·ᚷᚩ·ᛒᚨᚳᛣ·ᛏᚩ·ᚢᛋᛝ·ᚱᚢᚾᛖᛋ⋮

34 Name: #!/usr/bin/anonymous : 2009-04-21 00:32 ID:Heaven

>>28

  1. I was typing on my phone. It's one of the few models without an ſ key.
  2. It was five in the morning, so I wasn't able to do a perfect job proofreading. If you want, I can have the edited version on your desk by Monday morning.
  3. You seem to actually have a point here. Kudos.
  4. My point was that they're both in common usage nowadays. What the fuck is your problem? Were you raped by capital letters as a child?

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.

35 Name: #!/usr/bin/anonymous : 2009-06-15 17:58 ID:OInwjTwK

First of all, I'm a high school student programming in PHP and TI-BASIC currently learning Python to prepare for university.

I find Python to be a good language, although parts of the syntax (especially the tab-instead-of-curly-brackets part) feels very awkward at first (compared to PHP, C++ and Java, the latter two I dont code in but I've read some books on them as well as other peoples code).

Also, I've heard that the advantage with learning C# instead of C++, is that it's the language you use with Microsofts XNA. I dont know if (m)any game studios are actually using XNA though. Does anyone know this?

tl;dr: I think Python seems nice for people new to programming, although it wasn't my first.

36 Name: #!/usr/bin/anonymous : 2009-06-20 05:52 ID:yaiC/NWM

>>31
shut up

37 Name: #!/usr/bin/anonymous : 2009-06-21 16:46 ID:KyCRaDA5

>>31

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.

38 Name: #!/usr/bin/anonymous : 2009-06-25 23:49 ID:ifw+GRvP

>>35

>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.

39 Name: #!/usr/bin/anonymous : 2009-06-28 01:01 ID:nq1SY2TA

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.

40 Name: #!/usr/bin/anonymous : 2009-06-28 10:33 ID:Heaven

>>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

41 Name: #!/usr/bin/anonymous : 2009-06-29 21:49 ID:nq1SY2TA

>>40

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.

42 Name: 41 : 2009-06-29 21:53 ID:nq1SY2TA

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

43 Name: #!/usr/bin/anonymous : 2009-06-30 00:45 ID:Heaven

(dotimes (n 10)
(print n))

If you have implemented the map0-n utility, then you can write it as:

(map0-n #'print 10)

44 Name: #!/usr/bin/anonymous : 2009-06-30 08:52 ID:Heaven

>>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)).

45 Name: 41 : 2009-07-01 01:01 ID:nq1SY2TA

>>41

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):

http://www.youtube.com/watch?v=PfnP-8XbJao

46 Name: dmpk2k!hinhT6kz2E : 2009-07-01 04:05 ID:Heaven

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, " " }

47 Name: #!/usr/bin/anonymous : 2009-07-01 06:37 ID:Heaven

> 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.

48 Name: #!/usr/bin/anonymous : 2009-07-06 12:17 ID:cSfZ4CGL

ITT: Faggots arguing about shit that doesn't matter

49 Name: #!/usr/bin/anonymous : 2009-07-07 12:50 ID:Heaven

>>48
Take this kind of garbage back to 4chan, please.

50 Name: dmpk2k!hinhT6kz2E : 2009-07-07 18:32 ID:Heaven

$_='ce\ag #UXVb`X Ta Xk\fgXag\T_ a\[\_\fg gbWTl!#';y!T-t#!a-z"!;eval

51 Name: #!/usr/bin/anonymous : 2009-07-08 17:28 ID:Heaven

>>49
HI 4CHAN IS DOWN LET'S ARGUE ABOUT SHIT HERE? DICKDICKDICKDICK

52 Name: #!/usr/bin/anonymous : 2009-07-08 22:53 ID:Heaven

>>51
I would gladly but I think all the guys here would mind

53 Name: #!/usr/bin/anonymous : 2010-02-24 22:57 ID:CkEDZP0T

OP, learn C++ if you are man enough.

54 Name: #!/usr/bin/anonymous : 2010-03-02 04:00 ID:Or+rudRM

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.

55 Name: #!/usr/bin/anonymous : 2010-03-13 13:56 ID:Heaven

Learn C, object-orientation is for fag

56 Name: #!/usr/bin/anonymous : 2010-03-13 14:27 ID:kmKQNFwp

>>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.)

57 Name: #!/usr/bin/anonymous : 2010-03-15 20:30 ID:lyHkHoKu

>>56
Or you could teach something like Python or Java, which actually has uses in the real world.

58 Name: #!/usr/bin/anonymous : 2010-03-16 07:42 ID:Heaven

>>57
>Java
NO THANK YOU Just because they're used in "the real world", doesn't make them any less terrible.

59 Name: Snow : 2010-03-24 19:54 ID:EEUWn+BR

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.

60 Post deleted.

61 Name: #!/usr/bin/anonymous : 2010-05-27 06:04 ID:ACmeIxte

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.

62 Name: #!/usr/bin/anonymous : 2010-05-31 17:34 ID:CaWZ3BzU

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.

63 Name: #!/usr/bin/anonymous : 2010-07-11 09:40 ID:Heaven

>>58

> We are sick of language discrimination, more so the PHP/Java bashers. There will be little tolerance of blatant and repetitive insults.
This thread has been closed. You cannot post in this thread any longer.