what kind of programmer you are?

Discussion in 'Learning Javascript' started by nio kasgami, May 6, 2016.

  1. nio kasgami

    nio kasgami VampCat Veteran

    Messages:
    8,600
    Likes Received:
    2,358
    Location:
    Canada / Quebec
    First Language:
    French
    as the title said what kind of programmer you are while you dev plugin?


    for myself I'm consider myself as a "Human minded coder"


    In simple I code in the cleanest way possible. if I can't read the line of code for me it's a bad line of code and should get rewrite. ALTHOUGH don't get me wrong I know sometime I also do some dirty lines for simplify my job!


    in simple when I code I don't put my code where's it's not belong like's example  I wouldn't put something related to the player in a event class etc


    I tend to be really OPP so everything's should be handles as a class 


    and for me WHAT'S a private variable REST private to the CLASS unless I create a proper attr_accessor aka property or a method for access it from a external class...


    I'm just picky like that 


    oh...and I comment a lots my codes lol


    so in simple it's look like this (I overwrite because it's for my own use and I don't tend to use other people plugin)

    //-----------------------------------------------------------------------------
    // Game_Player
    //
    // The game object class for the player. It contains event starting
    // determinants and map scrolling functions.

    /* My code don steal it >:C! */

    // attr_accessor : fear
    Object.defineProperty(Game_Player.prototype, 'fear', {
    get: function() {
    return this._fearPoint;
    },
    set : function(value) {
    if (this._fearPoint !== value) {
    this._fearPoint = value;
    }
    },
    configurable: true
    });

    // attr_acessor : maxFear
    Object.defineProperty(Game_Player.prototype, 'maxFear', {
    get: function() {
    return this._maxFearPoint;
    },
    set: function(value){
    if(this._maxFearPoint !== this._maxFearPoint){
    this._maxFearPoint = value;
    }
    },
    configurable: true
    });

    // attr_accessor : fearDelay
    Object.defineProperty(Game_Player.prototype, 'fearDelay', {
    get : function(){
    return this._fearDelay;
    },
    set: function(value){
    if(this._fearDelay !== this._fearDelay){
    this._fearDelay = value;
    }
    },
    configurable: true
    });

    // attr_reader : fearStates
    Object.defineProperty(Game_Player.prototype, 'fearStates', {
    get : function(){
    return this.fearSates;
    },
    configurable: false
    })

    Game_Player.prototype.initMembers = function(){
    Game_Character.prototype.initMembers.call(this);
    this._vehicleType = 'walk';
    this._vehicleGettingOn = false;
    this._vehicleGettingOff = false;
    this._dashing = false;
    this._needsMapReload = false;
    this._transferring = false;
    this._newMapId = 0;
    this._newX = 0;
    this._newY = 0;
    this._newDirection = 0;
    this._fadeType = 0;
    this._followers = new Game_Followers();
    this._encounterCount = 0;
    this._fearPoint = 0;
    this._maxFearPoint = 1000;
    this._fearEnabled = true;
    this._fearStates = [2,3,4,5];
    this._fearDelay = 0;
    };

    Game_Player.prototype.resetFear = function(){
    this._fearPoint = 0;
    };

    Game_Player.prototype.maxFear = function(){
    this._fearPoint = this._maxFearPoint;
    };

    Game_Player.prototype.setFear = function(value){
    this._fearPoint = value;
    };

    Game_Player.prototype.addFear = function(value){
    if(this._fearDelay !== 0){
    this._fearPoint += 0;
    } else {
    this._fearPoint += value;
    }

    };

    Game_Player.prototype.removeFear = function(value){
    var oldFearPoint = this._fearPoint;
    this._fearPoint = oldFearPoint - value;
    };

    Game_Player.prototype.progressiveFearIncreasing = function(){
    this._fearPoint++;
    };

    Game_Player.prototype.progressiveFearDecreasing = function(){
    this._fearPoint--;
    };

    Game_Player.prototype.fearEnabled = function(){
    return this._fearEnabled;
    };

    Game_Player.prototype.enableFear = function(boolean){
    this._fearEnabled = boolean;
    };

    Game_Player.prototype.setFearDelay = function(value){
    this._fearDelay = value;
    };

    Game_Player.prototype.decreaseFearDelayProgressively = function(){
    this._fearDelay--;
    };

    SO what's about you guys? 
     
    Last edited by a moderator: May 6, 2016
    #1
    AwesomeCool likes this.
  2. AwesomeCool

    AwesomeCool Bratty and spoiled little sister Veteran

    Messages:
    2,877
    Likes Received:
    1,954
    Location:
    Behind you! BOOOO!
    First Language:
    English
    Primarily Uses:
    N/A
    The most readable way I can (I prefer readability over efficiency) and comment + document everything that can even be confused.


    ...unless I want some job security. :p
     
    #2
    Kino and nio kasgami like this.
  3. Victor Sant

    Victor Sant Veteran Veteran

    Messages:
    1,694
    Likes Received:
    1,437
    Location:
    Brazil
    First Language:
    Portuguese
    I'm a fancy coder. Sometimes I make my code worse, just so it looks better. B)
     
    #3
    Kino, Iavra and AwesomeCool like this.
  4. Gatene

    Gatene Intermediate Scripter Member

    Messages:
    11
    Likes Received:
    1
    Location:
    South Carolina
    First Language:
    English
    I'm sorta like AwesomeCool, readability over effeciency. I learned how to program back in the mid 90's on old DOS machines...so functions weren't that heard of. True, functions make it more neat, and lots of built-in functions and methods make the code smaller, but I like to type it all out, add comments, and only use functions with code I tend to use a lot.
     
    #4
  5. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,067
    Location:
    Toronto
    First Language:
    English
    I like to use excessive amounts of methods and classes.


    Anything that can be abstracted into its own entity will become its own object.


    I believe OOP is the only way to code large software in such a way that it can be maintained and extended over its life-time, by potentially multiple programmers.
     
    #5
    DreamX and AwesomeCool like this.

Share This Page