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

Anyone trying to learn C++

Name: !TK/UA49EzE 2008-06-01 21:45

I've been trying to learn it also, but studying alone makes me get bored of it easily. Anyone interested in learning C++ in a group? it'll be so CACHE (lol, get it?)!

:(

Name: Anonymous 2008-06-01 21:57

back to /b/, please

Name: Anonymous 2008-06-01 22:02

hax(my $anus

Name: Anonymous 2008-06-01 22:45

>>1-3
same fag, fail

Name: Anonymous 2008-06-01 23:55

>>1-3
))

You forgot your closing parentheses.

Name: Anonymous 2008-06-01 23:55

>>4
While it's true that >>1,3 are faggots and >>2's monospace failed, i don't think that would make them the same person. In fact, I am >>0 and >>5 at the same time, but you are not >>1-999. Cocks.

I mean, sage, you faggots. fuck im drunk

Name: Anonymous 2008-06-02 0:10

I can't believe that you'd even think of using C++. Common Lisp or Scheme are so much superior to C/C++. Gifted Students use Scheme and MACSYMA was written in Lisp not C/C++ because Lisp is a better language.

Name: Anonymous 2008-06-02 0:21

>>1
I will now let you in on a little secret. It's boring because you're forcing yourself to waste time and brain-space on the banal trivia that comprise Sepples. Sepples is astonishingly poorly designed, to the point where I honestly can't even imagine what they were thinking. Probably drugs were involved, and not the good ones either.

tl;dr -- Learn anything else. Common Lisp is the obvious choice.

Name: Anonymous 2008-06-02 5:30

Prolog is the logical choice.

Name: Anonymous 2008-06-02 6:00

>>8
3/10

Name: Anonymous 2008-06-02 6:52

F# is the logical choice.

Name: Anonymous 2008-06-02 7:01

Gifted Students use Scheme and MACSYMA was written in Lisp not C/C++ because Lisp is a better language.
a real gifted student would realize that c and c++ are completely different languages.

Name: Anonymous 2008-06-02 7:11

Instead of C++, just learn C. It is much easier to learn. The book The C programming language is only 200 pages, whereas the The C++ programming language is around 1000 pages. With C you can start writing programs much earlier, instead of learning all the details and intricacies of C++.

If you want a more higher level a good alternative is Python, it is also very easy to learn and comes with lots of useful libraries included so you can write useful programs.

Scheme is also a good language, but is quite different from the mainstream languages. However, if you learn Scheme (i.e. READ SICP) you should be able to learn the other languages pretty easily. A disadvantage of Scheme is that it doesn't have very many libraries. So it is good if you want to learn and write algorithms, but not so good if you want to write actual programs. 

Name: Anonymous 2008-06-02 10:15

[citation needed]

Name: Anonymous 2008-06-02 11:02

>>11
F# is the functional choice.

Name: Anonymous 2008-06-02 11:30

Haskell is the lazy choice.

Name: HURRRR 2008-06-02 11:33

Python is the forced choice.

Name: Anonymous 2008-06-02 11:36

>>15,16,17
Different people.

Name: Anonymous 2008-06-02 11:39

>>18
Unoptimised quote.

Name: Anonymous 2008-06-02 12:15

Logo is the logical choice.

Name: Anonymous 2008-06-02 13:13

APL is the write-only choice.

Name: Anonymous 2008-06-02 13:15

Brainfuck is the minimalist choice.

Name: Anonymous 2008-06-02 14:53

Scheme is the educated choice.

Name: Anonymous 2008-06-02 15:09

Visual Basic is the easy choice.

Name: Anonymous 2008-06-02 15:11

Machine language is the final choice.

Name: Anonymous 2008-06-02 15:30

Ruby is the slow as fuck choice.

Name: Anonymous 2008-06-02 15:44

Java is the ENTERPRISE choice.

Name: Anonymous 2008-06-02 16:29

FORTRAN is the scientific choice.

Name: Anonymous 2008-06-02 16:32

Perl is not a choice

Name: Anonymous 2008-06-02 16:42

>>29
Perl is more than one choice.

Name: Anonymous 2008-06-02 16:43

>>30
It's the law.

Name: Anonymous 2008-06-02 17:16

Smalltalk is almost a choice.

Name: Anonymous 2008-06-02 17:33

SICP is the well-read choice.

Name: Anonymous 2008-06-02 17:34

Python is the snaky choice.

Name: Anonymous 2008-06-02 17:46

Yeah, well, you can't be a good programmer without love.

Name: Anonymous 2008-06-02 18:30

>>1-36
Sam Persons.

Name: Anonymous 2008-06-02 18:33

>>10
I don't even know what to make of this. Since I, >>8, said nothing remotely controversial, you must be in turn attempting to troll me. 0/10 for transparency.

Name: Anonymous 2008-06-02 19:03

