Sign in to your account



This field is required


forgot your password?


New to the site? Create an account →

//Set the sequence number

tcr! · Jun 14, 2017 at 1:08 pm

You’ve got to be kidding me.

//Set the sequence number
$squence_number = $values['insert_sequence'];

//If the sequence is less then 10 put a zero in front of the number.
if ($squence_number<10) {$squence_number = "0".$values['insert_sequence'];}

The // indicates that line is a comment and they’re used when the code isn’t self-explanatory or obvious.

Regardless of “how” they’re to be used, developers leave comments for the next guy like this ALL THE TIME.

Let’s document code that’s ridiculously simple and leave code that’s ridiculously complicated undocumented.

Bonus points for → $squence_number ← 😍

I’m not sure if that’s a typo or the developer was trying to be fancy and save space or what.

Regardless × 2, he should be consistent with ['insert_sequence'] because consistency.

#devhell

Add a comment

It’d be better if you signed in before commenting


Post



Latest articles for #devhell

Jun 6th, 2019 at 11:47:17 am

Jun 6th, 2019 at 11:47:17 am

Jun 6, 2019 at 11:47 am

The function/method MUST return the number of bytes written.Why? I’m…

Developer laments, a Cobain quote, and more!

Developer laments, a Cobain quote, and more!

Jan 10, 2019 at 12:46 pm

Being a dork web developer who: loves code is forced to use WordPress…

Phone number optionally required

Phone number optionally required

Dec 1, 2018 at 12:05 pm

Good one Google. 🙄 #devhell #google

Aug 20th, 2018 at 3:16:17 pm

Aug 20th, 2018 at 3:16:17 pm

Aug 20, 2018 at 3:16 pm

Writing a valid, functional, and strict MySQL regular expression for…