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

itt: non-jerkoff versions of pic

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 38
Thread images: 2

File: cringe.jpg (9KB, 736x414px) Image search: [Google]
cringe.jpg
9KB, 736x414px
my attempt

do
{
this.life();
} while(1)


>inb4 stack overflow
>>
>filename is cringe.jpg
kek
e
k
>>
>>55971612
Pic AND OP post are cringe
>>
>>55971612
omg, anon you are like a leet coder now. you've mastered predicates, holy shit. that usually takes people years, if they're retarded, and 1 second if they're not.
>>
sad() returns a bool, but a bool that has a member function called stop().

I can understand why they'd be so sad if they write code like this.
>>
>>55971963
we all tried to tell them javascript was a horrible idea. they just wouldn't listen.

now look at what they're doing.
>>
>===
rrrrrrreeeeeeeeeeeeeeeee
>>
> ====
We need more equality
>>
>>55971980
Is it even possible to have it so that sad() === true and sad().stop() is callable? Maybe if they did something with Proxy, but I doubt they're competent enough to use it properly.
>>
>>55972450
It's very possible. Just keep a switch that toggles when it's run the first time.
>>
>>55971612
if (you.isSad())
you.kys();
>>
>>55971612
>OOP
I vomited three times reading this
>>
>>55971612
> if (sad() === true)
>not if (sad())

Disgusting
>>
>>55971612
Couldn't that be optimized to
 while(1) this.life() 

?

>>55971963
>>55972450
It's ECMAScript, which is weakly typed, and doesn't the === operator do type conversion? Apparently sad() returns an OBJECT (given that you can call the stop() method on it), which can be interpreted as true or false. So really what it's doing is:
>call the sad() function
>if the object it returns can be interpreted as TRUE, then
>>call the stop() method on the object returned by sad()
>>
>>55973314
Maybe you want sad() to explicitly be true, and not any truthy value.
>>
>>55973321
no, shouldn't it be
this.life()

you only get to loop once.
>>
>>55973359
> yolo - you only loop once
for(int i = 0; i < 1; ++i)
this.live()
>>
>just b urself xD
>>
>>55971612
>just stop being depressed!!

>>55973430
Why the fuck are you wrapping a statement that only gets executed once into a loop that only loops once?
>>
>>55973321
=== doesn't convert types
>>
>>55973530
It's supposed to be a joke about yolo.
>>
>>55973530
> not getting the obvious joke
anon, you really need to go to sleep / go out for a walk / drink coffee
>>
>>55971612
This is the most freshman CS student shit I've ever seen. Fucking kill yourself OP.
>>
>>55973321
=== compares types while == only compares the values. So
if (4== '4')
would evaluate to true, but
if (4 === '4')
would evaluate to false.

>>55973558
>>55973568
I got the joke, I guess the humor was lost on me, because I know people who would actually write that type of code seriously.
>>
>>55971612
>===
Fucking javascript
>>
I have no depth or insight, so I translated some quotes I found on life:

pay_taxes();
int16_t life;


prop_life = all tragic events && comic (mconcat events)



double Life::Score() {
double money = std::accumulate(earnings.begin(), earnings.end(), 0);
double happiness = totalHappiness();
double renown = std::abs(this.fame);

return happiness;
}
>>
>>55973765
If totalHappiness() is a method rather than a variable, it should be getTotalHappiness().
>>
>>55973819
It's a variable that happens to be a function.

Or something. I dunno.
>>
>>55973830
If it was a variable then you shouldn't have the parentheses. You'd just have to define it as totalHappiness = function() {return "fuck nice things";} or whatever
>>
>>55973848
he would still need the parentheses
>>
>>55973873
Ah shit, you're right. My bad.
>>
>>55971612
>sad().stop();
>true.stop();

loving the implications

why do people who make these feel the necessity to demonstrate they have no idea how programming works.
>>
>>55973101
whats wrong with oop
>>
File: pal (1).png (86KB, 820x1000px) Image search: [Google]
pal (1).png
86KB, 820x1000px
>>55971937
this.

>>55973347
If sad is a function returning a bool, then the next line would throw an exception, since bools don't have methods.

If sad is returning an object, it'll be comparable to "true", but not exactly true so the control flow never goes into the if statement.
>>
>>55971612
how does a boolean have a function like that.
>>
>>55973819
That's the rule you made up. In Qt, for example, by convention, there's no get. Qt has text() as getter and setText() as setter.
>>
>>55972268
C====
C 4 equality
patriarchal languages can go die
>>
>>55973963
>since bools don't have methods
> Boolean.prototype.you = function() { return 'wrong'; }
- function () { return 'wrong'; }
> true.you()
- "wrong"
Thread posts: 38
Thread images: 2


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.