>>37
If you got confused by the troll and that prompted you to reply, then Y, good sir, HBT.

Name: Anonymous 2008-06-03 2:23

Learn C first (by reading K&R book, of course).

Name: Anonymous 2008-06-03 4:43

>>39
K&R 2.0, not 1.0

(1.0 is pre-ANSI)

Name: Anonymous 2008-06-03 4:52

Templates are what make life worth living.

Name: Anonymous 2008-06-03 6:23

>>41

What makes you say that? They're like macros on steroids.

Name: Anonymous 2008-06-03 7:16

>>41
I don't think you have a life. Enjoy your templates.

Name: Anonymous 2008-06-03 8:39

>>41
I think your templates don't have any life. You enjoy.

Name: Anonymous 2008-06-03 9:17

>>41
template < class T1, class T2 > struct Message {
    static std::string message = "I don't think you have a " + T1::value + ". Enjoy your " + T2::value + ".";
};

prog::post << Message< Hax, Anus >;

Name: Anonymous 2008-06-03 9:21

>>45
Classes with public attributes considered harmful.

Name: Anonymous 2008-06-03 9:50

>>45
Actually, that should be Message< Hax, Anus >::message but who gives a shit.

>>46
OOP considered harmful.

Name: Anonymous 2008-06-03 13:04

>>47
fail

Name: Anonymous 2008-06-03 13:04

>>45
fail

Name: Anonymous 2008-06-03 13:04

>>46
fail

Name: Anonymous 2008-06-03 13:45

>>45
Statics in templates.  Wow, just wow.

Name: Anonymous 2008-06-03 14:07

>>42
You mean they're like macros except obfuscated and barely useful.

Name: Anonymous 2008-06-03 19:52

>>8

Everyone says that, but they don't bother explaining why.

This is >>1, btw.

Name: !TK/UA49EzE 2008-06-03 19:56

By the way, none of you idiots answered my question. Anyone trying to learn in a group?

Name: Anonymous 2008-06-03 20:05

>>53
C++ is poorly designed in every way. Shall I just describe the language to you? Highlights are: context dependence, lack of GC, pointers, a poor object system, weak yet static typing, excess of significant line noise characters, the #include system, lack of keyword arguments, scads of parallel features for everything (each option lacking in a different way), &c. And on top of this, it doesn't even bother to have one thing it really does well.

>>54
None of us are "trying to learn" at all. "Learn"ing Sepples is a matter of keeping appropriate reference books on hand, and making a note of more obscure things you find you need to do often.

Name: Anonymous 2008-06-03 21:08

>>55
You can have garbage collection that you don't need to manually control in C++ if you want, really, and it has been so for *years*...  some people like to "do it" themselves and some people have specific reasons to do so (perhaps resources are scarce on your embedded system).

It is more strongly typed than C, though if you want you may cast anything to anything else.

Other than that, yeah, it is not the best most well designed language, but most of them are not; even so, it is the best tool to use for some jobs and so it is still useful and a hell of a lot better than writing in assembly directly.

Name: Anonymous 2008-06-03 21:37

>>56
a hell of a lot better than writing in assembly directly.
I wasn't aware that this was my only other choice.

Name: Anonymous 2008-06-03 22:50

>>55,56
Objective-C is by far the best OO superset of C. It's clean, simple, easy to understand, and way more flexible and expressive than C++ (and Java, for that matter) will ever be. And it has pointers. And semi-automatic memory management. However, its kind of dynamic dispatch (the same as Python's, Ruby's, Smalltalk's, etc.) is considerably slower than C++'s kind (the same as Java's, C#'s, Object Pascal's, etc.).

Name: Anonymous 2008-06-04 0:17

