Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


You know what I hate as a coder?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
Monkeys
I post too much
Reputation: 29

Joined: 20 Jul 2006
Posts: 2411

PostPosted: Fri Sep 16, 2011 1:42 pm    Post subject: You know what I hate as a coder? Reply with quote

People commenting like this:


Code:
//Print to console:
PrintToConsole("I'm a huge ass faggot");

//Return:
return;


Or indenting like so:
Code:
func()
{
if(bool)
{
      tar();
   dool();
   }
         }


When I read code like that, I always charge extra.

_________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Back to top
View user's profile Send private message
gogodr
I post too much
Reputation: 125

Joined: 19 Dec 2006
Posts: 2041

PostPosted: Fri Sep 16, 2011 1:51 pm    Post subject: Re: You know what I hate as a coder? Reply with quote

Monkeys wrote:
People commenting like this:


Code:
//Print to console:
PrintToConsole("I'm a huge ass faggot");

//Return:
return;


Or indenting like so:
Code:
func()
{
if(bool)
{
      tar();
   dool();
   }
         }


When I read code like that, I always charge extra.


I remember my teacher doings this

Code:
//Print to console:
PrintToConsole("I'm a huge ass faggot");

//Return:
return;


and I was like WRYYYYYYYYYYYYYYYY
Back to top
View user's profile Send private message MSN Messenger
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Fri Sep 16, 2011 3:20 pm    Post subject: Re: You know what I hate as a coder? Reply with quote

Monkeys wrote:
People commenting like this:


Code:
//Print to console:
PrintToConsole("I'm a huge ass faggot");

//Return:
return;


Or indenting like so:
Code:
func()
{
if(bool)
{
      tar();
   dool();
   }
         }


When I read code like that, I always charge extra.

The commenting I can understand if you're a teacher who's teaching first year students without a coding background. The indenting is annoying as fuck, but decent IDEs have a refactoring tool which can make the indents as they should be in a second.

EDIT: For example, I recently made this for a friend who's learning to code PHP:

Code:
<?php

/**
 * This is the album class which handles everything pertaining to the generating
 * of an album based on the file and folder structure of the 'image' folder,
 * which it is set to by default. You can change this default folder to whatever
 * you want: I don't even care, smartass. In total there are six variables which
 * you can change in the constructor.
 *
 * If you install this script on a UNIX filesystem, it is important to set the
 * fucking rights of the 'image' folder, or whatever you set the default folder
 * to, to 775. If you contact me about not having proper rights, my only
 * response will most likely be me calling you an idiot while pointing and
 * laughing at you. Not really important if the version you're using does not
 * have the admin panel implemented yet though.
 *
 * The file might contain variables or functions not yet (fully) implemented,
 * that's because this is a work in progress, thus the project is still in beta.
 * The official release date is scheduled around whenever I feel like it.
 *
 * @author  Stefan van Beusekom
 * @since   September 9th, 2011
 * @version 0.0.1
 */
class Album {

    private $rootFolder;
    private $urlPath;
    private $systemPath;
    private $username;
    private $password;
    private $resultsPerPage;
    private $directoryHandle;
    private $fileExtensions;
   
    public $albumName;
   
    /**
     * Constructor of the class. Handles basic actions for all other functions,
     * as well as variables which can be changed to suit your own taste.
     *
     * @author  Stefan van Beusekom
     * @since   September 9th, 2011
     */
    public function __construct($urlGET) {
        // Variables which can be changed to suit your taste.
        (string)    $this->albumName        = "Demo album";
        (string)    $this->username         = "demo";
        (string)    $this->password         = "demo";
        (int)       $this->resultsPerPage   = 20;
        (Array)     $this->fileExtensions   = array('jpg', 'png', 'gif');
        (string)    $this->rootFolder       = "image";

        // Variables that take care of themselves. Best not to touch these.
        (string)    $this->urlPath          = ($urlGET['path'] == "") ? $this->rootFolder . "/" : $urlGET['path'] . "/";
        (string)    $this->systemPath       = realpath($this->urlPath) . "/";
        (Array)     $this->directoryHandle  = scandir($this->systemPath);
    }

    /**
     * Returns an array of all directories in the directory currently being
     * viewed. This does not include parent or current directories.
     *
     * @author  Stefan van Beusekom
     * @since   September 10th, 2011
     * @return  array
     */
    public function getDirectories() {
        // Sets an empty array to contain directory URL's used as categories in
        $returnDirArray = array();
        // Loop through all items in the current directory
        foreach ($this->directoryHandle as $key => $value) {
            // Set the web path
            $tempDir = $this->systemPath . $value;
            // Check if the item is a directory, and not a reference
            if (is_dir($tempDir) && substr($value, 0, 1) != ".") {
                // Push the item onto the array
                array_push($returnDirArray, ($this->urlPath . $value));
            }
        }
        // Return the directory array
        return $returnDirArray;
    }

    /**
     * Returns an array of all images in the directory currently being viewed.
     * This does not include images from parent or child directories.
     *
     * @author  Stefan van Beusekom
     * @since   September 10th, 2011
     * @return  array
     */
    public function getImages() {
        // Sets an empty array to contain images URL's in
        $returnImgArray = array();
        // Loop through all items in the current directory
        foreach ($this->directoryHandle as $key => $value) {
            // Set the web path
            $tempFile = $this->systemPath . $value;
            // Check if the item is a file, and not a directory or reference
            if (is_file($tempFile)) {
                // Retrieve pathinfo
                $fileExt = pathinfo($tempFile);
                // Extract the file extension, and make the result lowercase to
                // ensure comparison is done correctly.
                $fileExt = strtolower($fileExt['extension']);
                // Check if the extracted extension is in the array with allowed
                // file extensions.
                if (in_array($fileExt, $this->fileExtensions)) {
                    // Push the item onto the array
                    array_push($returnImgArray, ($this->urlPath . $value));
                }
            }
        }
        // Return the image array
        return $returnImgArray;
    }
   
    /**
     * Destructor of the class. Will remove resources which should/are not being
     * used anymore.
     *
     * @author  Stefan van Beusekom
     * @since   September 9th, 2011
     */
    public function __destruct() {
        unset($this->directoryHandle);
    }

}

?>
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Sep 16, 2011 3:39 pm    Post subject: Reply with quote

that's not that bad. sort of similar to javadocs. take a look at openjdk
Back to top
View user's profile Send private message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Fri Sep 16, 2011 3:43 pm    Post subject: Reply with quote

Slugsnack wrote:
that's not that bad. sort of similar to javadocs. take a look at openjdk

But that's still Java right? I'm using http://phpdoc.org/ to create something similar to javadocs, but for PHP.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Fri Sep 16, 2011 3:49 pm    Post subject: Reply with quote

what do you mean it's still java ?
Back to top
View user's profile Send private message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Fri Sep 16, 2011 3:50 pm    Post subject: Reply with quote

Slugsnack wrote:
what do you mean it's still java ?

Well the dude I talked about is trying to learn PHP.
Back to top
View user's profile Send private message
Josheh
Expert Cheater
Reputation: 1

Joined: 28 Aug 2011
Posts: 155

PostPosted: Fri Sep 16, 2011 3:51 pm    Post subject: Re: You know what I hate as a coder? Reply with quote

Monkeys wrote:
People commenting like this:


Code:
//Print to console:
PrintToConsole("I'm a huge ass faggot");

//Return:
return;


Or indenting like so:
Code:
func()
{
if(bool)
{
      tar();
   dool();
   }
         }


When I read code like that, I always charge extra.


The commenting doesn't bother me so much but the spacing does -- it's difficult to read.
Back to top
View user's profile Send private message
Aviar³
Grandmaster Cheater
Reputation: 50

Joined: 03 Jan 2008
Posts: 655
Location: Canada

PostPosted: Fri Sep 16, 2011 3:59 pm    Post subject: Reply with quote

You code professionally?

P.S.: That looks fine to me, unless you mean the fact that the person used a string literal and that the second source both lacks function parameter and return type decleration, as well as using the bool reserved word in the if statement. hue hue hue

_________________
This is the inception of deception, checking the depth of your perception.
Back to top
View user's profile Send private message
Cryoma
Member of the Year
Reputation: 198

Joined: 14 Jan 2009
Posts: 1819

PostPosted: Fri Sep 16, 2011 4:22 pm    Post subject: Reply with quote

I don't comment anything lol, if someone else wants to use my code they will just have to know what it means.
Back to top
View user's profile Send private message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Fri Sep 16, 2011 4:23 pm    Post subject: Reply with quote

Cryoma wrote:
I don't comment anything lol, if someone else wants to use my code they will just have to know what it means.

I had a colleague like that. He doesn't work at our company anymore.
Back to top
View user's profile Send private message
booingthetroll
Expert Cheater
Reputation: 0

Joined: 30 Aug 2011
Posts: 114
Location: ::1

PostPosted: Fri Sep 16, 2011 4:26 pm    Post subject: Reply with quote

It's like mirroring the code previously
//print "\n"
print "\n"
Back to top
View user's profile Send private message
Cryoma
Member of the Year
Reputation: 198

Joined: 14 Jan 2009
Posts: 1819

PostPosted: Fri Sep 16, 2011 4:47 pm    Post subject: Reply with quote

Augustine wrote:
Cryoma wrote:
I don't comment anything lol, if someone else wants to use my code they will just have to know what it means.

I had a colleague like that. He doesn't work at our company anymore.

Well I don't work for anyone so I don't really give a fuck, it's not like commenting is hard if I had to.
Back to top
View user's profile Send private message
Aviar³
Grandmaster Cheater
Reputation: 50

Joined: 03 Jan 2008
Posts: 655
Location: Canada

PostPosted: Fri Sep 16, 2011 4:49 pm    Post subject: Reply with quote

Cryoma wrote:
Augustine wrote:
Cryoma wrote:
I don't comment anything lol, if someone else wants to use my code they will just have to know what it means.

I had a colleague like that. He doesn't work at our company anymore.

Well I don't work for anyone so I don't really give a fuck, it's not like commenting is hard if I had to.


You would be surprised. Its easy to do too much or too little. Either way, somethings better than nothing.

_________________
This is the inception of deception, checking the depth of your perception.
Back to top
View user's profile Send private message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Fri Sep 16, 2011 4:52 pm    Post subject: Reply with quote

Aviar³ wrote:
Cryoma wrote:
Augustine wrote:
Cryoma wrote:
I don't comment anything lol, if someone else wants to use my code they will just have to know what it means.

I had a colleague like that. He doesn't work at our company anymore.

Well I don't work for anyone so I don't really give a fuck, it's not like commenting is hard if I had to.


You would be surprised. Its easy to do too much or too little. Either way, somethings better than nothing.

At least the 'doc' part is good to do. Just a short description and the important '@' definitions. Generating proper documentation has never been easier.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites