South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
http://www.intercom.co.cr/internet/research/1996/0305.htmCool an example then?
Don't know in which alternate universe you're living buddy.Give up whilst you can because you ignorance is being exposed by semaphore.
http://www.intercom.co.cr/internet/research/1996/0305.htm
That is version 2. Version 1 was released in December 1994 already.
var express = require('express');
var app = express();
app.use(express.logger());
app.get('/', function(request, response) {
response.send('Hello World!');
});
var port = process.env.PORT || 5000;
app.listen(port, function() {
console.log("Listening on " + port);
});
You really want to go there?
No not the same. In C++ you do not set it. It's automatically tied to the function for you and except in the case of virtual functions is not kept in the class.
OMG can't believe you're this clueless. -> has nothing to do with member pointers or virtual functions. It dereferences a pointer to an object and not pointers in objects. For that you have to use either .* or ->*
They aren't. You have to explicitly feed it the object where OOP automatically feeds a pointer to it.
C doesn't support inheritance. Do you even know what that is?
Yes you have to manually set (update) it. More opportunity for error.
Get this is your head, C doesn't have an OO syntax because it has no support for OOP. Yes OOP is a paradigm and C doesn't support that paradigm. You can shout from the rooftops and keep waving your arms that it does but the world disagrees with YOU. What you are using is just procedural programming and by the sound of it a very ugly version of it that leaves ample room for errors.
So you're telling me that emulating OOP to get the desired outcome of OOP and functionality of OOP paradigm is not OOP? Okay then...It may not be native.
You can't emulate it. You are not getting the desired outcome because it's more than just the program achieving what's required. It's supposed to be thinking in terms of objects and not mere procedures that can easily lead to common errors. There is no non-native. If it's not native it's just procedural programming.
You really are just grasping for straws you know that.
You have to be trolling me, if so good play, if not you're a moron of note and should be taken into a field and put down.
Please do research before making comments like that.
Or comments like yours, server-side JavaScript is still in its infancy just like a number of "modern" languages such as ruby. The fact remains that many large corporates have only moved recently started moving away from ancient languages such as C and Cobol to languages such as Java and C#. There reasoning is potentially archaic, but sound, stability, performance are just as important as flexibility. To counter your server-side JavaScript further is the fact that many of the solutions compile javascript to java code, this adds the addition layer on the run stack, this is the same issue java has in comparison to C, resulting in it never really matching in performance.
Double the requests per second vs. the Java application. This is even more interesting because our initial performance results were using a single core for the node.js application compared to five cores in Java. We expect to increase this divide further.
35% decrease in the average response time for the same page.
This resulted in the pages being served 200ms faster— something users will definitely notice.
or even on a frikken white board (which incidentally also doesn't have support for OO).
This gives a general idea of what is usually present in OOP http://en.wikipedia.org/wiki/Object-oriented_programming#Fundamental_features_and_concepts
C is missing almost all of those.
And that sums up your style of reasoning™. Nice shifting the goalposts. Really, the laughs you are giving us have been quite entertaining but I think you should give it up now.Yep, this pretty much sums up your intelligence with a nice little bow. That is a freaken webserver, it does not allow you to write full blown services in javascript, and then run by itself or control all incoming requests by itself.
Questionable education? Really? You haven't given the first indication that you know what you're talking about. And you didn't seem to really get my intended meaning either.No - I really want to avoid going there - it appears to provide questionable education. Hence my question.
In C++ it IS automatically tied to it. That's the fact that you do not get. In C you have to do it all manually giving much more room for error. That's because it's not OOP no matter how much you shout and wave your hands that it is.It's not automatically tied to the function for you, you have to specify the class type when you instantiate it. Are you objecting to the fact that you can't just go "new ClassA(...)", but instead have to do a malloc and an additional pointer table assignment? That's merely a syntactic difference that can easily be wrapped up behind a function called say new_ClassA(...), which is the recommendation anyway, since you generally want it to run a constructor too. You can even tie the table and function name together with a macro, so that you never accidentally assign the wrong table. Saying something isn't OO because of an assignment on init is asinine.
"->" has nothing to do with function pointers or member pointers or whatever else you think it does. You can just as easily use "." if you have a direct object so your comment of not liking it makes no sense. -> is used to dereference the object itself so if you have obj->member where obj is a pointer to an object it will lookup the member where obj points to instead of in obj itself.Wow - ok, Sunshine - apparently you missed C++ 101: When you call "a->b(...)" in C++, where b is a virtual method, it dereferences the pointer in the VTable (or a direct pointer in the object of a depending on compiler implementation) in order to invoke it. In C and C++, "a->c(...)", where c is a function pointer, dereferences the function pointer and invokes the function. The same goes if it is a stack reference with "a.b(...)" and "a.c(...)".
The ".*" and "->*" notation is used to dereference and invoke method pointers, which I have not yet mentioned at all.
Syntax is a very big deal. OOP is designed to shield from these explicit declarations and selections. You can wrap it up in functions all you want - are you going to have an obscurely named function for every method of every object? But the fact remains that it isn't tied to the function in the way you think it is and in the case of virtual functions your syntax is still going to involveSince this went over your head: It's not automatic.
In C++:
"obj->myMethod(param1, param2)"
In C the method interface would look like this:
"myMethod(obj, param1, param2)"
It's just in a different place. Syntax, not semantics.
If you're calling the method from within a class method:
in C: myMethod(obj, param1, param2), then yes, here, in C++ the passing of obj (as "this") is implicit. Big deal - a hidden parameter doesn't make it OO - methods could implictly pass obj using a macro wrapper when they're invoked, but it's generally just not worth it.
You still haven't explained how you're going to do it. Declare a base class as a member of the object? That isn't inheritance. I also think you are misusing Stroustrup view to support your own:C doesn't support inheritance, but that doesn't mean the language doesn't enable you to do it (I'm paraphrasing Stroustrup here, BTW). What exactly do you think is missing? With the table in inclusion scheme, I outlined you get code reuse, you can have code that operates on the base class, operate on derived classes, and call derived methods when overriden, or base methods when not. Also, it is possible for native base class code to access base class attributes of derived objects. What do you think inheritance is? A magical set of keywords, that isn't mandated in any definition of OOP?
You are not setting it once off like when you declare a derived class. You are setting it every time you create an object. Sure you can have it contained in a function but it doesn't change the principle and you still haven't explained how you're going to implement inheritance.I asked why, apart from the init you have to set it, and you tell me: Yes you have to set it. Trying to parse past the caveman antics, are you saying (again) that manually setting a pointer once off during init means that it's not OO? That's absurd (yes, and still asinine).
Here's what you don't get: It's not my inability to think in the abstract. I can do it in procedural code instead of OOP. But it still remains procedural programming because you're thinking in terms of the procedures and how to implement them instead of the objects themselves as you've illustrated. That is the defining factor.Here's the thing: I can think in OO terms when I reason about OO design - in C++, C, Java, C# or even on a frikken white board (which incidentally also doesn't have support for OO). In fact it's really not that difficult, and many people do it all the time. I get that you don't agree with this - that's not a limitation of C, but rather of your ability to think in the abstract.
That says it all, a dislike for C++."You can write object-oriented code (useful for filesystems etc) in C, _without_ the crap that is C++.” - Linus Torvalds
Huh?OOP is a link to wiki![]()
Really, the laughs you are giving us have been quite entertaining but I think you should give it up now.
And that sums up your style of reasoning™. Nice shifting the goalposts. Really, the laughs you are giving us have been quite entertaining but I think you should give it up now.
Questionable education? Really? You haven't given the first indication that you know what you're talking about. And you didn't seem to really get my intended meaning either.
In C++ it IS automatically tied to it. That's the fact that you do not get. In C you have to do it all manually giving much more room for error. That's because it's not OOP no matter how much you shout and wave your hands that it is.
"->" has nothing to do with function pointers or member pointers or whatever else you think it does. You can just as easily use "." if you have a direct object so your comment of not liking it makes no sense.
cguy said:The same goes if it is a stack reference with "a.b(...)" and "a.c(...)".
Dereferencing a virtual function happens automatically whether you use "->" or "." where in C you have to explicitly dereference it using either "->*" or ".*". Talk about missing C++ 101.
Syntax is a very big deal. OOP is designed to shield from these explicit declarations and selections.
You can wrap it up in functions all you want - are you going to have an obscurely named function for every method of every object?
But the fact remains that it isn't tied to the function in the way you think it is and in the case of virtual functions your syntax is still going to involve
obj.vfunction(&obj)
at some point instead of
obj.vfunction()
Macros are ugly. They are not type-safe. That's why C++ has moved as much of its reliance on the preprocessor to the language itself. You are circumventing everything that OOP is designed to shield you from.
You still haven't explained how you're going to do it. Declare a base class as a member of the object? That isn't inheritance.
I also think you are misusing Stroustrup view to support your own:
"A language or technique is objectoriented if and only if it directly supports:
[1] Abstraction
[2] Inheritance
[3] Runtime polymorphism
This definition includes all major languages commonly referred to as objectoriented: Ada95, Beta, C++, CLOS, Eiffel, Simula, Smalltalk, and many other languages fit this definition. Classical programming languages without classes, such as C, Fortran4, and Pascal, are excluded."
http://www.stroustrup.com/oopsla.pdf
Here's what you don't get: It's not my inability to think in the abstract. I can do it in procedural code instead of OOP. But it still remains procedural programming because you're thinking in terms of the procedures and how to implement them instead of the objects themselves as you've illustrated. That is the defining factor.
That says it all, a dislike for C++.
Yes shifting the goalposts. Ever heard the phrase? It doesn't matter whether it's standalone or not. That isn't the criteria. It was whether or not it's been used server side. And it has although not a lot. I bring up an implementation from '94 to show that it has been for almost 2 decades. Funny you'll refer to the ANC's counter arguments when yours aren't any better.Shifting the goal posts? You come up with some piece of web server software from the mid 90's and claim its production server side JS, which its not. If you're going to try and come across like you know something at least back it up. Your counter arguments are about as good as the ANC's.
Neither he nor you happen to be able to show it.And as for cguy he is vastly more educated than you i can pretty much guarantee that, actually i think most people here are.
If you're referring to hiding the "." or "->" you're entirely missing the point. I'm assuming you're still referring to virtual functions. In which case you still have obj.method(&obj).You think? I was referring to obj->method(obj, param1, param2) vs. method(obj, param1, param2). obj.method(&obj, param1, param2) is equivalent to the -> notation in this context, I didn't say it wasn't.
Right they don't so you'll have to use the equivalent of *a.b. To use a function pointer (virtual function) you still have to dereference it. Technically you don't need to use "*" as the parenthesis is already a dereference but the point is still the same. Circumventing it with a standalone function simply displaces it somewhere else.No, you don't need those operators to get the equivalent behavior in C, and ... they don't exist in C. Thanks for the lesson.
They are designed as such because that's one of the purposes of OOP.Sigh. No, those are just what OO languages are designed to do.
The only syntax you've given is wrapping up the problem in a function which as I already explained doesn't actually remove it. Really, I'm not the one that's behind.No, I've already given the alternate syntax, and macro type safety isn't a concern here, given the way they would be used. It's like you're always a few posts behind or something.
No you haven't explained it. And just fyi all the online literature I've seen either say there is no inheritance or use the base class as a member method.I have explained it, and I've also explained that you don't need to declare a base class as a member of the object. Since you're a little slow on the uptake just read some of the online literature about this - I'm not paid to hand hold you through this.
No you don't seem to agree with it because it excludes your view. In case you missed the bolded it mentions C as not being object oriented and that would go with anything you use it with. You seem to be stuck in the mindset that if you can implement the same functionality it must be object oriented. After I've explained over and over that it isn't about the functionality but the approach to it. Yours is procedural and that isn't going to change. Really man, the only two people interested in my background are you and your fanboy semaphore after losing the debate.I agree with this, and it is compatible with my view, and the view of those that write OO C code. It's also compatible with the view of all of those people that do OO design on non-Object Oriented whiteboards. The reason you can't seem to understand this, is because you're in a whole other head space - which is why people are curious about your background. It's like there's a battle between two colors: red and blue. I'm shouting, "Blue is the best!", and you're shouting "Go cheeseburger!".
You've shown that you aren't thinking in terms of objects but rather how you write the procedures that access those objects. That's what disqualifies it from being object oriented. I'm using the term object very loosely here btw.No that is something you do. I am quite able to write procedural code and think about my structures as objects, and functions as methods. Similarly, I can write a linear piece of assembler, and use jump instructions, instead of call instructions and still think of my jump targets as procedures. Perhaps I'm just awesome that way.
From the quote you gave it's very evident he doesn't like the language so the bias in this case is relevant.Non-sequitur.
Yes shifting the goalposts. Ever heard the phrase? It doesn't matter whether it's standalone or not. That isn't the criteria. It was whether or not it's been used server side. And it has although not a lot. I bring up an implementation from '94 to show that it has been for almost 2 decades. Funny you'll refer to the ANC's counter arguments when yours aren't any better.
Neither he nor you happen to be able to show it.
If you're referring to hiding the "." or "->" you're entirely missing the point. I'm assuming you're still referring to virtual functions. In which case you still have obj.method(&obj).
Right they don't so you'll have to use the equivalent of *a.b. To use a function pointer (virtual function) you still have to dereference it. Technically you don't need to use "*" as the parenthesis is already a dereference but the point is still the same. Circumventing it with a standalone function simply displaces it somewhere else.
They are designed as such because that's one of the purposes of OOP.
The only syntax you've given is wrapping up the problem in a function which as I already explained doesn't actually remove it. Really, I'm not the one that's behind.
No you haven't explained it. And just fyi all the online literature I've seen either say there is no inheritance or use the base class as a member method.
No you don't seem to agree with it because it excludes your view. In case you missed the bolded it mentions C as not being object oriented and that would go with anything you use it with. You seem to be stuck in the mindset that if you can implement the same functionality it must be object oriented. After I've explained over and over that it isn't about the functionality but the approach to it. Yours is procedural and that isn't going to change. Really man, the only two people interested in my background are you and your fanboy semaphore after losing the debate.
You've shown that you aren't thinking in terms of objects but rather how you write the procedures that access those objects. That's what disqualifies it from being object oriented. I'm using the term object very loosely here btw.
From the quote you gave it's very evident he doesn't like the language so the bias in this case is relevant.
BTW, Hamster also wants to know what and where you studied.
I don't expect an answer (probably some student). He/she avoided all the direct questions before that as well.
Yes shifting the goalposts. Ever heard the phrase? It doesn't matter whether it's standalone or not. That isn't the criteria. It was whether or not it's been used server side. And it has although not a lot. I bring up an implementation from '94 to show that it has been for almost 2 decades. Funny you'll refer to the ANC's counter arguments when yours aren't any better.

But why the fark will someone in their right mind do that on a platform that offer true OOP tools?
So in exploring the Linux Kernel code we have found that even though it is not written in an object-oriented language, it certainly contains objects, classes (represented as vtables), and even mixins. It also contains concepts not normally found in object-oriented languages such as delegating object methods to a "parent" object.