View Single Post
Old 10-23-2019, 07:41 AM   #341
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
Originally Posted by TonE View Post
The main idea of a script should be understandable at first look, not looking like a cryptical task, splitting the main task into sub functions.
I disagree: the main idea of a script is to provide the functionality in the first place.
Subfunctions can be very helpful with that, as you can split the work into individual tasks.
You can, however, try to make that stuff as easy to read as possible, by naming functions clearly, so you can see right away, what a certain function does.
So a main-function just calls the functions needed and their names tell you, what they are supposed to do.

But: what that "easy to read" means, is an individual thing. I try to name all my US-API-functions as clearly as possible, so reading the code is also like reading its description. But I have no idea, whether I succeeded in it at all, as others may have another idea of readability and find my naming-scheme confusing.

It's complicated and you can just try to make it as good as possible.

Another thing is, that maybe we need a better collection of tutorial-scripts, who are written to be understandeable in the first place, including extensive-descriptive-comments. But this isn't as easy as it may sound, as you need to find easy words for complicated tasks and this takes time to do correctly.
MPL's scripts are probably not written as example-scripts but more written as efficient as possible, so he can get the stuff working and as maintainable as possible for him.

It's complicated.

BTW: If you get your CSV-stuff working, I would be happy to include it into the Ultraschall-API officially. Sounds like a really helpful feature in the first place.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote