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

Bad things about C++

Name: Anonymous 2007-03-02 3:10 ID:8GT6+4Q4

Fuck OO. GOTO or GTFO.

Name: Anonymous 2007-03-02 15:07 ID:rV67uchL

def MakeLabel(l):
    exec 'global %s\nclass %s(Exception): pass' % (l, l)

MakeLabel('Label1')

try:
    shit
    if crap:
        raise Label1
    more shit
except Label1:
    print 'lol'

Name: Anonymous 2007-03-03 9:44 ID:exOQXuzZ

goto?! idiot, its one of the most accident/unreadable prone ways you can code, ever

Name: Anonymous 2007-03-03 9:46 ID:G+pVawGF

>>3
Uh, hello, have you been to world4ch recently since it was created? This is not about serious programming, it's about DEVELOPERS DEVELOPERS DEVELOPERS.

Name: Anonymous 2007-03-03 9:55 ID:kdDlDuD0

>>3
Uh, hello have you ever disassembled your C++ code to see what a while/for loop really is ? This is not about unreadable ways you con code, it's about JMP JMP JMP.

Name: Anonymous 2007-03-03 11:15 ID:1/ESRUiM

>>5

while / for loops force code nesting, which is good for readability compared to goto where you can confusingly leap about all over the place if you want.

Name: Anonymous 2009-01-14 12:54

LISP

Name: Anonymous 2009-01-14 12:57

C++ PROGRAMMERS ARE ALL RETARDS. I HATE C++ PROGRAMMERS SO MUCH. I LOL AT HOW THEY MAKE THINGS PRIVATE IN CLASSES BUT THEY ARE CLASSES THAT THEY ARE JUST USING THEMSELVES. STOP BEING A FAG. DONT THEY TRUST THEMSELVES>??? OOOOH IVE GOT TO PROTECT THE VARIABLSE.

FUCK U C++. I AM A SUPER COOL PROGRAMMER AND I CAN HANDLE HAVING ACCESS TO EVERYTHING I AM USING. IF IM NOT MEANT TO USE IT, I WONT. IM NOT SOME FAG THAT CANT BE TRUSTED AND HAVE TO HAVE THE PRIVACY ENFORCED. ENJOY YOUR WASTED HOURS WRITING GET AND SET METHODS FAG WHILE IM WRITING AMAZING CODE AND HAVING SEX WITH MODELS AND SNORTING COCAINE OFF THEIR TITS.

Name: MARIO 2009-01-15 8:24

[b]
[code]
░░░░░░░░░░░░░░░████░░
░░░░░░░████████░░░░█░
░░░░░░█▓▓▓▓▓▓▓█░░░░█░
░░░░░█▓▓▓▓▓▓▓▓▓▓░░░█░
░░░░░█▒▒▒░░▒░░▒▒▒▒▒█░
░░░░█▒░▒░░░▒░░▒▒▒▒▒█░
░░░░█▒░▒▒░░░▒░░░░▒▒█░
░░░░█▒▒░░░░▒▒▒▒▒▒▒█░░
░░░░████░░░░░░░▒▒█░░░
░░░█▒▒▒▒▒▓▒▒▒▓▒▒███░░
░░█▒▒▒▒▒▒▒▓▒▒▒▓▓█▒▒█░
░█░░▒▒▒▒▒▒▓▓▓▓▓▓█▒▒█░
░█░░░░▓▓▒▓▓░▓▓░▓▒▒▒█░
░░█░░▒▓▓▓▓▓▓▓▓▓▓▒▒▒█░
░░░█▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒█░
░░█▒▒▒▓▓▓▓▓▓▓▓█████░░
░░█▒▒█▓▓▓▓▓███░░░░░░░
░░░██░█████░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░
[code]
[/b]

Name: Anonymous 2009-01-15 8:31

>>8

enjoy being the only one to ever use/read your programs/code. ALONE.

Name: Anonymous 2009-01-15 8:35

>>10
I WORK AS PROGRAMMER DIPSHIT

