1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Things beginner programmers do.

Discussion in 'Off-Topic' started by Muqsit, Mar 9, 2017.

  1. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Comment anything I missed.
    • "How long would it take you to finish this project?" "Um, 2 hours".
    • Inventory::setContents([Item::get(1), Item::get(1), Item::get(1), Item::get(1), Item::get(1), Item::get(1), Item::get(1), Item::get(1), Item::get(1)]);
    • Bigger file = rip performance.
    • *Doesn't make comments at all for a highly complex function in a public plugin, not even a documentation of the function*
    • .json is the fastest man-made thing to ever exist.
    • Java is faster than PHP.
    • Let me just extend this class with PluginTask, even though I won't be using the main plugin class anywhere in the task.
    • shoghicp is our only god
     
    Last edited: Mar 10, 2017
  2. Junkdude

    Junkdude Zombie

    Messages:
    346
    GitHub:
    JunkDaCoder
    multiple files = better performance
     
  3. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    "Help my plugin doesn't work, here code:" (doesn't provide any further information)
     
  4. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
    Thinking, "Why do I need to learn PHP if I'm only going to use the PocketMine API?" is like asking, "Why do I need food if I'm only going to use the spoon?"
     
  5. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    "Help my plugin doesn't work!" (Doesn't even provide code)
     
  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    LMAO xD
     
  7. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    omg more class = more lag / more efficient
    keep everything on public, even things like internal storage array stack that should have been private
    instate of using public getters and setters, why even bothered with getter and setter, why not just keep the whole thing public!
    lets add a massage to console when my plugin onEnable or onDisable get called Even there no initialization that needs to be done ex load economy/perms etc
    like to do "use X/Y/XY as XYX" when there nothing that shares/uses/collide with the same name
    says using && is better then AND, or says using AND is better then &&, they both are the same
    cant be bothered with PHP DOC (Liek meh)/s most devs does this so maybe that's a intermediate thing
     
  8. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    Eeh... I'll finish it later...
    (1 week later)
    WTH is this? *delete*
     
  9. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    *finds code on the internet*
    ctrl + c
    *opens text editor*
    ctrl + v
    *tries to use plugin*
    "Error: Syntax error at line x on file blah blah blah"
    *complains about code not working*

    Developers on the forums: :facepalm:
     
  10. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    I COULD null that down to one developer.
     
  11. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    • Importing unused classes and not removing them later.
    • Declaring unused variables and not removing them later.
    • While making a Pull Request, adding "Fixed by {their-name}" or adding their name to the "authors" in plugin.yml (YOU ARE NOT THE AUTHOR -.-).
    • Reinventing the wheel.
    • Using "SELECT * FROM database" to get 1 or 2 tables from a database filled with around 5 to ∞ tables.
    • Modifying source instead of using a plugin.
    • Demanding payment to fix bugs (yeah I've seen people do that).
    • Lack of OOP understanding and usage.
    • Poor understanding of arrays. (There are a very few people I've seen who actually utilize arrays properly).
    • Optimizing code while writing it. Code should actually be optimized after you're done with your project and ONLY if optimization needs to be done.
    • Writing a lot of repetitive code that can instead be shortened by using for loop, while loop, foreach loop, array_fill() etc. Some of them copy-paste huge chunks of code from file to file, and when the code fails, they have to change the code in each file.
    • Never testing out code before publishing.
    • "I understand C, Java, Python, Ruby, Pearl... and hence I am always right and you will always be a minority compared to me and your allegations against my code will be valueless."
    • "I use PHPStorm (or some other IDE) and hence am a better coder compared to you." (P.S: Am I the only one who uses WinSCP's editor?).
     
    Last edited: Mar 10, 2017
  12. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Some time ago I used to use the github web editor... Doesn't mean you're better at all than other coders if you have a super expensive IDE, but it does improve your code quality. :p
     
  13. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Yeah but some people use it as a means of measurement :p
     
  14. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Help, my plugin error this: "Some Error one Line 123 in blah.php"

    *posts line 284 of abc.php and without code blocks*
     
  15. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    *posts the whole 2000-lines long file*
     
  16. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    *without code blocks
     
  17. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    *forgets to tell the actual error*
     
  18. xBeastMode

    xBeastMode Shog Chips

    Messages:
    0
  19. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    How to make x plugin??
    Give me code pls!

    *Doesn't provide further information*
     
  20. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    • *Doesn't make comments at all for a highly complex function in a public plugin, not even a documentation of the function*
    shit, i should really do something about this:
    PHP:
    /** @license GPLv3 */
                        
    $t 1;
                        
    $s 5;
                        
    $d 10;
                        
    $v 0.25;
                        
    $p 0.25;
                        
    $y $pos->getY();
                        
    $dcpi abs($t $s) / ($d $v);
                        for(
    $iy $y $d$y <= $iy$iy -= $v){
                            
    $t -= $dcpi;
                            
    $ppc round((M_PI $t) / $p);
                            for(
    $yaw 0$yaw <= M_PI 2$yaw += (M_PI 2) / $ppc){
                                
    $diffx = -sin($yaw) * $t;
                                
    $diffz cos($yaw) * $t;
                                
    $fx $px $diffx;
                                
    $fz $pz $diffz;
                                
    $arr[] = [$fx$cy$fz];
                            }
                        }
    Don't ask me what that does. i forgot it...
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.