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

Pages: 1-

oh dear-

Name: Anonymous 2009-03-26 13:04

pardon my ignorance but,
class user{
private $user_id;
private $user_name;
public function __construct($user_id) {
$this -> user_id=$user_id;
$this -> user_name = $result['username'];

what is '$this ->'

Name: Anonymous 2009-03-26 13:11

It subtracts > from $this.

Name: Anonymous 2009-03-26 13:13

The HMA operator, I advice you not to run that code.

Name: Anonymous 2009-03-26 13:18

>>1
You should listen to >>2. He clearly is an EXPERT PROGRAMMER.

Name: Anonymous 2009-03-26 13:32

$this -> user_id=$user_id;
It pisses me off to no end when people don't put a space between an operator and its operands.

Name: Anonymous 2009-03-26 13:34

>>1
What the fuck is this? Is that Haskell?

Name: Haskellite. 2009-03-26 13:40

>>6
Fuck you.

Name: Anonymous 2009-03-26 13:41

>>7

just for the record, it wasnt op

Name: Anonymous 2009-03-26 13:45

>>8
Just for the record, you're a fucktard.

Name: Anonymous 2009-03-26 13:48

>>9

just for the record, have you read your FUCK YOU today?

Name: Anonymous 2009-03-26 13:50

>>10

I have and I wasn't impressed.

Name: Anonymous 2009-03-26 13:52

Name: Anonymous 2009-03-26 14:12

>>12
Please fall into a bath filled with sulfuric acid that you are unable to get out.

Name: Anonymous 2009-03-26 14:23

>>13
Why? This thread was shit anyway

Name: Anonymous 2009-03-26 14:38

user

Name: Anonymous 2009-03-26 16:03

No seriously, what the hell language is that?
I've never seen such a monstrosity. Associative arrays, pointers, classes, and sigils?!

Name: Anonymous 2009-03-26 16:27

>>16
Rasmus Lerdorf is a GENIOUS!

Name: Anonymous 2009-03-26 17:26

>>1
This is PHP.
Regarding $this ->
$this is a predefined variable of every instance of any object in PHP and most OO languages will have something equivalent (cf "this" keyword in java etc..)

It simply behaves like a pointer to an object, namely itself; so you can treat it like a local variable of whatever type the class is; that contains a reference to itself.

Notice that all member variables of $this are the local varaibles of that object, variables of functions cannot be referenced by $this because they are not actual fields of the object but belong to the function call instead. Thus, a key usage for the $this variable is differentiating between two variables of the same name, where one is local to a method and one is a field of the object as is visible in your example. Sometimes in a poorly designed system $this can also be a quick hack to fix something that would of otherwise required a redesign; where there is a circular dependency and some created objects need to know what object instantiated them you could use Object obj = new Object(this)

Some languages will also allow the use of this() as a method/function. This esentially calls its own constructor as a method, and allows for overloaded constructors and other bits and peices. ex:
public class Jew {
    private int jewness;
    private ConcentrationCamp home;
    private boolean gassed;
    private Jew(ConcentrationCamp home, boolean gassed, int jewness) {
        this.home = home;
        this.gassed = gassed;
        this.jewness = jewness;
    }
    public Jew(boolean gassed) {
        this(ConcentrationCamp.AUSCHWITZ, gassed, 100);
    }
    public Jew() {
        this(true);
    }
}

Name: Anonymous 2009-03-26 17:26

>>17 POHAPE NI YOUKOSO

Name: Anonymous 2009-03-26 17:34

>>18
Neither PHP nor Java is an OO language.
EXPERT MIDDLE SCHOOL PROGRAMMING COURSE otherwise. You're part of the problem.

Name: Anonymous 2009-03-26 18:04

>>17
I met rasmus a couple of months back. pretty cool dude.

Name: Anonymous 2009-03-26 18:18

>>21
He looks exactly like I expected him to look: a meathead who looks like he'd sooner punch his monitor than figure out how a keyboard works.

Name: Anonymous 2009-03-26 20:38

>>20
Neither PHP nor Java is an OO language.
Oh god, what is then? Common Lisp for you I presume, perhaps sepples. How about you stop being an elitist faggot. While I might be partial to agreeing with you on PHP not being Object Oriented, trying to conject something similar for Java is just plain wrong. IHBT

Name: Anonymous 2009-03-26 20:47

>>23
Java seriously halfassed every bit of OO. int isn't an object, for example. You can't subclass it, you can't do shit with it. You have to use that stupidass Integer wrapper class and then write everything with fucking verbose function names because Java also doesn't have any sort of operator overriding.

Since half the fucking standard library has totally different methods for everything, and it's all halfassed shit, you can't e.g. pass a TCP connection to a method that's expecting something opened from a file stream and expect it to work sanely. In order to do anything like that you usually have to write a bunch of fucking wrapper classes on top of the standard library to make up for the fact that it sucks dicks.

Try using a proper OO language some time and you'll notice that it's actually not completely hellish to work with. Until then, shut the fuck up about Java being OO, because it's not, it's a pile of monkey shit.

Name: Anonymous 2009-03-26 20:48

Oh, and C++ isn't fucking OO either, it's just badly duct-taped-together half-OO shit.

Name: Anonymous 2009-03-26 20:51

>>24
>>25
That was a very interesting troll to read, however I think you forgot to take something into account. How easy it is to use a language has no effect on, and is not effected by whether or not it is Object Oriented.

Name: Anonymous 2009-03-26 21:00

>>26
Yes, C is a very easy language to use. However, you're sidestepping the issue, which is that Java's OO is seriously fucking retarded and crippled.

Name: Anonymous 2009-03-26 21:03

>>27
Not at all. The issue was that you believed Java was not an Object Oriented language. I corrected your mistake, and now you are trying to tell me that I am sidestepping "the issue" that Java is not a very good Object Oriented language. One lesson is enough for you today.

Name: Anonymous 2009-03-26 21:08

>>23
Your attempt at impersonating a /prog/ regular by using the (incorrectly uncapitalized) word ``Sepples'' falls flat on account of your mistaken belief that /prog/ has a hard-on for it, when in fact its dislike for it has been well-documented. I presume you were confused by the homework threads the /pr/ overflow has been creating.
Mistaking Common Lisp for Scheme didn't help either. All Lisps are not created equal.

To answer your question, though, Smalltalk is a decent example of an OO language. For a more mainstream one, Ruby is defensible.

>>26
Oh, look, you can't even quote properly. >>24 has a more coherent argument than you do, though it may be poorly delivered. It is undoubtedly true that the shittiness of Java's standard library is a result of its broken object model, and the way it has and handles primitives is a good example of why Java is not an OO language.
Java's broken model is an improvement if you're coming from even crappier languages like Sepples or, indeed, PHP, but once you've used a real OO language it becomes painfully apparent how incredibly broken it is.

Not that it would matter to you; you barely made it into the second semester of ``Software Engineering'' at your community college.

Name: Anonymous 2009-03-26 21:11

>>28
It is you who need lessons.

Name: Anonymous 2009-03-26 22:14

>>29
your mistaken belief that /prog/ has a hard-on for it [sepples] when in fact its dislike for it has been well-documented.
Ironic you would use this to show I am not a ``regular'' when in fact it has been well documented /prog/ is Tsundere for sepples.

Mistaking Common Lisp for Scheme didn't help either.
Just throw that in there to beef up your argument did you? Common Lisp is a perfect example of what elitist Object Oriented programmers use.

24 has a more coherent argument than you do
The mere fact it is coherent and possibly a good argument does nothing for the fact it is an ignoratio elenchi.

you barely made it into the second semester of ``Software Engineering'' at your community college.
Argumentum ad hominem, lovely. I'll tell you what- I can one up all of this:

You seem like Hitler and I bet you support killing Jews. Your argument is invalid.

Name: Anonymous 2009-03-26 22:25

>>31
1/10. Persisting in your ignorance would have been a nice touch in a successful troll, but your comment too obviously lacks substance.

Name: Anonymous 2009-03-26 22:28

>>24-33
Same person, and we have bean rolled constantly.

Name: Anonymous 2009-03-27 1:55

>>33
I think your analysis was incorrect. My estimates put us at being trolled in O(G^^^^n).

Name: Anonymous 2009-03-27 4:39

>>34
The second argument of ^ should be a number, not a function. Please fix your syntax errors before your next check-in.

Name: Anonymous 2009-03-27 9:33

hax my anus

Name: Anonymous 2009-08-16 23:50

Lain.

Name: Anonymous 2011-02-02 23:07


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