Difference between Private and Public on PAWN
#1

By seeing Public and Private functions, I guess there is a way for OOP. And if PAWN is not object oriented, why there is Private and Public?
Reply
#2

there isn't private, there's public and stock which I guess would be similar to private as other scripts can't access it but it's not the same as in OOP
Reply
#3

Quote:
Originally Posted by cessil
Посмотреть сообщение
there isn't private, there's public and stock which I guess would be similar to private as other scripts can't access it but it's not the same as in OOP
So, OOP is possible in PAWN?

Edit: There is Private keyboard.
Reply
#4

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
So, OOP is possible in PAWN?

Edit: There is Private keyboard.
No, object oriented programming isnt possible in PAWN. The best you can do is pseudo OOP through like macros. Please note that just because something highlights doesnt mean its a part of the language. There are far more "keywords" that highlight like "virtual", "explicit", "protected", etc. This is just because PAWNO uses C++ rules for highlighting.
Reply
#5

Quote:
Originally Posted by Kyosaur
Посмотреть сообщение
No, object oriented programming isnt possible in PAWN. The best you can do is pseudo OOP through like macros. Please note that just because something highlights doesnt mean its a part of the language. There are far more "keywords" that highlight like "virtual", "explicit", "protected", etc. This is just because PAWNO uses C++ rules for highlighting.
Thanks for sharing it. I did some research on implementing object oriented programming on PAWN watching some C Programming Language book. I am pretty sure it can be implemented. Not only OOP but keywords such as virtual, explicit, struct, protected, etc.
Reply
#6

Quote:
Originally Posted by T0pAz
Посмотреть сообщение
Thanks for sharing it. I did some research on implementing object oriented programming on PAWN watching some C Programming Language book. I am pretty sure it can be implemented. Not only OOP but keywords such as virtual, explicit, struct, protected, etc.
In order to implement it you'd have to explicitly change the language which is really out of the league of 98% of the people here. The same goes for those keywords, this is in no way an easy task at all (we're talking about adding an entirely new paradigm with advanced things like polymorphism after-all). At that point its like building an entirely new language!

The best you can really do is use macros to make a pseudo-OOP feel. Anyone who has real experience with the paradigm will never be satisfied with that though.

Edit: Also please note that C does not support object oriented programming. You can have object oriented programming concepts like polymorphism (which would be function pointers), and data encapsulation, but ultimately its not an OOP language.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)