User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » I f**king hate C++ Page [1] 2, Next  
TenaciousC
All American
6307 Posts
user info
edit post

There. I said it.

I feel (sort of) better now.

2/4/2009 9:47:37 PM

humandrive
All American
18286 Posts
user info
edit post

post++

2/4/2009 9:48:14 PM

Tiberius
Suspended
7607 Posts
user info
edit post

<-- will do C++ homework for head

2/4/2009 9:48:56 PM

TenaciousC
All American
6307 Posts
user info
edit post

no

[Edited on February 4, 2009 at 9:51 PM. Reason : I will, however, take tutoring offers, expecially if you know a lot about this gdb thing]

2/4/2009 9:50:19 PM

zorthage
1+1=5
17149 Posts
user info
edit post

computers are stupid


you're smarter than a computer, right?

\/ don't forget pointer arithmetic

[Edited on February 4, 2009 at 9:53 PM. Reason : ptr = *ptr + 2;]

2/4/2009 9:52:28 PM

FykalJpn
All American
17209 Posts
user info
edit post

it's like java, but with struct

2/4/2009 9:52:45 PM

TenaciousC
All American
6307 Posts
user info
edit post

^^ I'm beginning to wonder...

^ If I knew java, that would help.

2/4/2009 9:53:26 PM

scud
All American
10804 Posts
user info
edit post

i wish i had gdb

try using the debugger on VMS then come back and complain to me

2/4/2009 9:53:42 PM

Tiberius
Suspended
7607 Posts
user info
edit post

shell2 ~ # gdb /bin/echo
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) set args "WHATS GDB LOL"
(gdb) run
Starting program: /bin/echo "WHATS GDB LOL"
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
WHATS GDB LOL

Program exited normally.
(gdb)

2/4/2009 9:54:31 PM

TenaciousC
All American
6307 Posts
user info
edit post

que?

2/4/2009 9:55:42 PM

Tiberius
Suspended
7607 Posts
user info
edit post

aha, well good luck with that then

2/4/2009 9:57:39 PM

grimx
#maketwwgreatagain
32337 Posts
user info
edit post

post++;

2/4/2009 9:57:48 PM

Tiberius
Suspended
7607 Posts
user info
edit post

while (++post);

2/4/2009 9:58:31 PM

JohnnieWalkr
All American
2673 Posts
user info
edit post

TENACIOUSC++


ba-dum-ching

2/4/2009 9:59:11 PM

joe17669
All American
22728 Posts
user info
edit post

i dont know whats worse. writing the programs yourself or trying to interface with our software developers. that whole floor is full of social awkwardness and hundreds of empty bottles of mountain dew.

2/4/2009 10:00:11 PM

zorthage
1+1=5
17149 Posts
user info
edit post

better that then mellow yellow

2/4/2009 10:01:26 PM

NeuseRvrRat
hello Mr. NSA!
35386 Posts
user info
edit post

but not as good as sun drop

2/4/2009 10:02:11 PM

Tiberius
Suspended
7607 Posts
user info
edit post

it's like java, but with struct awesomeness

e.g

void strcpy( char * src, char * dst ) {

while ( *(dst++)=*(src++) ); // Try making that a one-liner in Java (without using library functions)!11

}


there are also a couple additional kinds of wacky inheritance that Java wouldn't touch with a 10-ft pole

2/4/2009 10:05:34 PM

zorthage
1+1=5
17149 Posts
user info
edit post

hardcore c++ is MUCH easier to read than hardcore perl



so thank your stars its just C++

2/4/2009 10:09:57 PM

scud
All American
10804 Posts
user info
edit post

^^ that's not C++

2/4/2009 10:15:35 PM

Tiberius
Suspended
7607 Posts
user info
edit post

that is perfectly valid C++, though technically it's also C

do you want me to inline the whole fucking string class smarty pants

2/4/2009 10:16:37 PM

scud
All American
10804 Posts
user info
edit post

its also horrendously unsafe and insecure

copy a non terminated string and you just reformatted your harddrive.

try doing that in Java

2/4/2009 10:18:12 PM

Tiberius
Suspended
7607 Posts
user info
edit post

its called memory segmentation you pedantic buffoon

get out of here

2/4/2009 10:19:56 PM

NeuseRvrRat
hello Mr. NSA!
35386 Posts
user info
edit post

goddamn take this shit to tech talk

2/4/2009 10:21:25 PM

kiljadn
All American
44698 Posts
user info
edit post

in a nerdfight, my money's on scudzy


just fyi.

2/4/2009 10:34:17 PM

WolfAce
All American
6458 Posts
user info
edit post

this thread is full of awesome

2/4/2009 10:42:07 PM

bbehe
Burn it all down.
18519 Posts
user info
edit post

C++ for You++

The name of my AP Comp Sci text book.

2/4/2009 11:06:14 PM