However, its kind of dynamic dispatch (the same as Python's, Ruby's, Smalltalk's, etc.) is considerably slower than C++'s kind (the same as Java's, C#'s, Object Pascal's, etc.).
that sounds like a problem with specific implementations, not the language itself.
unless there's only one implementation of the language. if so then that's a problem with the language.

Name: Anonymous 2008-06-04 0:24

>>59
It's a problem inherent to the language. It can only be implemented that way.

Name: Anonymous 2008-06-04 0:25

How funny that the below would be written just in time for this discussion.

http://www.yosefk.com/blog/oo-c-is-passable.html

Name: Anonymous 2008-06-04 0:27

>>60
It can only be implemented that way.
That's not correct. I would bet good money that it's possible to fix this up either in the compiler or at run-time.

Name: Anonymous 2008-06-04 7:48

>>54
We're all EXPERT programmers here who have read SICP. We can learn any language on our own in a couple of days.

If you really want to just start learning C++ on your own. If you have any questions you can always ask on /prog/ and the helpful /prog/community will surely answer all your questions.

Name: Anonymous 2008-06-04 10:40

>>62
Not really. Objective-C's dynamic dispatch allows any method to be called on any object at runtime, just like in any dynamic language. C++'s dynamic dispatch restricts wich methods can be called on a object based on the type of the variable that holds the object. If you were to give Objective-C C++'s brew of dynamic dispatch, you would end up turning Objective-C into C++. And that would suck royally.

Name: Anonymous 2008-06-04 10:50

>>63
I will, along with my job.

Name: Anonymous 2008-06-04 16:00

>>64
Yes, really. It's possible to leave this feature in the language from the programmer's point of view but optimize around it most of the time. For example, in a loop a variable's type may be likely not to change. In that instance you can inline the method, reducing the performance hit to a safety check to confirm that object's type (which may be as simple as inspecting your reference to the actual data -- no need to dereference a pointer and load it into memory). This can be applied in other situations as well, and I'm sure there are other techniques I'm forgetting/which haven't been invented yet.

Name: Anonymous 2008-06-04 16:16

C++ is a bunch of confusing bullshit that nobody needs.

Name: Anonymous 2008-06-04 16:40

>>61
um, can anybody say Amiga from 1985?  They did a ton of OO features in plain C all through the OS and public APIs, and I suspect they weren't the first.

>>67
EXPERT PROGRAMMERS are not confused by C++, even if it is not their first choice of languages. faggot

Name: Anonymous 2008-06-04 17:25

Make a Half-Life 2 mod. Also, get some good book on C++ that you can use as a reference. Hack a lot.

Name: Anonymous 2008-06-04 17:48

>>66
That particular optimization, along with method caching and maybe others I don't know about, is already part of the implementation. Resulting programs are still slower than C++ equivalents (though they are never really equivalent, due to not being as dynamic).

Name: Anonymous 2008-06-04 18:33

>>70
Source? And just how much slower?

Name: Anonymous 2008-06-04 18:42

C++ is fucking messy and outdated.  I think it is a fine language though for a lot of reasons.  At the same time there are some languages anyone would prefer to work in.  I think F# offers a lot of options to any programming project.  The language really takes a backseat to the programmer and allows you to dictate which tool for the job more so than in C++ or some other languages (java/c# etc).

F# is my true love at the moment, although I don't mind sleeping around.

Name: Anonymous 2008-06-04 19:00

>>63
Well, I would like to learn C++, but I'm open to suggestions for any other language. And does "SICP" really help with anything? Or is that just a /prog/ meme?

Name: Anonymous 2008-06-04 19:02

>>73
Both.

Name: Anonymous 2008-06-04 19:03

>>71
http://shootout.alioth.debian.org/debian/benchmark.php?test=all&lang=objc&lang2=java

It's not much but will give you an idea. Notice that in the benchmarks where the Objective-C programs make significant use of method calling (namely binary-trees and spectral-norm) those programs are at least 2 times slower than the corresponding Java programs.

Name: Anonymous 2008-06-04 20:37

I am about to learn C++, and I found the book "Beginning C++ Game Programming" from 2004 to be very helpfull. It teaches you C++ from the scratch, with a cool game-angle on it.
Very well-written and fun to read/learn.

Name: Anonymous 2008-06-04 20:48

>>57
For the things that C and C++ are really the Right Tool For The Jobtm, such as low resource environments (embedded systems, etc) or truly real time applications (of which there are very few, and your program that sorts your music collection is not one of them, but medical equipment requiring real time response is)...  then generally assembly is your only other resource to get that close to the machine and if you think Sepples is a lot of pointless work to get something done you haven't written an entire program in assembly lately.

tldr; well it is!

Name: Anonymous 2008-06-04 20:50

>>77
C++ is not the right tool for those jobs.
C++ is to C as PHP is to Perl.

Name: Anonymous 2008-06-04 21:10

>>78
That made no sense.  You're thinking of Pascal.

Name: Anonymous 2008-06-04 21:21

>>79
It makes sense to me, man.

>>77
Wrong, you should use C everywhere and forget about higher level languages. Assembly breaks portability, don't use it unless you are a huge faggot with a lot of time.

>>76
Just use fucking SDL instead of DirectX. Also, lol at abstraction layers selling themselves as direct hardware access

Name: Anonymous 2008-06-04 21:54

>>79
I meant that C++ is a collection of ugly hacks on top of a subset of C, just like PHP is a collection of ugly hacks on top of a subset of Perl.

Name: Anonymous 2008-06-04 22:31

>>81
But PHP ugly hacks are more oriented towards ``library''. Most perl syntax was removed, and they added that ugly <?php ?>. Damn, php as a template language could be so fucking powerful.

Name: Anonymous 2008-06-05 0:25

>>78
Sepples is never the right tool for the job. Stick with C, or risk having your anus haxed.

Name: Anonymous 2008-06-05 1:35

>>78
Both PHP and Perl suck, what the fuck are you getting at?

Name: Anonymous 2008-06-05 3:05

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>
++.>---.+++++++++++++++++++++++.>++.<<+++++
.>+.>.<<------------.>-----------.+++++++.--.>>.

Name: Anonymous 2008-06-05 3:33

>>84
C++ is an octopus made by nailing four legs onto a dog, just as PHP is an octopus made by castrating 4 horses and attaching their penises onto random parts of a dead dog in an utter bloody mess.

Name: Anonymous 2008-06-05 3:44

>>75
Source on the implementation details? But regardless, my point was that there are a lot of clever things that can speed up dynamic languages enormously, and it's shortsighted to say that the current implementation of any particular language is the best possible.

Name: Anonymous 2008-06-05 4:51

>>86
Castration doesn't remove penises, dude.

Name: Anonymous 2008-06-05 4:53

>>88
It does if you're not careful

Name: Anonymous 2008-06-05 5:34

>>70
Actually it's not.  Apple suggests you do it manually ❝on the rare occasion❞ that you call something more than once.
The only way to circumvent dynamic binding is to get the address of a method and call it directly as if it were a function. This might be appropriate on the rare occasions when a particular method will be performed many times in succession and you want to avoid the overhead of messaging each time the method is performed.1
All that happens automatically is this:
To speed the messaging process, the runtime system caches the selectors and addresses of methods as they are used. There’s a separate cache for each class, and it can contain selectors for inherited methods as well as for methods defined in the class. Before searching the dispatch tables, the messaging routine first checks the cache of the receiving object’s class (on the theory that a method that was used once may likely be used again). If the method selector is in the cache, messaging is only slightly slower than a function call. Once a program has been running long enough to “warm up” its caches, almost all the messages it sends find a cached method. Caches grow dynamically to accommodate new messages as the program runs.2
which surely is nowhere near ❝slightly slower❞, since you now have two function calls along with a table scan.

References:
[1] The Objective-C 2.0 Programming Language: Getting a Method Address, http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_9_section_3.html.  Retrieved on June 5, 2008.
[2] The Objective-C 2.0 Programming Language: The objc_msgSend Function, http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_8_section_2.html.  Retrieved on June 5, 2008.

Name: Anonymous 2008-06-05 5:34

>>88
I think >>86 just castrated the horses for fun, and removed their penises later.

Name: Anonymous 2008-06-05 9:18

>>87
I wasn't saying that, I was saying that vtable-based dynamic dispatch will always be faster than multiple-hashtables-based dynamic dispatch, no matter how you optimize it. Both because the former is inherently faster and because much of the latter's optimizations also apply to the former.

Name: Anonymous 2008-06-05 16:23

>>92
You are assuming that dynamic dispatch must do the worst-case legwork in most situations, which is plainly not the case. While the worst case may be worse, when your run-time has dynamically inlined the most common methods, you're nowhere near worst case, and have reduced the cost of method dispatch in most instances to a type-check. So yes, doing more work is slower, but no, merely having the potential to do it does not slow you down if your run-time is good enough to avoid that work. I stress that there will be more clever tricks to come in the future. And it's folly to ignore both known optimizations and future ones, saying, "It can only be implemented this way".

Name: Anonymous 2008-06-05 17:17

real C++ programmers write their dispatch logic as templete metacode

Name: Anonymous 2008-06-05 18:00

>>93
You are assuming that I assumed what you think I assumed. I meant just what was said in >>92, no more, no less. Also, unknown future optmizations are only relevant to future arguments.

Name: Anonymous 2008-06-05 18:21

>>95
Well, somebody said,
It can only be implemented that way.

This is a statement about all possible optimizations, both current and future. I am refuting it. That is all.

Name: Anonymous 2008-06-05 20:03

>>96
Dude, in that post, "that way" == "not through vtables".

Name: Anonymous 2008-06-05 21:13

>>97
Dude, in that post "clarity: not found". If that's actually what was intended, it's the most backwards locution imaginable. In what world does "that way" refer to "every possible way except for some arbitrary other method that I expect you to psychically know I'm thinking of"? But I don't believe that's what was intended. Someone said "it's a problem with a specific implementation" and the response was "It can only be implemented that way".

Name: Anonymous 2008-06-06 3:13

>>98

>>58: looking up methods by global identifier is slowing than indexing a fixed array
>>59: ONLY CUZ UR COMPILER IS DUMB HURR
>>60: no, that's just how things work
>>62-999: HURRRRRRRRR

so where does the fucking psychic bullshit come in?  are you blind or just retarded?

Name: Anonymous 2008-06-06 5:36

ITT: Sepplers being trolled

Name: Anonymous 2008-06-06 11:01

>>98
No, clarity abandoned the discussion in >>59. It was as vague as it could be. >>60 made the mistake of replying to that shitty post and everything got fucked up since.

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