Name: Anonymous 2009-01-15 8:36

>>11
Are you the only one in your team? Do you trust yourself as much as your teammates?

Name: Anonymous 2009-01-15 8:37

>>11
Please calm down, Xarn. Think about your blood pressure.

Name: Anonymous 2009-01-15 8:38

░░░░░░░░░░░░░░░████░░
░░░░░░░████████░░░░█░
░░░░░░█▓▓▓▓▓▓▓█░░░░█░
░░░░░█▓▓▓▓▓▓▓▓▓▓░░░█░
░░░░░█▒▒▒░░▒░░▒▒▒▒▒█░
░░░░█▒░▒░░░▒░░▒▒▒▒▒█░
░░░░█▒░▒▒░░░▒░░░░▒▒█░
░░░░█▒▒░░░░▒▒▒▒▒▒▒█░░
░░░░████░░░░░░░▒▒█░░░
░░░█▒▒▒▒▒▓▒▒▒▓▒▒███░░
░░█▒▒▒▒▒▒▒▓▒▒▒▓▓█▒▒█░
░█░░▒▒▒▒▒▒▓▓▓▓▓▓█▒▒█░
░█░░░░▓▓▒▓▓░▓▓░▓▒▒▒█░
░░█░░▒▓▓▓▓▓▓▓▓▓▓▒▒▒█░
░░░█▒▒▒▓▓▓▓▓▓▓▓▓▒▒▒█░
░░█▒▒▒▓▓▓▓▓▓▓▓█████░░
░░█▒▒█▓▓▓▓▓███░░░░░░░
░░░██░█████░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░

Name: Anonymous 2009-01-15 8:41

>>13
HE HAS ANGERED AN EXPERT PROGRAMMER

Name: Anonymous 2009-01-15 9:31

>>11
PROGRAMMER DIPSHIT
I wish my title were as cool as yours.

Name: Anonymous 2009-01-15 9:44

>>16
FUCK U NON-EXPERT FAGGOT.

Name: Anonymous 2009-01-17 20:39

>>16

Oh God I lol'd.

Name: Anonymous 2009-01-17 22:20

>>16
>>18
same person

Name: Anonymous 2009-01-17 23:12

C++ is not an Object Oriented language. It is an extension to C that allows for different programming models, Object Oriented is one of them.

These extensions allow you to implement the concepts of the model, but the language itself is not oriented to these other models.

An object oriented language would preserve an objects identity across scope. C++ does not do this. It give you operators so that you can implement these patterns yourself.

It is a huge distinction.

Name: Anonymous 2009-01-17 23:34

It is an extension to C
no, it isn't. it's an extension to a subset of c. they took out most of the useful stuff, deprecated anything useful that was left, and added a bunch of useless shit.

Name: Anonymous 2009-01-17 23:46

Ok, tell me, which useful feature did they take out.

Duff's device still works, bitfields are still there, variable arguments as well, even goto.

Name: Anonymous 2009-01-18 0:05

>>22
1:
int64_t

2:
int x = '09';

3:
enum day_of_week { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY };
enum day_of_week d = MONDAY;
++day_of_week;


4:
char *s = malloc(1024);

5:
void f(int n){
 if(n < 0) goto end;
 int x = 0;
end:
 return 0;
}

Name: Anonymous 2009-01-18 3:59

1. Compiler specific, __int64 is defined in gcc, still there.
2. Still there.
3. Still there.
4. Still there.
5. Still there.

stop using -pedantic

Name: Anonymous 2009-01-18 4:08

>>24
1. compiler-specific, not in standard c++.
2. warning: multi-character character constant
3. error: no match for 'operator++' in '++d'
4. error: invalid conversion from 'void*' to 'char*'
5.
test.cc: In function 'void f(int)':
test.cc:4: error: jump to label 'end'
test.cc:2: error:   from here
test.cc:3: error:   crosses initialization of 'int x'

Name: Anonymous 2009-01-18 4:10

