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
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?"
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
*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:
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?).
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.
Help, my plugin error this: "Some Error one Line 123 in blah.php" *posts line 284 of abc.php and without code blocks*
*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((2 * 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...