Click here to Skip to main content
15,894,460 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Why I hate C++ Pin
kalberts16-Jul-18 2:42
kalberts16-Jul-18 2:42 
GeneralRe: Why I hate C++ Pin
kalberts14-Jul-18 3:36
kalberts14-Jul-18 3:36 
GeneralRe: Why I hate C++ Pin
Gary Wheeler16-Jul-18 1:45
Gary Wheeler16-Jul-18 1:45 
GeneralRe: Why I hate C++ Pin
MKJCP16-Jul-18 3:18
MKJCP16-Jul-18 3:18 
GeneralRe: Why I hate C++ Pin
Gary Wheeler16-Jul-18 3:20
Gary Wheeler16-Jul-18 3:20 
GeneralRe: Why I hate C++ Pin
MKJCP16-Jul-18 3:30
MKJCP16-Jul-18 3:30 
GeneralRe: Why I hate C++ Pin
dan!sh 13-Jul-18 4:57
professional dan!sh 13-Jul-18 4:57 
GeneralRe: Why I hate C++ Pin
Rick York13-Jul-18 6:26
mveRick York13-Jul-18 6:26 
Operator overloading can result in some of the worst abuses of the language. Usually the overloads are intuitive and reduce your typing but they can be easily taken beyond that into the realm of the absurd.

I recently wrote my own little vector and matrix library for 3D graphics and there are some overloads in it that I think are sensible. For example, I have a point class that stores three coordinates and it has an [] overload that returns the coordinate at that index. This lets you write point[index] instead of point.coordinates[index]. That makes sense to me and I would not want it to do anything else behind the scene.

The example you cite is beyond what I consider to be intuitive. It would be best to have explicit methods to implement that functionality instead of an overridden operator in my opinion.

I don't hate C++ at all. What I hate is when people try to get cute with it as in your example. I don't think it enhances the readability or maintainability of the code at all if one has to figure out what is going with a statement like that.
GeneralRe: Why I hate C++ Pin
Ian Bell, #213-Jul-18 6:44
professionalIan Bell, #213-Jul-18 6:44 
GeneralRe: Why I hate C++ Pin
Munchies_Matt14-Jul-18 21:57
Munchies_Matt14-Jul-18 21:57 
GeneralRe: Why I hate C++ Pin
Ian Bell, #215-Jul-18 7:06
professionalIan Bell, #215-Jul-18 7:06 
GeneralRe: Why I hate C++ Pin
Munchies_Matt15-Jul-18 21:16
Munchies_Matt15-Jul-18 21:16 
GeneralRe: Why I hate C++ Pin
Ian Bell, #217-Jul-18 6:54
professionalIan Bell, #217-Jul-18 6:54 
GeneralRe: Why I hate C++ Pin
TheGreatAndPowerfulOz13-Jul-18 8:04
TheGreatAndPowerfulOz13-Jul-18 8:04 
GeneralRe: Why I hate C++ Pin
Munchies_Matt14-Jul-18 4:35
Munchies_Matt14-Jul-18 4:35 
GeneralRe: Why I hate C++ Pin
TheGreatAndPowerfulOz14-Jul-18 7:42
TheGreatAndPowerfulOz14-Jul-18 7:42 
GeneralRe: Why I hate C++ Pin
Munchies_Matt14-Jul-18 19:20
Munchies_Matt14-Jul-18 19:20 
GeneralRe: Why I hate C++ Pin
Nish Nishant13-Jul-18 9:47
sitebuilderNish Nishant13-Jul-18 9:47 
GeneralRe: Why I hate C++ Pin
kalberts14-Jul-18 3:47
kalberts14-Jul-18 3:47 
GeneralRe: Why I hate C++ Pin
Munchies_Matt14-Jul-18 21:44
Munchies_Matt14-Jul-18 21:44 
GeneralRe: Why I hate C++ Pin
kalberts15-Jul-18 23:13
kalberts15-Jul-18 23:13 
GeneralRe: Why I hate C++ Pin
kalberts16-Jul-18 0:39
kalberts16-Jul-18 0:39 
GeneralRe: Why I hate C++ Pin
11917640 Member 14-Jul-18 21:30
11917640 Member 14-Jul-18 21:30 
GeneralRe: Why I hate C++ Pin
KBZX500016-Jul-18 2:34
KBZX500016-Jul-18 2:34 
GeneralRe: Why I hate C++ Pin
Munchies_Matt16-Jul-18 3:04
Munchies_Matt16-Jul-18 3:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.