Tiberius
Suspended
7607 Posts
user info
edit post

and there's a reason you're a User Experience Designer and nowhere near a Unix system, kiljadn

the standard libc string functions operate on null-terminated strings because with memory segmentation (hardware accelerated range checking, if you will), the reality that with overwhelming probability any unterminated string will be terminated by some other null byte, and the fact that disks are not even memory mapped, it's not necessary to have a range value to insure safe operation nor is there any risk of formatting a disk

scud is so far from anything resembling reality it's comical

Earlier Java implementations owe their sluggishness in part to the excessive range-checking. Fortunately (and the reason I no longer despise Java) run-time optimization and the unrolling of function calls in later implementations has given with the other hand.

[Edited on February 4, 2009 at 11:26 PM. Reason : .]

2/4/2009 11:19:53 PM

moron
All American
34912 Posts
user info
edit post

^ I'm pretty sure he was mostly being facetious.

And I bet there is someone out there who would use a function like that and find a way to format a drive.

People can do some weird things sometimes...

2/4/2009 11:40:26 PM

Tiberius
Suspended
7607 Posts
user info
edit post

I'd buy that it was facetious if he hadn't responded twice with completely inane comments and then quit responding

2/4/2009 11:48:01 PM

Big Business
Suspended
9099 Posts
user info
edit post

i'll do your C++ homework
and i won't ask for anything in return

I'm Big Business and i approved this message.

2/4/2009 11:49:18 PM

dakota_man
All American
26584 Posts
user info
edit post

gdb <program name>
break <filename>:<line number>
run
p <variable name>
<profit>

2/4/2009 11:51:29 PM

evan
All American
27701 Posts
user info
edit post

lawl

how are you learning C++ without knowing what gdb is?

Quote :
"shell2 ~ # gdb /bin/echo
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) set args "WHATS GDB LOL"
(gdb) run
Starting program: /bin/echo "WHATS GDB LOL"
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
WHATS GDB LOL

Program exited normally.
(gdb)"


i completely lol'd. gg.

[Edited on February 4, 2009 at 11:58 PM. Reason : V the -g is mucho importante. otherwise gdb won't tell you much of anything useful.]

2/4/2009 11:54:27 PM

Tiberius
Suspended
7607 Posts
user info
edit post

1. g++ -g -o bin source.cpp

2.

ulimit -c unlimited

[wait for segmentation violation (LOL MEMORY SEGMENTATION)]
gdb <program> <core>
bt
frame <deepest frame in stack>
list
print <var>

3. profit

[Edited on February 4, 2009 at 11:57 PM. Reason : baited into being helpful lulz]

2/4/2009 11:55:26 PM

dakota_man
All American
26584 Posts
user info
edit post

when I was at state they didn't really teach us how to use it... maybe how to run it until your program segfaults and find the line number/stack trace, but nothing really useful.

2/4/2009 11:55:58 PM

evan
All American
27701 Posts
user info
edit post

also

Quote :
"the standard libc string functions operate on null-terminated strings because with memory segmentation (hardware accelerated range checking, if you will), the reality that with overwhelming probability any unterminated string will be terminated by some other null byte, and the fact that disks are not even memory mapped, it's not necessary to have a range value to insure safe operation nor is there any risk of formatting a disk

scud is so far from anything resembling reality it's comical

Earlier Java implementations owe their sluggishness in part to the excessive range-checking. Fortunately (and the reason I no longer despise Java) run-time optimization and the unrolling of function calls in later implementations has given with the other hand."


i knew there was a reason i loved you, tiberius.
i just discovered that reason.

2/4/2009 11:57:16 PM

Shadowrunner
All American
18332 Posts
user info
edit post

Quote :
"its called memory segmentation you pedantic buffoon"


this shit

this shit right here

is why nerdfights are hilarious

2/4/2009 11:59:17 PM

evan
All American
27701 Posts
user info
edit post



it may be from eight years ago
but that doesn't change the fact it's gayer than i am.

2/5/2009 12:00:17 AM

scud
All American
10804 Posts
user info
edit post

step 1 get that stick out of your ass because I was just fucking playin' and you made it serious
step 2 get ready for pwnage because here are the facts:

*First of all the phrase "reformat your harddrive" is a very famous and commonly used maxim to refer to behavior undefined by the C++ specification that conveys both a levity and a gravity to what exactly undefined means. Clearly it doesn't indicate that undefined behavior will reformat your drive...merely the the behavior is undefined and the universe of possibilities is wide open.
It's mentioned several times by Meyers in Effective C++ and can also be found in Sutter's Exceptional C++ which are both must reads if you ever intend to practice C++ in industry.
Believe it or not I've seen white papers that go out of their way to prove that it IS possible.

* As any decent C++ programmer should know - dereferencing an uninitialized, null, or otherwise invalid pointer produces undefined behavior
http://everything2.com/e2node/undefined%2520behavior
* The standard libc functions aren't C++, they are C - that being said the non 'n' functions have been effectively deprecated for nearly a decade9 because they are so notoriously unsafe.
http://msdn.microsoft.com/en-us/library/kk6xf663(VS.80).aspx
http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=130850
http://www.courtesan.com/todd/papers/strlcpy.html
http://udel.edu/~pconrad/UnixAtUD/strcpy.html
http://en.wikipedia.org/wiki/Strcpy

* Oh yeah and to top it off, your shitty strcpy will completely choke on UTF-16/Latin-1 which happens to be the native encoding on modern Windows systems.

[Edited on February 5, 2009 at 12:02 AM. Reason : markup]

2/5/2009 12:01:18 AM

evan
All American
27701 Posts
user info
edit post

^memcpy

2/5/2009 12:04:48 AM

Shadowrunner
All American
18332 Posts
user info
edit post

oh nice, the ol' "pull out a random pic from someone's own photo gallery trick," that's never been done before.

but the fact that you would do it in response to a post that's not even an attack on anyone, much less directed at you, means you must really think i'm special. i'm flattered. and only a minute after my post... were you just waiting for me to post something so you could finally make your retort from another thread?

either way, if that pic makes me gay, i guess i'm as comfortable with my gayness as you are with yours, so good day, sir.

2/5/2009 12:06:57 AM

evan
All American
27701 Posts
user info
edit post

Quote :
"were you just waiting for me to post something so you could finally make your retort from another thread?"


bingo

[Edited on February 5, 2009 at 12:08 AM. Reason : i don't think you quite understand how chit chat the internet works]

2/5/2009 12:07:41 AM

Shadowrunner
All American
18332 Posts
user info
edit post

can i post this one too? i think it really accentuates my gay side.

2/5/2009 12:08:34 AM

evan
All American
27701 Posts
user info
edit post

even better.

but it needs moar purple hair.

[Edited on February 5, 2009 at 12:09 AM. Reason : PS ITS NOT AS FUNNY WHEN YOU TROLL YOURSELF ]

2/5/2009 12:09:12 AM

scud
All American
10804 Posts
user info
edit post

nice boobs

2/5/2009 12:09:25 AM

Big Business
Suspended
9099 Posts
user info
edit post

just get dev-c++

I'm Big Business and i approved this message.

2/5/2009 12:10:09 AM

evan
All American
27701 Posts
user info
edit post

i think we can all agree that java is the worst abomination of a programming language ever known to man.

amirite?

2/5/2009 12:14:06 AM

Shadowrunner
All American
18332 Posts
user info
edit post

Quote :
"i don't think you quite understand how chit chat the internet works"


sorry, i guess i'm used to having more of a bit player role around here. start giving me attention and following me from one thread to another, and i don't even know how to react!


^^^ thanks, i thought they turned out pretty well. it looks like i might have gotten some lipstick smeared on my teefs, though, and that's a big faux pas.

[Edited on February 5, 2009 at 12:14 AM. Reason : ]

2/5/2009 12:14:14 AM

joe_schmoe
All American
18758 Posts
user info
edit post

Quote :
"ROBE

AND

WIZARD HAT"

2/5/2009 12:16:00 AM

Tiberius
Suspended
7607 Posts
user info
edit post

oh god, he's pissed

Quote :
"* The standard libc functions aren't C++, they are C"


C++ is a superset of C. Aside from externs and globals, there is no substantial difference. All C is valid C++, get over it.

Quote :
" - that being said the non 'n' functions have been effectively deprecated for nearly a decade because they are so notoriously unsafe."


thunder linux # pwd
/usr/src/linux
thunder linux # grep --recursive strncpy * | wc -l
864
thunder linux # grep --recursive strcpy * | wc -l
2543

Shut. The. Fuck. Up.

Quote :
"* Oh yeah and to top it off, your shitty strcpy will completely choke on UTF-16/Latin-1 which happens to be the native encoding on modern Windows systems."


char *strcpy(char *dest, const char *src); -- your own Wiki link

char is typedefed to the native character type of the platform. It won't choke, unless you specifically pass a wchar_t* into a function with a char* signature like a dumbass. If it offends you so much you can template it or overload it.

I've TA'd a C++ class and been writing C/C++ for over 10 years without ever encountering the "reformat your harddrive" jargon, and relied more on experimentation than texts to learn the language, but I'll permit that it's an amusing exaggeration of the possibilities on platforms that do not implement proper memory segmentation.

I'm not reading the rest of the links because you just seem generally butthurt at this point.

[Edited on February 5, 2009 at 12:24 AM. Reason : .]

2/5/2009 12:16:31 AM

 Message Boards » Chit Chat » I f**king hate C++ Page [1] 2, Next  
go to top | |
Admin Options : move topic | lock topic

© 2025 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.