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

Pages: 1-4041-

So, C++ is starting to grow on me...

Name: Anonymous 2008-11-26 15:53

After using C++ all semester for two classes (OOP with C++, and Data Structures), I'm starting to like C++ more than C. Of course it's no Haskell or SICP, but I'm starting to wonder why I'd ever want to write in C again. I've even started re-writing a small C app I wrote to C++; although the compiled size is larger (about 44 KiB instead of 29 KiB,) the source will likely be about half the size. Best of all, because of the STL containers, I don't need to write any explicit new/delete, so my program is easier to keep leak-free.

tl;dr const references make me feel warm and fuzzy inside.

Name: Anonymous 2008-11-26 15:58

SICP is not a language.

Name: Anonymous 2008-11-26 15:58

Aha, I see...

Name: Anonymous 2008-11-26 16:12

I thought the same things as you some time ago, while I was reading a document called C++ Annotations[1].

Then, after a while, I noticed that C++ has more drawbacks than advantages. Just think about how many hacks you need to do in order to avoid strange behaviours. An example?


    IntArray const &IntArray::operator=(IntArray const &other)
    {
        if (this != &other)  // Why should I care about this??
        {
            delete[] d_data;
            copy(other);
        }
        return *this;
    }


Here[2] you can find an in-dept discussion about why you should avoid to use (and to improve) c++.

[1] http://www.icce.rug.nl/documents/cplusplus/
[2] http://yosefk.com/c++fqa/index.html

Name: Anonymous 2008-11-26 16:15

The pleasure of being cummed inside

Name: Anonymous 2008-11-26 16:18

>>4
How the hell is that code you cited a ``hack?''

3/10.

Name: Anonymous 2008-11-26 16:22

>>6

Search that snippet into this page[1] and you'll either understand and shit bricks.

[1] http://www.icce.rug.nl/documents/cplusplus/cplusplus09.html

Name: Anonymous 2008-11-26 16:26

>> 6
>> 7
Errata corrige:
http://www.icce.rug.nl/documents/cplusplus/cplusplus07.html
paragraph 7.4.1

Name: Anonymous 2008-11-26 17:10

Funny, after three classes worth of Sepples I'm raging harder than ever at having to use it. Every line I type reminds me how much more easily whatever I'm doing could be done.

Name: Anonymous 2008-11-26 18:21

If 'C' is the only alternative, Sepples is not that bad.  It's just that most of the time there's a wider choice available.

Name: Anonymous 2008-11-26 18:38

>>8
Good website authors place anchors at headers; indeed that is the case here, so paragraph 7.4.1 may be referenced as http://www.icce.rug.nl/documents/cplusplus/cplusplus07.html#l124

Name: Anonymous 2008-11-27 6:07

>>7
If you're writing code that has to deal with raw pointers like in that snippet then you're doing it wrong.
In the unlikely case when you need to manipulate raw pointers then that's the cost of manual memory management and you have to deal with it.

Name: Anonymous 2008-11-27 6:43

>>1
It's all fine till you get to point when you start using template metaprogramming from Boost or STL. When you get to this point, it's probably better to scrap the project and move to Haskell.

Name: Anonymous 2008-11-27 8:15

The Pleasure of Being Cummed Inside

Name: Anonymous 2008-11-27 13:31

>>14
TePoBCI?

Name: Anonymous 2008-11-27 15:52

>>12
You're pretty confused. That page is about overloading the operators when creating a new class.

Name: Anonymous 2008-11-27 17:26

>>16
The example is shit, though. 

Nobody should be writing or teaching Sepples using something with raw pointers a bare new[]'d buffer in it at any time in the last decade. std::vector<>, std::string and various smart-pointer classes were invented for a reason.  All of http://www.icce.rug.nl/documents/cplusplus/cplusplus07.html reeks of c1990 idiom and should be taken out round the back of the barn and put out of our misery.

Name: Anonymous 2008-11-27 17:44

>>16
Oh, really? Tell me. What code should an overloaded operator= do in that example if you'd use an STL string (or better yet: a smart pointer) instead of bare C strings?

Name: Anonymous 2008-11-27 17:46

>>18
The operator= is already implemented in STL strings, genius.

Name: Anonymous 2008-11-27 17:51

>>17
The whole site is by a guy named Frank B. Brokken. Talk about irony.

Name: Anonymous 2008-11-27 18:00

Why anyone would use a language to OOP that itself does not implement OOP contructs and forces the programmer to implement them themselves is pure faggotry.

While Java is faggy as shit, if you want to see a somewhat proper implementation of class based OOP with C syntax you can look at that.

>>4
>// Why should I care about this??

Because equality and identity are 2 different concepts. Learn to OOP.

Name: Anonymous 2008-11-27 18:07

There was a time when I thought this same thing. Then I got some fucking terrible template errors and went back to plain C.

Name: Anonymous 2008-11-27 18:12

Learn OCaml, it is way faster than Haskell, and provides great features like Object Orienting programmering.

Name: Anonymous 2008-11-27 18:31

VB.Net is more OOP than C++. Everything is an object. Objects dervied from a class are always references, you never get the value of the object, becuase in OOP you never need the value.

You can make method signautres like:

Public Sub MakeFaggot(ByVal You As Person)

And I know some of you faggots look at this and are not going to understand it. ByVal does mean By Value. You is passed in ByVal becasuse You is a reference to an instance of a Person object. All instance variables of classes are references. If you are a faggot and try to pass it in ByRef, the compiler will see that you are a faggot and know that passing a reference to a reference is faggy and pointless and change it to ByRef.

None of that bullshit * and & extra syntax implementation bullshit.

Name: Anonymous 2008-11-27 18:48

>>23
I hate OCaml syntax, and, according to http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=ghc&lang2=ocaml both are comparable in speed, so I'll stick with Haskell.

Name: Anonymous 2008-11-27 19:58

c/c++ is for rote learners.

Name: Anonymous 2008-11-28 4:28

>>22
Here take this, http://www.bdsoft.com/tools/stlfilt.html .
It's dangerous to go alone.

I know a template error looks like the compiler just disembowelled itself but you're missing out on something like 10 to 15 years of language development.

Name: Anonymous 2008-11-28 5:58

>>27
OH WOW, Sepplesism in its purest form. An overcomplicated solution to an overcomplicated problem that was supposed to be a solution to a problem that was caused by an overcomplicated language. GOOD JOB!

Name: Anonymous 2008-11-28 6:10

something like 10 to 15 years of language development.
that's pretty funny coming from someone who is missing out on about 20 years of language development... if you want c with lots of java-style LOL OBJECT ORIENTED hacked on to it, try c# instead.

Name: Anonymous 2008-11-28 6:25

>>27
the latest version of the ISO C standard was published in 1999.
the latest version of the ISO C++ standard was published in 1998.

C has modern features like variable-length arrays, native complex-number types, and compound literals, which C++ lacks.

Name: Anonymous 2008-11-28 7:34

>>30
Name: Anonymous : 1978-11-28 06:25
[..] modern features like variable-length arrays, native complex-number types, and compound literals [..]
Fix'd.

Name: Anonymous 2008-11-28 8:04

>>28
It's a stop-gap solution, yes. Work on improving error readability is under way.
>>29
>>30
c++0x and TR1
Concepts, variadic templates, tuples, lambda expressions, limited type deduction etc.

You're both stuck in the 80s.

Disclaimer: I have read SICP.

Name: Anonymous 2008-11-28 8:22

>>31
how many languages can you name that have native complex-number types? how many can you name that were around in 1978?
also, you forgot the which C++ lacks part.

Name: Anonymous 2008-11-28 8:57

>>32
Concepts
interfaces in C#.

variadic templates
variadic functions and variadic macros in C, variadic functions in C#.

tuples
anonymous types in C#.

lambda expressions
already in C#, can be done with macros in GNU C.

limited type deduction
already in C#.

Name: Anonymous 2008-11-28 9:32

>>34
If you like it so much, why don't you marry it.

Name: Anonymous 2008-11-28 14:42

>>33
When was the last time you used complex numbers in a context where having them as a primitive type actually sped things up significantly?

Name: Anonymous 2008-11-28 16:11

>>34
>Concepts
>interfaces in C#
Concepts (with concept maps) are not exactly the same as interfaces. As I understand it, they're more like Haskell type classes. In C# you can't make a class implement an interface unless you created that class; you have to write an adapter class that implements the interface and calls methods on the original object[citation needed]. In short, it's still shitty in these cases. And what's more, you can't do generic arithmetic with primitive types because there is no built-in interface which has the +, -, etc. functions, and even if you made one you can't make Int32 implement that interface.

(Of course, like C, C++ and C# have the problem of integer promotion, so generic versions of arithmetic operators probably couldn't be written in either of them without some work. But still.)

>variadic templates
>variadic functions and variadic macros in C, variadic functions in C#.
If C# had variadic generics, perhaps you wouldn't have things like Func<TResult>, Func<TResult, T1>, Func<TResult, T1, T2>, Func<TResult, T1, T2, T3>, and Func<TResult, T1, T2, T3, T4>.

You're right enough about the last 3. And don't misunderstand me, I'm not saying C++0x is good here. It will still suck.

Name: Anonymous 2008-11-29 9:52

>>35
Some other sad fuck already did, and polygamy is illegal. I have to settle for adultery.

Name: Anonymous 2008-11-29 13:13

>>35
I lol'd.

Name: Anonymous 2008-11-29 14:05

Look at it this way.

On most browsers, you can bring up your browsing history by pressing Control-H. (No, this is not going to become a discussion of werecows.) On Firefox, this brings up a sidebar that shows up on the left side of the window. If you put your mouse over the edge of the sidebar, the cursor will turn into a different kind of arrow. By clicking and dragging it, you can move the edge of the sidebar back and forth. You are, to put it another way, manipulating the border between the normal window and the history window. By moving the mouse, you can increase the portion of the window devoted to either part. In a more extreme view of this situation, you're increasing or decreasing the amount of existence the sidebar has.

Now, let's apply this idea to something more abstract. Look out your window. If you don't live in a highly urbanized area, you should be able to see the horizon. Think of this as the border between the land and the sky. The land and sky are obviously distinguishable thanks to this boundary. Now, if you were to "drag" the sash between the sky and the land, or to manipulate the border between land and sky, you would end up causing the sky to become larger and the land to become smaller, or vice versa. An effect of this might be to cause something that was just on the ground to suddenly be hundreds of feet in the air. Truly a frightening situation to be in. So, look at it this way - manipulating the border between two physical things shifts whatever balance there is in the interaction between those things. Alternatively, by manipulating the border between two things, you can change the manner in which they exist.

Still, this isn't *that* abstract, since it's still dealing with real things in the real world. Many believe that in this world, there are those things that are true, and those that obviously aren't. This divides reality into two extremes: truth and falsehood. But, since we have two extremes, logically one can imagine a boundary between those two extremes - the border between truth and lies. If one were to manipulate this border, suddenly things that were pure fantasy (flying pigs, for the sake of argument) have become reality - or things from reality have ceased to exist. This is how Yukari is said to have invaded the moon - by manipulating the border between truth and lies, as applied to the reflection of the moon on a pond, she was able to make the reflection of the moon into a manifestation of the actual moon, and so send her youkai army onto it. This is what's truly amazing about Yukari's power - the ability to manipulate the border between completely abstract concepts allows her to fundamentally change reality as we know it (at least in terms of two abstract concepts).

Name: Anonymous 2008-11-30 20:29

Sepples feels like an horrible corruption of C. It takes a simple straightforward language and stuffs it full of features that when used combined end up looking like a load of convoluted shit. OCaml is far superior.

Name: Anonymous 2008-12-01 16:21

>>41
ANSI Common LISP feels like a horibble corruption of C. It takes a simple straightforward language and stuffs it full of features that, when used combined, end up looking like a load of convoluted shit. Scheme is far superior.

Name: Anonymous 2008-12-01 17:40

>>42
ANSI Common LISP feels like an horiboble corruption of Maclisp.

Name: Anonymous 2008-12-01 19:02

Scheme feels like an horiboble corruption of SICP

Name: Anonymous 2008-12-01 19:24

>>44
Horiboble!

Name: Anonymous 2008-12-01 19:38

I think there's a medication for that.

Name: Anonymous 2008-12-05 7:42

>>46
Agree

Name: Trollbot9000 2009-07-01 8:05

The code involved public.

Name: Anonymous 2010-10-26 21:23

Name: Anonymous 2011-02-04 13:43

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