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

Pages: 1-

Operator overloading is the greatest ever!!

Name: Anonymous 2014-03-27 18:03

I discovered operator overloading in Sepples today and I must say that this is the most powerful language feature I've ever seen. Just thinking about the possibilities makes precum pool on the tip of my cock! Let me give you an example of the power. Since I like spinning things, suppose so make a class that models an angle. With stupid people languages you'd use accessors, but by overloading operators anything is possible.

Personally, I hate the = operator, so I can just do something like
Angle* Angle::operator+(double operand){this->degrees += operand; return this}
which will allow statements like
theta + 12.5;
which modify the degree without having to use =!

But the fun doesn't stop there. Since ~ is useless anyway, something like
double Angle::operator~(){return this->degrees;}
can be used as an accessor.

This is obviously a trivial example, but literally every problem can be treated this way. Tomorrow at work, I'm going to begin refactoring the entire code base to take advantage of this feature. I hope my teammates appreciate the conciseness of the new design.

Name: Anonymous 2014-03-27 18:20

imdtzll RSd/Tengoo

Name: Anonymous 2014-03-27 18:28

COCK

Name: Anonymous 2014-03-27 18:35

>>3
I WANT IT NOW

Name: Anonymous 2014-03-27 18:52

>>4
hax my anus

Name: Anonymous 2014-03-30 1:36

>>5
fax my anus

Name: Anonymous 2014-03-30 12:29

>>6
wax my anus

Name: Anonymous 2014-03-30 12:37

>>7
tax my anus

Name: Anonymous 2014-03-30 13:54

>>8
Lax my anus.

Name: Anonymous 2014-03-30 14:13

put your erect penis in my anus

Name: Anonymous 2014-03-31 2:12

Welcome to now OP, we've had Operator overloading for like 40 years now.

Name: Anonymous 2014-03-31 2:19

>>9
Was my anus.

Name: Anonymous 2014-03-31 2:20

>>12
Wax my anus.

Name: Anonymous 2014-03-31 4:54

>>13
Coax my anus.

Name: Anonymous 2014-04-01 23:51

I've overloaded ~ to do things other than negation like that before, in serious code. Does that make me a bad programmer?

Name: Anonymous 2014-04-01 23:53

>>15
Not if you hax my anus.

Name: Anonymous 2014-04-02 10:05

>>15
Not if all vars of this type are named like ifThisHasTildeItsANumber_foobarbaz

Name: Anonymous 2014-04-03 9:02

Op, that's totally horrible if you haven't explained your decisions to your team.

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