>>23

1. not a feature of C
2. warning in both C and C++, can be ignored
3. your code doesnt work, supposed to be ++d, day_of_week is a type, strict type checking, not a problem, quit whining
4. strict type checking, not a problem, quit whining
5. cross initialisation, not a problem, quit whining

so your so called useful stuff is a bunch of useless shit, congrats

Name: Anonymous 2009-01-18 4:16

>>26
1. it's in the c standard. it is a feature of ansi c.
2. character constants in c are of type int. character constants in c++ are of type char. '09' is invalid in c++.
3. yes, it is supposed to be ++d. but see >>25.
4. yes, it is a problem. there's a reason void * exists, and c++ ignores that reason.
5. it works in c. it doesn't work in c++. there are cases where it's useful.

Name: Anonymous 2009-01-18 4:17

>>17
EXPERT TROLL

Name: Anonymous 2009-01-18 4:26

>>27
1. No, I compiled with gcc with ANSI, returns data has no type or definition error. Point me to a ANSI compliant compiler that accepts it.
2. Same warning is given when compiled with gcc/g++, your point is invalid.
3. See *
4. The old "dont cast return value of malloc" argument, pointers are all uniform size now, there is no more far, long or near pointers anymore, see *, the reason void* existed in the first place is because you could not expect the size of the pointer to be constant.
5. There are no cases where it's useful, see *.

*: Not a problem like I said, you're just nitpicking, hows it useful? Explain and back it up with real production code that uses it.

Out of all 5, only the fifth one is worthy of a argument, and I don't see how it's useful at all, if I wanted to use x, then in C++ I'd simply place it above the goto, if I didn't then the code that uses x could be placed in a if statement. Even then you couldn't give a good argument for it's use. Bad coding pratice doesn't mean it's useful.

int f(int n){
 int x = 0;
 if(n < 0) return 0;
 ...
}

Name: Anonymous 2009-01-18 4:58

Fuck, the sad thing is I was right. Som idiot who thinks he knows more posted 5 points of BS to disprove that. Then got pwned by 5 correct responses calling out his faggotry.

/prog/ is usually the most horseshit programming board on the Internets, because it tries so hard to be. But at least 1 of of ever 90 threads shows there are a couple people who vaguely understand this shit and are not idiot wannabe programmers and CS students who really want to learn CSE but go to terrible schools who don't know the difference.

Name: Anonymous 2009-01-18 5:10

>>29
1. gcc uses the old version of the ansi c standard by default. use -std=c99, #include <stdint.h>, and int64_t will work.
2. it should be an error in c++, because '09' isn't a valid value for a char in c++. g++ is broken.
3-5. they are valid points to demonstrate that c++ is not an extension to c. c and c++ are very different languages, and you obviously don't know c.

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !FrOzEn2BUo 2009-01-18 5:32

>>31
If they are so very different,how come you can convert  C programs to C++? like http://www.scriptol.org/ctocpp.php

_________________________
orbis terrarum delenda est

Name: Anonymous 2009-01-18 5:36

`expert`

Name: Anonymous 2009-01-18 5:54

>>30
Try posting this in comp.lang.c++.moderated and see how much better the replies you get are.

Name: Anonymous 2009-01-18 7:11


