C++ Fluency (32)

1 Name: #!/usr/bin/anonymous : 2007-11-08 21:41 ID:WJNVtcVC

How long does it usually take to become fluent in C++, but not exactly a master? I heard that this is one of the easy ones, so I want to start practicing soon.

By the way, what books/tutorials do you recommend?

2 Name: dmpk2k!hinhT6kz2E : 2007-11-08 22:22 ID:Heaven

> I heard that this is one of the easy ones, so I want to start practicing soon.

Whoever told you that is yanking your leg. C++ is a particuarly complicated beast as far as languages go.

3 Name: #!/usr/bin/anonymous : 2007-11-08 23:14 ID:Heaven

>>1
I learned the basics of C++ from "C++ In Plain English," and then found "Tbe C/C++ Programmer's Bible" as a useful reference for more of the complex details. But I had also learned C before C++, which I personally suggest you do as well.

4 Name: #!/usr/bin/anonymous : 2007-11-09 09:16 ID:NYmeeejH

>>1
go for bjarne stroustrup's C++ book. That is the best reference out there.

5 Name: #!/usr/bin/anonymous : 2007-11-09 14:19 ID:Heaven

>>2

This is true, but you missed the original question. One can safely become fluent in C++ while completely ignoring most of the complexity, and focusing on a simple subset of the language.

6 Name: #!/usr/bin/anonymous : 2007-11-09 14:31 ID:Heaven

> focusing on a simple subset of the language.

C?

7 Name: dmpk2k!hinhT6kz2E : 2007-11-09 16:16 ID:Heaven

> One can safely become fluent in C++ while completely ignoring most of the complexity, and focusing on a simple subset of the language.

http://www.gotw.ca/gotw/020.htm

8 Name: #!/usr/bin/anonymous : 2007-11-09 23:30 ID:Heaven

>>7

Pretty much everything on that page is academic, and not an issue in practice, and certainly not if you are limiting yourself to writing simple C++, so it's hardly relevant.

9 Name: dmpk2k!hinhT6kz2E : 2007-11-10 05:46 ID:Heaven

All right. Let's talk fluency of a simple subset of C++.

What do you consider that simple subset? C + objects? Or the more recent 'right' way that involves Boost, RAII and all that?

10 Name: #!/usr/bin/anonymous : 2007-11-11 05:12 ID:Heaven

I think that nobody says "fluent in cabbie english", and nobody says "fluent in japornime japanese", and these are spoken languages- languages designed for redundancy. Languages designed to impart partial understanding as a kind of graceful degradation.

Programming languages aren't like that. They're designed to be specific and exact and to not degrade at all. Learning a programming language is about learning how to be specific- and becoming good at that language is about learning how to read and understand that specificity well.

There is no simple subset of C++ because there's no way, looking at a >> b that you or any other C++ programmer is going to know what is going on. Unless you're comfortable with that fact, you're simply not going to be able to be very specific with C++, and as a result what you learn will be nearly useless.

Instead, learning to be specific is easiest in a language with what is called context free grammar. That means you can learn (within a few hours) what a >> b actually means. Exactly. Specifically. Lots of languages have this property. C++ doesn't.

11 Name: Professor Science : 2007-11-13 20:41 ID:0asPeIw+

>>1

> How long does it usually take to become fluent in C++, but not exactly a master?

Took me about a month, but I was stuffed into a small room with a Maths PhD and a CompSci MS who had powerful motivation to teach me -- I was to take over most of their mundane workload once proficient. I was also already fluent in several of the more cushy languages (C#, ECMAScript, Java, Ruby), which helped a lot. The killer with C++ is not necessarily the language spec (although >>2 is correct, it's a beast) but learning the 15,000,000 different libraries that everyone uses.

> I heard that this is one of the easy ones

This is simply not true at all. Writing real applications (that don't suck ass) in C++ is one of the hardest programming tasks. As >>10 points out, C++ is a pretty fungible language. Things like Duff's device are a good example of this.

> what books/tutorials do you recommend?

"The Annotated C++ Reference Manual" by Margaret E. Ellis and Bjarne Stroustroup. Any other C++ book is pretty much a waste of time. If you can't understand the language in this book, gb2/vb or php or w/e over-glorified scripting language you came from and learn how to read the technical specs of those languages. Once you're more comfortable reading technical spec docs in general, this book can more or less teach you C++ in a few days assuming you're relatively intelligent. However, it will not teach you how to structure code and such (e.g., applied programming). For this, your best bet is to just start hacking on large projects, keeping your mind open to new heuristic techniques.

An open mind is really key over all, as becoming proficient with C++ will likely change the way you think. Also, anyone who advocates fluency in C++ while only looking at a small subset of the language is in for some serious pwnage the first time they have to debug someone else's code that's riddled with shit like bit shifting, two's complements, stl containers, pointers, *_cast<>, and multiple inheritance. In fact I kind of want to be there when that happens -- I've never actually seen a soul crushed in person before.

12 Name: #!/usr/bin/anonymous : 2007-11-14 13:09 ID:Heaven

> the first time they have to debug someone else's code that's riddled with shit like bit shifting, two's complements, stl containers, pointers, *_cast<>, and multiple inheritance.

two's complement? what are you talking about sir? (i know what two's complement is, do you?)

13 Name: #!/usr/bin/anonymous : 2007-11-14 13:26 ID:/OWoLARz

>>12

I'm talking about the tilde (~) operator in C++ that is used to determine the bitwise complement of a number. Sorry if I was not specific enough to begin with. First time I saw that in production code was a big WTF moment for me, at least. I don't have a traditional compsci (or even math) education though, so perhaps the observation was a bit too subjective?

14 Name: #!/usr/bin/anonymous : 2007-11-14 20:34 ID:Heaven

D is a pretty good alternative to C++. It avoids a lot of bullshit like having to take into account type sizes being different on every platform, although I don't think it lets you ignore the endianness being different on different platforms. :-/

It has garbage collection too, although this isn't a magic wand.

I see it kind of like an alternative to Java but which compiles to native code (Java can compile directly to native code too, but it isn't supposed to do this by design whereas D is.)

15 Name: #!/usr/bin/anonymous : 2007-11-16 00:01 ID:Heaven

>>13

If you can't handle a simple bitwise not or shift, you're really not much of a programmer, I'm sad to say.

16 Name: #!/usr/bin/anonymous : 2007-11-16 09:38 ID:Heaven

>>13
> I don't have a traditional compsci (or even math) education though, so perhaps the observation was a bit too subjective?
same, so?
~ is not two's complement

To quote:
> The result of ~ operator is the bitwise complement of its promoted operand.
> That is, each bit in the result is set if and only if the corresponding bit in the converted operand is not set).
> The integer promotions are performed on the operand, and the result has the promoted type.
> If the promoted type is an unsigned type, the expression ~E is equivalent to the maximum value representable in teat type minus E.

17 Name: #!/usr/bin/anonymous : 2007-11-18 04:09 ID:POPm7Mgh

>>13 It's called ONE'S COMPLEMENT.

18 Name: #!/usr/bin/anonymous : 2007-11-18 16:35 ID:Heaven

>>17

No, it's called "complement". One's complement and two's complement are related to the bitwise complement, but mean different things:

http://en.wikipedia.org/wiki/Signed_number_representations#Ones.27_complement
http://en.wikipedia.org/wiki/Signed_number_representations#Two.27s_complement

19 Name: #!/usr/bin/anonymous : 2007-11-21 07:09 ID:Heaven

Fluent? 10 years.

20 Name: #!/usr/bin/anonymous : 2007-12-07 16:06 ID:xTc7Bj1j

>>10 That means you can learn (within a few hours) what a >> b actually means.
That's easy. It's a bit shift.

21

22 Name: #!/usr/bin/anonymous : 2007-12-12 02:57 ID:Heaven

>>20 except in C++ where it can mean anything.

23 Post deleted.

24 Name: #!/usr/bin/anonymous : 2008-01-03 13:37 ID:Heaven

Well no, doesn't >> simply mean "invoke the method called operator>>" ?

25 Name: #!/usr/bin/anonymous : 2008-01-09 00:43 ID:Heaven

>>24

Only for very useless definitions of the term "mean", and only if you're wrong, too: It might be a primitive data type which doesn't really have a method. The operator precedence rules can be confusing on exactly what >> is operating on.

A more useful definition of the term "mean" would say that it "means" whatever the body of that function means. The fact that you have to cross-reference every lexeme in C++ is why nobody likes C++ programmers.

26 Name: #!/usr/bin/anonymous : 2008-03-11 23:49 ID:2Psv+OFT

>>4

I've heard it's outdated.

27 Name: #!/usr/bin/anonymous : 2008-03-12 13:44 ID:GHGfiClR

a > b means that a is greater than b
a >> b means that a is really greater than b

Retards.

28 Name: #!/usr/bin/anonymous : 2008-03-13 21:23 ID:8bZmzEpg

>>27 ( ̄ω ̄;)エートォ...

29 Name: #!/usr/bin/anonymous : 2008-03-14 16:45 ID:DpImaZyb

>>27
That makes perfect sense! Thank you.

30 Name: #!/usr/bin/anonymous : 2008-03-16 22:34 ID:Heaven

>>28
that is not an english word why did you say it

31 Name: #!/usr/bin/anonymous : 2008-03-18 06:32 ID:Heaven

those are not roman characters why did you read them

32 Name: #!/usr/bin/anonymous : 2008-04-26 02:32 ID:Heaven

>>31
>>30
this is not /prog/ why are you here

This thread has been closed. You cannot post in this thread any longer.