Comments (4)
Hi @benhar-dev,
Thank you very much for your reply. I open this issue waaaaay too early. After I open the issue, I started to read what was in the src folder. And only then I finally got the whole concept of this project.
You are clearly a step above where my team needs to go. Now we have duplicated code everywhere, early days code convention, etc...
Thank you for this amazing project, I hope I can give it a try in a next future.
from mobject-io.
Ok, the more I read your documentation the more I understand where you will go with this project. This issue is irrelevant since you are thinking about to do something special with the CyclicCall method.
from mobject-io.
Hi @GISED-Link,
Thank you for your comments on here, it is much appreciated!
I totally agree with you with how nice code looks when you get in to OOP, and for many years I used a combination of FB style and CLASS in exactly the same way you describe. With this style you will make your programs more readable and it makes code writing easier. I coded this way for so long because it works.
The problem I started to face is that I was applying OOP to more and more machines and projects, and as such I found that I was finding cyclic calling to be an issue. In a machine it was not as obvious, but when I was coding projects which handled communication and request / response was writing myself in to a corner.
Almost everything with IO needs cyclic calling, but also things such as timers. If I passed a cyclic object in to another object which was non-cyclic then I shouldn't force the non-cyclic object to know or care to call the cyclic object. This placed my cyclic call on the outside. Still, totally fine and this can be done as most of the time your IO is static, so you know you need to call a motor or lamp.
Then the big problem hit. I wanted to use __New to make something which was cyclic. What was worse was that the thing that created it was non-cyclic. Hence Mobject was born. Any objects can be cyclic, and can also automatically be called forever, or until they complete. This allows me to make things like asynchronous commands, which only exist for a short period, but still need "updating" each cycle to do their job. To be able to manage such a thing I needed to fully embrace OOP and remove the non-oop parts from my code.
The examples on Mobject do not do a good job of conveying this problem/solution, as if you do not make things with __NEW then it's not obvious that this problem exsists. FB style or CLASS with the call on the outside is totally fine. As soon as you use __NEW you run head long in to the problem I had.
I hope you like the work and I'm always keen to know peoples ideas and comments. Plus I hope Mobject works for you as and when you need something cyclic called when you __NEW it up.
Happy coding!
Ben - Coding bytes
https://codingbytes.teachable.com/p/codingbytes_twincat3
from mobject-io.
Sounds good and thanks again! I'll be making more OOP videos soon on CodingBytes so hopefully these will help too.
from mobject-io.
Related Issues (7)
- Add AsyncCommands to the documentation
- Add helpers and examples of using objects in GVLs
- Show an example in the documentation showing that even __new cyclic objects auto cycle as soon as they are made
- cyclic call happens via index and not via enumerator HOT 1
- mobject-json - cycle time HOT 1
- Read Me: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobject-io.