Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

NSFW Best Thread Ever [No SJW-related posts allowed]

Viata

Arcane
Joined
Nov 11, 2014
Messages
9,886
Location
Water Play Catarinense
Sorry, I can enjoy something while not caring about its author. If the guy is retarded, degenerated, rapist or whatever doesn't imply his game should be ignored if it's good. Where I stand, ignoring him but not his game means I may get a good game and that's good for me.
 

Sankarihauta

Prospernaut
Joined
Jan 22, 2012
Messages
322
Btw men think of the mindfuck if you had a half dozen essentially shredded english essays you had to put together to understand fully why things are being implemented the way they are somewhere else.
 
Self-Ejected

Excidium II

Self-Ejected
Joined
Jun 21, 2015
Messages
1,866,227
Location
Third World
zRT1NQB.png



In this picture there is not enough information to say it's bad code with regard to the larger picture. There is enough information to say it is reasonably logical, readable, and editable. I am willing to admit I am not a seasoned unity3d user yet. But I don't see any painfully-in-need areas of optimization. This shit is so simple I don't quite get why the only suggested alternative, polymorphism, is even needed.

It's been a while since I needed it. But it's a way to access methods of many different classes all of which inherit from a base class. The methods accessed if only implemented in the base class, means the base class method gets called else the implementation of the class inheriting the base class has its same-named methods called.

I do recall a google-talk or something like it where polymorphism as a way to reduce ifs and switch-case statements worked quite well. There may have even been some "you're not very seasoned if you don't know about this yet" shittalking. Likely context was " X things we find people aren't optimizing or are forgetting can be optimized."

But really i don't see any meaningful benefit to polymorphism in the context of that image. If you really believe the solution is ALWAYS to take everything and make it pushed away and tucked into nice methods you call: you're just weak and are slowing down prototyping.

It is an attractive idea to take a handful of variables like Sex, Teacher, Retired, Ill and directly without any needs for if-statements, just lookup the appropriate function and execute it. Cuts down on ifs big time.

But the problem with that is you don't get to see in the function auto-jumped to: the other functions that implement things how they do! When prototyping it's easier to debug (if you're a seasoned programmer) when all the many cases are laid out in branching if-logic in the same space.

For the non-programmers it works like this. Imagine you wrote an essay where each paragraph you know is getting its support from the others. It's meant to all be understood by the relative understanding given by each one basically in a linear sequence. Now your English teacher divides your essay up and randomly shuffles it so it's broken into many pieces. The teacher now has the luxury of picking out the exact segment to challenge you on. This segment *MAY* be THE real problem. But you and them don't really know until you referred back to the others. Now you have to track down all the relevant segments trying to see why things were said in the one.

In the debugging world your program can fault at any place. This is why it's like the segments being randomly shuffled, and also you don't know if something that went on earlier was the problem until you start going through things. If you had a IRL FANTASTIC MEMORY SIZE and RECALL ability as person, and worked your text editor like a true hardcore pro, then the more optimal method of splitting things up and elegantly auto-calling the right function is better.
It's just written in a very strange way. Even ignoring the context it looks like he doesn't really know how to program.
 

Sankarihauta

Prospernaut
Joined
Jan 22, 2012
Messages
322
redacted.


if he's receiveing 5k from pateron he should do a lot better at making his code readable than just for himself.
 
Joined
Jan 7, 2012
Messages
14,242
"Optimization" of stuff like that is only relevant if its something that is being run every frame (or multiple times every frame, like for every character every frame). Even if so it would be mostly irrelevant, only saving a few cycles. However, it looks to be pure initialization logic which would only be run once when you load a character. In that case it's completely irrelevant.

As regards coding style and readability, meh. It's not hard to understand OOP or debug it, but at the same time it's not exactly ugly or unreadable at the moment. Polymorphism is great when you could have an infinite/indefinitely expanding amount of possibilities and want the object itself to handle it (especially useful when multiple codes are on the same project and you don't want them interfering with each other trying to implement the same thing). Seeing as he only cares about male/female student/teacher, it's fine. If/when he expands and has dozens more roles, polymorphism would be a good idea. Assuming he's not writing complete spagghetti code copy and pasting shit everywhere rather than having a single initialization function, doing so is a matter of minutes of coding time.
 
Last edited:
Self-Ejected

Excidium II

Self-Ejected
Joined
Jun 21, 2015
Messages
1,866,227
Location
Third World
"Optimization" of stuff like that is only relevant if its something that is being run every frame (or multiple times every frame, like for every character every frame). Even if so it would be mostly irrelevant, only saving a few cycles. However, it looks to be pure initialization logic which would only be run once when you load a character. In that case it's completely irrelevant.

As regards coding style and readability, meh.
It's not about style, readability or optimization. He's writing a completely structured mess in an OO language.
 

adrix89

Cipher
Joined
Dec 27, 2014
Messages
700
Location
Why are there so many of my country here?
"Optimization" of stuff like that is only relevant if its something that is being run every frame (or multiple times every frame, like for every character every frame). Even if so it would be mostly irrelevant, only saving a few cycles. However, it looks to be pure initialization logic which would only be run once when you load a character. In that case it's completely irrelevant.

As regards coding style and readability, meh.
It's not about style, readability or optimization. He's writing a completely structured mess in an OO language.
Writing OOP is a failure in whatever the language. OOP is the single worst ideology to come out of programming.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom