MyBB Community Forums

Full Version: Your team cracks me up!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Look through some code, thinking of continuing making mods for the software, but came accross these comments in just 2 files! You do make me laugh!

http://www.imghst.org/viewimage.php?iid=55
http://www.imghst.org/viewimage.php?iid=56
http://www.imghst.org/viewimage.php?iid=57
http://www.imghst.org/viewimage.php?iid=58
I noticed this. It's a welcome change from the boring stuff right? Toungue
Oh, that's nothing compared to some of the comments I've seen in Facebook's applications. If I recall correctly, they once mentioned something about Tuna... Toungue

It's common to spruce up the comments. It adds a bit of personality from the developer to the code. Smile

Edit:

Some code from one of my projects:

	public function getCurrentLanguage()
	{
		// No language set? Man, that sucks. Let's default to English.
		if(empty($this->language))
		{
			return 'en';
		}
		return $this->language;
	}
(2012-05-19, 02:42 PM)Anxiety Wrote: [ -> ]I noticed this. It's a welcome change from the boring stuff right? Toungue
Definitely
(2012-05-19, 02:47 PM)Nathan Malcolm Wrote: [ -> ]Oh, that's nothing compared to some of the comments I've seen in Facebook's applications. If I recall correctly, they once mentioned something about Tuna... Toungue

It's common to spruce up the comments. It adds a bit of personality from the developer to the code. Smile

Edit:

Some code from one of my projects:

	public function getCurrentLanguage()
	{
		// No language set? Man, that sucks. Let's default to English.
		if(empty($this->language))
		{
			return 'en';
		}
		return $this->language;
	}

Haha, good one. Why tuna?
(2012-05-19, 04:34 PM)Echo Off Wrote: [ -> ]Haha, good one. Why tuna?

Who knows? Shy

// upcoming events
events_check_future_events($user); // make sure big tunas haven't moved around
$upcoming_events = events_get_imminent_for_user($user);
Personally I hate comments in most php. It's just extra code I have to read.
(2012-05-19, 06:12 PM)labrocca Wrote: [ -> ]Personally I hate comments in most php. It's just extra code I have to read.

Spoilsport!
It keeps things nice and tidy Smile
In big projects comments also help you navigate through the multiple files. I personally use them when there's a block of code that may take some deciphering when I come back to it in the future.
I'm on the edge about silly comments in code. On the one hand, it adds a human touch to both the sometimes monotonous, brain-numbing writing and to the sometimes difficult deciphering. On the other hand, it does take more time to write (not a huge problem) and the few milliseconds it takes for the server to process that it's a comment can add up (or so I'm told) if you're processing loads of files.
Pages: 1 2