What is Best
#1


Hello there,
So I was thinking what is the best method of scripting - modular or all in one file?

Reply
#2

Well, it depends.

Many of us find it better to make it whole. It can be more optimized and stable.
Reply
#3

Modular if you are experienced.
Semi-modular if you aint so experienced
All in one if you are starting off.
Reply
#4

There's no absolute best.

It would be waste of time to write a small FS modular, but for a complex gamemode a modular design has clear advantages (organization, multiple people working on it, dynamically enabling/disabling systems if done right, etc).

But even complex gamemodes can be done in one file, if you use a good editor which gives you some tools for organization (like jump to functions, "minimizing" whole sections (sorry I forgot the correct word for this) and so on).

It really depends on what you are doing and if you get any advantage from it. If it just complicates things for you (which can definitely happen if every module interacts with each other) it's probably not worth it.

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
All in one if you are starting off.
That's not really correct, if you learned to keep code clean and use a modern IDE there's absolutely nothing wrong to code a complex script in one file if it makes sense. It's just harder for someone who just started to script to write something modular. This isn't valid the other way round though.
Reply
#5

Modular - as in one file per specific system, not the separate file for enums, variables crap. It's easier to navigate, easier to edit, easier to find bugs, easier to disable specific feature, easier to work on a project with other people. Also if you're using VCS such as git, it will give you much better navigation through history (blame feature comes specifically to mind). Check out https://github.com/Southclaw/ScavengeSurvive , you can see neatly sorted modules. Clearer scoping and responsibility delegation (things such as global static variables, available only in the file you define them in).
Reply
#6

Modular programming in SA-MP is just a pure mess.
Reply
#7

i like modular... like NGG did. using it has some good advantages like fast compiling because every .pwn has some amount of code. then also, if there is some bugs or problem, your whole script does not needs to sarch. u can do it from that particular file.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)