Thread: Extension Question
-
November 28th, 2016, 16:34 #11
The other thing to keep in mind with replacing global package functions is that they run outside of the global package. So if the base package has a number of non-public package variables defined as "local" in the package LUA file outside of functions, the replaced function won't have access to these. Thus meaning that it's not always possible to replace an individual function in a global package, as these local package variables can't be accessed without changing the base package, which defeats he objects of overriding package functions. So keep this in mind when looking at overriding a global package function.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 28th, 2016, 23:19 #12
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Man, this has engendered some great discussions. All great things to think about, and when Dulux makes his video, he will have another excuse for a shameless plug.
-
November 28th, 2016, 23:20 #13
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Perhaps packages should have a standard set of get... set... functions to provide overriders access to package locals (or at least the ones that have a conceivable usage by overriders).
-
November 28th, 2016, 23:23 #14Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 28th, 2016, 23:29 #15
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
True, Trenloe, but one of the precepts of object-oriented programming, which we are trying to emulate here is that data is encapsulated where manipulated, and, for those who are believers in this programming concept (and I'm not sure I'm really there yet, but I'm starting to come around), the get... set... is more pure to the concept (and lessens possibility of name collisions when people attempt to use the same name out of ignorance of the name's existence somewhere else).
-
November 28th, 2016, 23:47 #16
I don't think there is any specific programming methodology being adhered to 100% by anyone here. Nor is one (OOP, FOP, RAD, etc.) being touted over the other. I do not subscribe to your suggestion that developers should be made to do a lot more coding to try to fit to a concept that the majority of community developers on this forum would never adhere to. Are you seriously suggesting that developers should go to the hassle of creating get/set functions for each local variable just in case someone might want to access a local variable - purely as a good-practice-programming-concept?
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 29th, 2016, 00:29 #17
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Well, when you put it that way....
-
November 29th, 2016, 00:57 #18
Dulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
November 29th, 2016, 01:07 #19
Actually, I tend to try to code as OOP & RAD, and there is something to be said about having some "coding standards" in place that everyone "should" follow - I'm thinking about the various Linux-coding standards that most distros follow and which the Linux-coding community generally adhere too - because having a "framework" of standards (even informal ones) and encouraging people to use that framework helps everybody - but I can also see Trenloe's point in that getting coders to do anything the same way as each other is like herding cats, and getting Community/volunteer coders to do it is like herding saber-toothed tigers!
Still, it might be worth considering and having a discussion about this between the Devs and Community Devs - if we can get the majority of the tigers to at least walk in the same general direction then we'll start to see the benefits of doing so sooner rather than later - just like the Linux-coders have and just like a plethora of other Open Source and Community-driven/supported projects have.
Just a thought
CheersDulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks