[Humor] Design principles in papyrus

Post » Tue Nov 20, 2012 3:48 am

Fellow programmers, here are some architecture principles you should try to pursue when programming with Papyrus. :wink:

* MRP: Multiple Reponsibilites Principle. Instancing an object costs one frame and every external call release your lock on "self", so make sure to use as few classes as you can and stuff as many responsibilities as you can into every single one of them.
* RY: Repeat Yourself. Remember that one papyrus call is about one microsecond long and a frame won't run papyrus for more than 1.5ms, so all scripts share a meager budget of a few thousands of calls per frame. Avoid helper functions, copy-paste!
* ASP: Arrays Substitution Principle. everything you can do with an instance, you can do it with arrays. And arrays are your friends, because they translate into mere opcodes and not decade-long function calls. 500 lines of code full of arrays manipulations are better than one function call. Fortran 77, we will never forget you.
* KICK: Keep It Circumvoluted, Kk?. Did you ever program in asm on the 80's computers? Sure, your code was horrible but at least it ran on the weak CPU we had at that time. Thanks to papyrus, you will miss that, because your code was not so bad compared to what you are writing now.
* DCP: Dependency Confusion Principle. Since native calls take one frame, you need to spread those calls on many objects. So make sure to write a real asynchronous spaghetti code where John talks to Bill, expects an answer from Fred 0.5s later, while Mary and Louis feed Bill with all the stuff he can eat meanwhile. You are glad to not have lambdas, are not you? Wait, you're deadlocked already?



PS: If you do not know what all of this is inspired from (welcome into the world of programming, newcomers), search SOLID, SRP, DRY, LSP, KISS and DIP in Wikipedia.
User avatar
Lucie H
 
Posts: 3276
Joined: Tue Mar 13, 2007 11:46 pm

Post » Mon Nov 19, 2012 7:13 pm

:D
User avatar
Philip Rua
 
Posts: 3348
Joined: Sun May 06, 2007 11:53 am

Post » Tue Nov 20, 2012 6:55 am

ASP

Should be changed to "Array ******ness principle", because papyrus arrays are pathetic. Too much so for sarcasm even...
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Mon Nov 19, 2012 9:17 pm

I wish I understood half of the opening post.
User avatar
Milad Hajipour
 
Posts: 3482
Joined: Tue May 29, 2007 3:01 am


Return to V - Skyrim