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

C++ vs Java vs Python vs Perl vs Flash

Name: Anonymous 2011-06-12 9:45

Which is best????

Name: Anonymous 2011-06-12 13:00

[b][i]NOTHING IS AS [o]FAST[o/] AS C[/i][/b]

Name: Anonymous 2011-06-12 13:01

>>39
Where does it say a pointer yields a value which is an address. It doesn't say that, it says that the address-of operator, &, yields the address of it's operand. A pointer does not yield an address, a pointer is an address. You don't seem to know anything, you keep bending definitions to fit your lies.

Name: Anonymous 2011-06-12 13:02

>>40
Do you live near Berkeley, CA? If so, I'll be up in my cubicle at Kodak Gallery in Emeryville, CA this monday morning around 7am.  If you want, you can come up here and I can school your monkey ass on computer programming.

Name: Anonymous 2011-06-12 13:05

>>42
Where does it say a pointer yields a value which is an address

My whole issue was you using the word 'bounds'.

A pointer does not yield an address, a pointer is an address

What if I have

char *foo:

Now I compile this code. What's the address in this case?

Name: Anonymous 2011-06-12 13:07

>>44
And just for clarification, I just compile it. I don't actually run this piece of code. Why would I want to do this? Maybe because this piece of code is part of a really large project.

Name: Anonymous 2011-06-12 13:08

>>43
I'm afraid not, but I wish I did so maybe you could give me a job.

Name: Anonymous 2011-06-12 13:09

>>44
It's undefined.

Name: Anonymous 2011-06-12 13:09

use the right tool for every job: python

Name: Anonymous 2011-06-12 13:10

>>44
Okay, sorry, I was wrong. I concede defeat.

Name: Anonymous 2011-06-12 13:12

>>47
It's undefined.

No. It will pass the compilation phase.

Name: Anonymous 2011-06-12 13:14

>>50
To clarify, whilst the program itself will compile, the result of execution is undefined behavior.

Name: Anonymous 2011-06-12 13:15

>>50
*((void*)0); does too.

Name: Anonymous 2011-06-12 13:16

>>51
But the point being, a pointer isn't an address. If it was, then it would never pass the compilation phase because the compiler would be expecting a value that can only be produced at runtime.

Name: Anonymous 2011-06-12 13:17

>>53
And I just know this because I've written a few crude compilers/linkers for Kodak.

Name: Anonymous 2011-06-12 13:21

>>54
Didn't save Kodak from their dying business model.

Name: Anonymous 2011-06-12 13:24

>>53

int& a = reinterpret_cast<int&>((void*)0);


That compiles in C++.

Name: Anonymous 2011-06-12 13:29

>>56
Okay, I'm not versed on C++. But I'm going to take a wild guess and that this something similar to what Java does. At compile time, the compiler will mark/flag this as a declared type. However, the actual type, which might be different, isn't known until run time. Am I close?

Name: Anonymous 2011-06-12 13:30

are you people fucking retarded

Name: Anonymous 2011-06-12 13:31

*and say that this is something similar to what Java does*

Name: Anonymous 2011-06-12 13:32

>>58
Are you jewish?

Name: Anonymous 2011-06-12 13:35

>>60
No. Also, capitalize the word Jewish you fucking nigger Nazi.

Name: Anonymous 2011-06-12 13:39

>>57
Nope, the type is determined at compile time. The type of a is a ``reference'' to ``int'', and it's bound to a null address. In fact, that must be where I'm getting the terminology for using "bound", as the C++ language specification actually uses that nomenclature. I was wrong when I thought C did the same, sorry. Attempting to access ``a'' will result in undefined behavior during execution, just as dereferencing a null pointer would in C.

Name: Anonymous 2011-06-12 13:45

>>62
Nope, the type is determined at compile time

In Java, this is sometimes called a 'declared type'. I don't know about C++, but the reason why Java makes this distinction is because the language supports this load of shit known as dynamic binding.

Name: Anonymous 2011-06-12 13:49

Now let's wait for the homos from the Lisp camp professing how their loser language is a lot superior and then tell us how we should read SICP.

Name: Anonymous 2011-06-12 13:52

I wish this thread never happened.

Name: Anonymous 2011-06-12 13:52

I just read the last 50 posts of this shit and I hate you all.  How the fuck do you get by with such a poor understanding of…well, everything?

Name: Anonymous 2011-06-12 13:54

>>66
It can't be that fucking poor since I get paid a lot of money for being a code monkey.

Name: Anonymous 2011-06-12 13:54

>>63
Yeah, all non-fundamental/trivial types in Java are "reference types", but reference types in Java aren't the same as reference types in C++.

Java reference types are for compound objects that exist only on the garbage collected heap, an a can be assigned a null address/value explicitly. In a sense, they are semantically the same as pointers in C, just without additional syntax like * and ->.

C++ references can refer to fundamental/trivial objects anywhere in memory, whether they're on the stack, heap, or some other region of addressable memory. However, they must be explicitly bound to an actual object, you can't create reference that has an undefined address or null address unless you use some hacks like pointer-to-reference casts. They're primarily used for passing compound types by reference to functions, without requring * or -> syntax for dereferencing or accessing members.


struct foo { int a; int b; };
void bar(foo& f) { f.a = f.b * 3; }

// usually compiles down to equivalent machine code as is generated by the following:

void baz(foo* f) { f->a = f->b * 3; }

Name: Anonymous 2011-06-12 13:55

>>66
Average C++ programmers.

Name: Anonymous 2011-06-12 13:56

>>66
It's not that bad, at least people are familiar with perusing the actual language specifications instead of going off of second-hand knowledge passed on by word of mouth from the workplace or at school.

Name: Anonymous 2011-06-12 14:05

hi ever1 im autism!!!!!!! *autism* my autism is autism but u can call me t3h 4uTiSm oFaut1sM!!!!!!!!!!!! lol...as u can see im very AUTISM!!!!! thats why i came here, 2 meet AUTISTIC AUTISTS like me ^_^... im 13 years old (im autistic 4 my age tho!!) i like 2 watch autism video lectures w/ my autism (my autism is autistic if u dont like it deal w/it) its our autism!!! bcuz its SOOOO AUTISTIC!!!! hes autistic 2 of course but i want 2 meet more AUTISTIC AUTISTS =) like they say the more the more autistic!!!!!!
lol...neways i hope 2 make alot of autism here so give me lots of autism!!!!AUTIIIIIIIIIISM!!!!!!!!! <--- me bein AUTISTIC again ^_^ hehe..autism!!!!!

*~t3h 4uTiSm oFaut1sM~*

Name: Anonymous 2011-06-12 14:11

>>71
2/10

Name: Anonymous 2011-06-12 17:10

This thread is bad and everyone in it should feel bad.

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