I noticed this. It's a welcome change from the boring stuff right?
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...
It's common to spruce up the comments. It adds a bit of personality from the developer to the code.
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?
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...
It's common to spruce up the comments. It adds a bit of personality from the developer to the code.
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?
// 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.
It keeps things nice and tidy
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.