[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
> if(bool == 'true') > if(array.length > 0)
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 30
Thread images: 2
File: 1445785093652.png (137 KB, 300x300) Image search: [Google]
1445785093652.png
137 KB, 300x300
> if(bool == 'true')
> if(array.length > 0)

PRO-TIP: Kill yourself if you're doing this.
>>
>>54949209
K.
Brb.
>>
>int main(int argc, char** argv)

Don't forget this travesty OP
>>
>Javascript

you're already dead
>>
>>54949209
>if(array.length > 0)
What's wrong with this?
>>
>>54949350
My mom said I'm not allowed to kill myself :(
>>
>>54949625
Damn, how many good boy points did she take?
>>
>>54949620
can't tell if serious or troll
>>
>>54949625
do you always do what mommy says?
>>
>>54949650
No tendies tonight :(
>>
>>54949620
>>54949659
It's a C meme because they don't believe in negative length arrays.
>>
>>54949209
the jit/compiler will deal with it, choose whatever is readable, sperg
>>
>>54949209
Keep it for human readability but make the compiler optimize it out.
>>
>>54949725
>>54949620

It's just redundant. You can't have negative length, and if there is anything in the array, if(array.length) will evaluate to true.
>>
>>54949742
if(bool) isn't readable enough for you...?
>>
>>54949836
makes it more readable for other people though
>>
>>54949361
How is that bad?
>>
>>54949361
I've had a lecturer that insists on this, it would drive me mad!
>>
>>54949877
>extra meaningless characters
>more readable

Anon pls.
>>
>>54949836
btfo nigger

http://pyeval.appspot.com/index.html?id=aghzfnB5ZXZhbHIUCxILQ29tcHV0ZUNlbGwYtZ7MJww
>>
>>54950092
fuckYouFaggots = []

print(bool(len(fuckYouFaggots)))

yields False
>>
File: 1434574623199.jpg (13 KB, 240x150) Image search: [Google]
1434574623199.jpg
13 KB, 240x150
mfw java forces that shit
>>
>>54949702
Underrated
>>
if(OP == "massive faggot")
Sage();
>>
>>54950368
sage is always called...ooooh icwutudidthur
>>
>>54949836
what if one tries to check whether an array is empty?
>>
>>54949361
>char** argv
char **argv master race.
>>
>>54950501
double nigger
>>
>>54949209
> if(bool == 'true')

haha, i remember my old 8th grade teacher used to deduct points for people who didn't do this. Cool as hell otherwise, wonder what she's doing now.
>>
>>54950446
if(!array.length)
Thread replies: 30
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.