Programming Paradigms
nicholasjames
Junior Member
If you asked me a week ago what programming paradigm I tried to follow, I'd probably answer, "Until it works", or more likely, "Until the error goes away." However, I've recently been discussing the different ways of handling general tasks in NetLinx and have been trying to solidify in my mind what my particular "style" is and, more importantly, how to explain it.
As far as a specific paradigms are concerned, I was only instructed on object-oriented programming during my java days. Though I learned through certification, and other AMX written code, how AMX prefers to handle certain concepts, there doesn't seem to be any specific technique they use.
To be honest, I've only recently been reading up on this subject and, let's be honest, it's been mostly on Wikipedia. So, as I get the ball rolling, I apologize if I use phrasing that no self-respecting computer scientist would. For example, on the subject of modules in general, I would describe them as code that does one simple thing (like talking to a display), blindly reporting out to whoever is listening, while blindly accepting commands from whoever happens to know their language. Want to put that info on a touch panel? Then make a new module that knows the same language and only reports to the touchpanel what the display module just said. See? Sounds more like I'm describing Lilliputians than elegant lines of code.
I've heard it said that programmers discussing their style of programming is akin to discussing politics and religion. I think some of the discussions I've read on this forum bear that out! Risky or not, I'd still love to discuss how you think about code and, if any, what technique (or mix thereof) you think works best for NetLinx.
As far as a specific paradigms are concerned, I was only instructed on object-oriented programming during my java days. Though I learned through certification, and other AMX written code, how AMX prefers to handle certain concepts, there doesn't seem to be any specific technique they use.
To be honest, I've only recently been reading up on this subject and, let's be honest, it's been mostly on Wikipedia. So, as I get the ball rolling, I apologize if I use phrasing that no self-respecting computer scientist would. For example, on the subject of modules in general, I would describe them as code that does one simple thing (like talking to a display), blindly reporting out to whoever is listening, while blindly accepting commands from whoever happens to know their language. Want to put that info on a touch panel? Then make a new module that knows the same language and only reports to the touchpanel what the display module just said. See? Sounds more like I'm describing Lilliputians than elegant lines of code.
I've heard it said that programmers discussing their style of programming is akin to discussing politics and religion. I think some of the discussions I've read on this forum bear that out! Risky or not, I'd still love to discuss how you think about code and, if any, what technique (or mix thereof) you think works best for NetLinx.
Comments
-
Netlinx event structure is mix of Behavior patterns, all wrapped up in a Module pattern. If you want to get serious about design patterns, look at the Design Patterns book produced by the Gang of Four.
It's much easier to use modern design patterns into Duet, mainly because you'll find a lot of Java examples of design patterns out there, and if you're unfamiliar with the purpose of the pattern you will find it difficult to translate into a netlinx-language equivalent. But roughly think of modules as objects(even though they are not) that can be instantiated. It's not quite 1:1, but it gets us far enough. -
I try to encapsulate my modules as much as possible to make them act like objects. It's doable to an extent, though at times not worth the trouble.
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums