Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ Literature

Name: Novice 2011-01-23 17:10

I'm in no way even a decent programmer. I'd like to become better, and have already settled on C++ as the language to begin with. I've learned quite a bit from reading documentation and online tutorials, etc, but I think it's time to read an actual book on C++.

What book(s) should I get and why?

Name: Anonymous 2011-01-23 17:12

Resettle your language.

Name: Anonymous 2011-01-23 17:12

>>2
Why and what to?

Name: Anonymous 2011-01-23 17:20

>>3
Lisp, Scheme, C, Assembly.

Name: Anonymous 2011-01-23 17:35

>>4
And why should I switch? Anyone?

Name: Anonymous 2011-01-23 17:38

Has anyone on /prog/ even read a book on programming?

sneezingelf.png

Name: Anonymous 2011-01-23 17:41

Name: Anonymous 2011-01-23 17:42

The C++ Programming Language by Bjarne Stroustrup

Name: Anonymous 2011-01-23 17:48

>>5
Because C++ sucks, I've argued too much about C++, so I'll not explain. Just search in the second page.
Also, because of the monads:

; return x >>= f ≡ f x
(equal?
 (with-monad list-m
   (>>= add1 (return 2))) ; return x >>= f
 (add1 2))                ; f x
; #t

; m >>= return ≡ m
(equal?
 (with-monad list-m
   (>>= return (return 2))) ; m >>= return
 (with-monad list-m
   (return 2)))             ; m
; #t

; m >>= f >>= g ≡ m >>= λx.f x >>= g
(equal?
 (with-monad list-m
   (>>= (λ (x) (>>= add1 (return (add1 x)))) (return 2))) ; m >>= λx.f x >>= g
 (with-monad identity-m
   (>>= add1 (>>= add1 (return 2)))))
; #t

Name: Anonymous 2011-01-23 17:54

youre making a huge mistake by making C++ your first language, you have to start with C and an easier OO language like C# or Java first to be able to understand C++. After you learn C and C#/Java then you will be able move on to serious C++ books like:

-C++ Primer
-Accelerated C++
-Thinking in C++
-C++ Primer Plus
-C++ in Action
-Effective C++

Name: Anonymous 2011-01-23 17:54

>>9
i just vomited a little bit in my mouth david

Name: Anonymous 2011-01-23 17:55

>>5

Because starting with C++, you will spend more time wrestling with the stupidity of the language than with learning fundamental concepts about programming. The suggestion of reading SICP isn't prevalent just because people enjoy memes; Scheme is simple enough that you can actually learn the relevant parts of the language quickly, so you can learn about general concepts (which are more important at this stage anyway). If you're one of those people who thinks Scheme is for "math faggots", you should give up on becoming a programmer learn C & ASM instead. Make sure if you do that, you get a decent understand of how things work under the hood in C. Once you've finished all of this (it should take you a couple of years to become proficient in everything), you'll be ready to tackle just about anything.

Or, you could ignore my advice and just start learning C++. After enough time doing only C++, your brain will calcify and you'll be a certified code monkey, riding out your dreams until you have to learn something new that totally breaks your plastic, fragile perception of programming. Then you can get a disability and spend the rest of your miserable shitpile of a life complaining on blogs about how "FOREIGNERS TOOK OUR JOBS", all the while oblivious to just how uneducated you are, thus making you unaware that all of your problems are YOUR fault.

Basically, the choice is between being exceptional and being mediocre. Choose what you will.

Also, IHBT.

Name: Anonymous 2011-01-23 18:05

>>12
people enjoy memes
I LOVE YOU! I LOVE YOUR POST! I READ IT +inf.0 TIMES! KEEP POSTING!

Seriously, though, /prog/ needs more people like you, and less like VIPPERDoctor Racket

Name: Anonymous 2011-01-23 18:20

>>12
Spoiler: if you replace C++ with Java in >>12, it still works.

Name: Anonymous 2011-01-23 18:27

>>14
Spoiler: if you replace Java with COBOL and C++ with Visual Basic in >>​14, it still works.

Name: Anonymous 2011-01-23 18:43

>>14,15

Spoiler: It's kind of like starting with a shitty language (and continuing to use nothing but that shitty language) is a bad thing. The only reason I didn't make >>12 more general is because the was very specific about C++, so I needed to tear down his little world by being specific myself.

Name: Anonymous 2011-01-23 18:44

>>16
I accidentally a word.

Name: Anonymous 2011-01-23 19:24

>>16
Not sure why you assumed I was living in my 'little world'. I realize that a foundation is going to be necessary for programming, but figured an easier question to answer would be one dealing with a specific language.

What should I read to build my own little world then?
Willing to read pretty much anything.

Name: Anonymous 2011-01-23 19:44

>>18
you should read >>12 again.

SICP, THE ANSWER IS RACKET + SICP!

Name: Anonymous 2011-01-23 19:45

>>18
Structure and Interpretation of Computer Programs. The C Programming Language (it's a little dense). If you get stuck, fall back and learn Python to build your skill (the docs on the website are good enough, although I've heard good things about a book called, "How to Think Like a Computer Scientist"), but don't use it a crutch.

At this point, the specific language isn't quite what matters. It's what general lessons you get from the language. Scheme is used in SICP, which will teach you about high-level programming (and general software design). C and assembly thrown together will teach you about low-level programming.

The problem with C++ (ignoring all the crap you have to wade through to even start writing a program), is that you can write in C++ and learn very few valuable valuable lessons about programming; unless you stick to the C libraries (which makes using C++ pointless anyway), you can end up learning something that resembles a crappy version of Java, thanks to std::string, vector, etc. A lot (but not all) C++ tutorials are going to say "char*'s are icky, don't use them", which is probably true enough in the "real world", but you're not writing production code. You're trying to learn.

Start with SICP. Don't get discouraged if you stumble on your first try, just keep going.

Also, don't be lured by money unless you have to be during this process. Too many people start out with good intentions, and then just end up learning PHP or something because they're "pragmatic." If you have to do it to survive, there's no question. But most people do it because they're lazy.

After all of this, if you make a conscious engineering choice to use C++, then you can probably trust your judgment at that point. The key thing is to have a good foundation, and to remain mentally flexible enough so that you can make good choices later on.

Good luck.

Name: Anonymous 2011-01-23 19:46

>>19
Out of curiosity, why Racket?

Name: Anonymous 2011-01-23 19:55

>>19
I use Chicken Scheme for most things, so I've fallen entirely out of touch with Racket (the last time I bothered, it was still called PLT Scheme). Does it offer any advantage for SICP, or are you just thinking in terms of ease of use, like with the editor (which I wouldn't disagree with, but at some point they'll have to learn Emacs (or possibly vi(m), if they're a terrible person))? The only page about Racket I found that's specific to SICP (that looks useful) is for a package that's still in testing.

Name: Doctor Racket !RACKET/.HY 2011-01-23 19:55

>>21
He's the Racket's advocate. I hate him too.

Name: Anonymous 2011-01-23 19:56

>>20
Thanks.

Would I be better off reading up on low-level computation to build up from the very bottom?

Name: Anonymous 2011-01-23 20:02

>>24
That's a philosophy that a lot of people follow that I personally don't agree with. I think it's better to get into the mindset of thinking abstractly about programs before you start to build up a bunch of concrete concepts. If you start with the small picture, it's too easy to get stuck in the details later on. I've done it (and continue to do it) by focusing on high-level concepts, and then filling in the details later on.

I personally wouldn't start with low-level stuff. While building up everything from the assembly level sounds cool, it will probably make your life more difficult than it needs to be (but feel free to try, I guess).

Name: Anonymous 2011-01-23 21:15

Structure and Interpretation of Computer Programs. The C Programming Language (it's a little dense).

just so you know what "a little dense" is, here are a couple of exerizes from the FIRST CHAPTER:

Exercise 1.11.  A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process.

Exercise 1.13.  Prove that Fib(n) is the closest integer to n/5, where = (1 + 5)/2. Hint: Let = (1 - 5)/2. Use induction and the definition of the Fibonacci numbers (see section 1.2.2) to prove that Fib(n) = (n - n)/5.

you can find these exersizes here:
http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html#%_toc_start
 if you think Im making this up


If you get stuck, fall back and learn Python to build your skill
heres good advice, if you get *stuck* trying to design graduate level mathematics algorithms in order to learn how to program, you can just go be an idiot and learn a scripting language

here is better advice, admire the expertise that certain people on this board have, but do not take their advice advice as learning how to program. Learn Scheme by reading a good book like "The Scheme Programming Language" which can be read for free here:
http://www.scheme.com/tspl3/
and use a standard Scheme implementation like Scheme48 and leave non-standard implementations like Racket for when you have an actual need for it

Name: Anonymous 2011-01-23 21:48

>>26

If you reread my post, you'd realize I was commenting on K&R being dense (newbies often underestimate it because of its size, and then get upset when they don't master it in a weekend).

But since we're talking about SICP, what you failed to point out is that the text right above those exercises explains what most of those things mean (and >>1 can either skip the ones that aren't explained, or go learn proof techniques and whatnot at some point and then do them).

The comment about Python had nothing to do with the language specifically; the idea was if >>1 started having trouble getting through SICP (as newbies often do), they could pick some material that's easier to boost their ability to reason about code in general (and their confidence), and then dive back in.

Finally, if SICP is too hard, and you think learning Python is evil, why not just recommend something like the Little Schemer? Do you think a newbie who can't design "graduate level mathematics algorithms" (unless Discrete Mathematics and the odd sprinkling of calculus is suddenly a graduate-level subject, I don't see anything in SICP that couldn't be learned on one's own. like, without a graduate-level mathematics education) is going to feel more inclined to pour over a language reference? I know K&R is a language reference, but then again I wasn't assuming that >>1 was entirely lazy and stupid from the start.

My entire point was to help the original poster learn about Computer Science and programming, not to learn a particular language. Scheme, C and Python just happen to be good vehicles for doing this. I'd rather challenge them by setting the bar high, rather than undermining from the start by having them take the easy way out.

Name: Anonymous 2011-01-23 22:08

like Scheme48
Before going to Racket I used MIT/GNU Scheme.

Name: Anonymous 2011-01-23 22:15

>>27
ok, I was a little groggy when I posted and I do realize thats not graduate level math, however there are exersizes which are much harder in that chapter which I was too lazy to find.

Im not trying to shoot down the idea of learning Lisp/Scheme, I do think its worth learning as beginners first language. But SICP's audience are those with university level math and those who want to understand theory of algorithms, I just think people should be made aware of that instead of recommending it as though it was on the same level as most other beginners programming books.

>why not just recommend something like the Little Schemer?
Little Schemer
Actually I would recommend "Simply Scheme" which is the concepts in SICP taught in an easier more conventional way. I tried reading "Little Schemer", it was ok but I had a hard time following it, I should try and read it again.

Name: Anonymous 2011-01-23 22:26

>>29
I'll admit the format of the Little Schemer series can be irritating for some people. I've never read Simply Scheme, so I can't comment on it.

I still say you really only need some basic discrete math and calculus for SICP (and even then you could skip most of those exercises without missing all that much), but whatever. I managed to read large chunks of it in highschool, when I had only taken a basic calculus course.

Name: Anonymous 2011-01-23 23:35

>>27
Would reading through SICP and selectively completing the easier problems be worth the effort?

I'm willing to put in the time and effort myself, but I am not completely confident in my mathematics.

Name: Anonymous 2011-01-24 0:05

>>31
As long you learn from it, yes.
Also,
but I am not completely confident in my mathematics.
SICP is not about mathematics, nor it is functional programming.

Name: Anonymous 2011-01-24 0:13

>>31
It'll just be a good occasion to brush up on your math as well. C'mon, don't be lazy.

Name: Anonymous 2011-01-24 4:38

>>26
Exercise 1.11.  A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process.

I'm sorry, but how is that even remotely difficult? I mean you can just copy paste an example from the book and modify it a little. The square root problem from section 1.1 was much harder than that.

As for the Fib proof it's an exception. Very few exercises ask you to prove stuff mathematically.

Name: Anonymous 2011-01-24 6:05

Exercise 3.19 struck me as likely to be quite difficult for anyone who hasn't previously encountered the tortoise and hare algorithm.

Name: Anonymous 2011-01-24 17:03

>>33
Please don’t say「you are lazy」
だって本当はcrazy

Name: Anonymous 2011-01-24 17:08

Why, oh, why SICP?

It is not even teached at MIT anymore...

Name: Anonymous 2011-01-24 17:11

>>37
u mad, oldfags?

Name: Anonymous 2011-01-24 17:16

>>38
I marmalade.

Name: Anonymous 2011-01-24 17:23

>>39
u jelly?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List