-INSANE-PRIEST--INSANE-PRIEST--INSAN
I___________,.-------.,____________I C++
N______,;~'_____________'~;,_______N fucking
S____,;______C++ FUCKING____;,_____S sucks
A___;___SUCKS, YOU FUCKING____;____A
N__,'______/PROG/ RETARDS.____',___N Stroustrup
E_,;___GET IT INTO YOUR HEAD___;,__E is a
-_;_;______._____l_____.______;_;__- cocksucker
P_l_;____________l____________;_l__P
R_l__`/~"_____~"_._"~_____"~\'__l__R C++
I_l__~__,-~~~^~,_l_,~^~~~-,__~__l__I fucking
E__l___l________}:{__ (O) _l___l___E sucks
S__l___l_ (o) _/_l_\_______!___l___S
T__.~__(__,.--"_.^._"--.,__)__~.___T Stroustrup
-__l_____---;'_/_l_\_`;---_____l___- is a
-___\__._______V.^.V___((oo))./____- cocksucker
I__O_VI_\________________ll_IV___O_I
N_____I_lT~\___!___!___/~ll_I______N C++
S_____I_l`IIII_I_I_I_IIIIll_I__o___S fucking
A_O___I__\,III_I_I_I_III,ll_I______A sucks
N______\___`----------'__ll/____o__N
E____O___\___._______.___ll________E Stroustrup
-_________\..___^____../(_l___O____- is a
P_________/_^___^___^_/__ll\_______P cocksucker
R_O______/`'-l l_l l-';__ll_l___O__R
I_______;_`'=l l_l l='__/ll_l______I
E_____O_l___\l l~l l__l/_ll_l______E Your mother
S_______l\___\ l_l l__;__ll_l__O___S was good
T__o____l_\___ll=l l==\__ll_l______T in bed, she
-____o__l_/\_/\l_l l__l`-ll_/______- grunts like
-_______'-l_`;'l_l l__l__ll_____O__- an ape.
I_O_______l__l l_l l__l__ll________I
N____O____l__l+l_l+l__l__ll___O____N Stroustrup
S_________l__"""_"""__l__ll________S is a
A__O______l____o_o____l__ll____O___A cocksucker
N_________l,;,;,;,;,;,l__ll________N
E_____O___`lIlIlIlIlIl`__ll________E Original
-__________llIlIlIlIll___ll_____O__- By Dessimat0r
P__________`"""""""""`___""________P (c)2003 Trollkore
-INSANE-PRIEST--INSANE-PRIEST--INSAN

Name: Anonymous 2009-01-18 10:39

>>29
You don't understand why you shouldn't cast malloc's value, and further, your statement suggests that you haven't done much work on systems other than 32-bit x86. Not that I'm suggesting that is the case; you may very well have written heaps of DEC Alpha code while blindfolded, and typing with your toes with your keyboard behind your back. Who knows.

First off, suppose, for whatever reason, you have carelessly omitted that #include <stdlib.h> that you ought to be writing whenever you use malloc. On x86, that's no big deal, because return type in C defaults to int. On any system, if you're casting your return, you won't even get warnings about it ... unless you have strict warnings enabled to catch the missing prototype, in which case if you're still casting the return value, you're basically just a robot doing stuff because that's what people have told you, and clearly have no idea what the fuck is going on. But that aside, int is four bytes, void * is four bytes, int * is four bytes, blah blah blah who cares, right? Until, of course, you build your code on a 64-bit system where sizeof(int) == 4 and sizeof(void *) is 8. Now your code is fucked, because you're casting things to the wrong-sized data.

The other, more significant reason is, any time you do an explicit cast, you're telling the compiler "I'M SMARTER THAN YOU, SHUT UP". If you're assigning from one type to another compatible type, a cast is completely unnecessary, and only will serve to cause problems later on when you decide that, damn, making all of those variables char was a dumbass idea, I really should've been using int all this time -- and suddenly your oh-so-clever casts are wiping out the high bits in all your data, and you're fired for being a nincompoop.

Aside from all this, the point ought to be irrelevant anyway, because in C++ you shouldn't even be using malloc in the first place. That's why it has that new operator that ensures type safety and all that other bullshit that makes you feel good about how awesome your code is.

Name: Anonymous 2009-01-18 12:16

>>36
Why is int only 4 bytes long in 64-bit systems?

Name: Anonymous 2009-01-18 12:38

>>37
His point was that it might be only 4 bytes.

Name: Anonymous 2009-01-18 12:44

>>37
Why aren't all ints just bignums?[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o[o][/o IHBT

Name: Anonymous 2009-01-18 12:51

>>38
OK, then. Why would int be only 4 bytes long in a 64-bit system?

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