Cringe

Can we get a coding cringe thread?

Other urls found in this thread:

youtube.com/watch?v=SXmv8quf_xM
en.wikipedia.org/wiki/Fast_inverse_square_root#Overview_of_the_code
twitter.com/SFWRedditVideos

...

...

I see nothing wrong with that code.

...

>t.pajeet

While there's nothing wrong with the code itself technically, the logic behind is terrible. Multiplication is just a series of additions.

I hope you're not serious

That hurts to look at

...

...

post more.
people being stupid gives me a raging boner.

>comparing inverse square root to fucking max
I quit. The world is fucked and there is no way to unfuck it.

>shalom ayash

>if(a > b && b < a)
literally triggered.

WE

Newfriends out

WUZ

Her code is advanced and well-documented. Code on the left is made by obviously incompetent person or so-called 'code monkey', who just write code, but doesn't understand what the code does.

why?

>a tweet from a month ago
>calling someone new when they get flustered
explain yourself, you nigger.

What I find especially infuriating is that she removed the comments from the Quake code to make it more confusing.

>her code is advanced

Thanks for more Sup Forums humor, friend!

...

KANGZ

I'm curious what he had almost finished with his minecraft PowerPoint.

lost

youtube.com/watch?v=SXmv8quf_xM

Probably nothing. But if it was something, I am dying to see it

...

Is it going to freeze my compute if do this now? It's obvious that the video was made many years ago that's why it is only so few people on google page, but now I think there should be more of them.

Return a / (1 / b)

Wouldn't work. These are integers.

You would use a for loop with repeated addition.

...

>february was one month ago
So on top of being new you're retarded?

>keeping up with the date
And that's how I know you're just a summerfag.

>I can't code so I construct strawmen to laugh at to make myself feel better

>While there's nothing wrong with the code itself technically
Well I guess “technically” you are a retard, then.

W O M E N I N T E C H

You're not even trying anymore.

>implying you were

Both code examples are shit.

The code on the right has too many comments and unnecessary parts, but it's totally valid.

The code on the left has no comments (which is a big nono) and also I hate it when people name their variables x,y,z,i,j,k...
If you just call it "diameter, x_axis, length" you can immediately understand what it's all about.

As for the girls comments, they are obviously baiting, shame on you guys for getting triggered so easily.

>this weakass bait worked

>but it's totally valid.

>getting triggered
I like you :)

>Both code examples are shit.
>fast inverse square root is shit
I know this is bait, but it still makes me mad.

>The code on the left has no comments
The comments were removed. There were comments in the original.

>and also I hate it when people name their variables x,y,z,i,j,k...
That's your problem. There is nothing wrong with the variable names. The variables there do not have intuitive interpretations. It's all mathematics and bit-twiddling.

The code on the left had comments originally, the poster just removed them before posting

Of course I was you dipshit, I've seen this fucking tweet posted here at least twice a day every single day, how come have you not seen it yet in 3+ months? Oh wait I know why, that's because you're digustingly new.

formatted the cells to look like Steve

you guys are aware this is fake right ?

Sup Forums is one of the easier boards to troll. Not as easy as Sup Forums or Sup Forums, but still pretty easy.

c = c + a
while b > 0

#TODO finish formatting loop

Complete beginner here, what does the code on the left do and are those * and & pointers?

I've seen it posted too. Doesn't make me any less angry every time I fucking see it you nigger. Or maybe it didn't occur to you that I don't browse the same nigger threads as you, faggot. Oh but wait, you're just a newfag, generalizing about how other people spend their time. Fuck off with your retardation you loose asshole'd nigger.

>twice a day every day

hello 911

...

en.wikipedia.org/wiki/Fast_inverse_square_root#Overview_of_the_code

en.wikipedia.org/wiki/Fast_inverse_square_root#Overview_of_the_code

Col. Kek McKekkington

The code will work fine, it's just a terrible way to implement it.

GUYANA'S GOLDEN JUBILEE

GUYANA REPRESENTTTTT

>There were comments in the original.
Maybe because of the "// what the fuck?"

missed
b = b - 1

>The code will work fine,
Product(20,20)

b = 11

error : fuck that, above my pay grade

int x = 5;
int *x_ptr = &x; // a pointer points to an address in memory, &x = "address of x"

*x_ptr = 10; // dereferencing a pointer, equivalent to x = 10

>If the code produces the right answer, it's technically fine
cannot fabricate this excrement, famiglia

exception argument would catch that

never program in your life please.

>tfw "built" a computer at that age too
>tfw i wasn't in the newspaper
the fuck, is it because spics are pretty much considered white?

The code is fine, you guys are just sexist.

Okay.
I get it if you want to do it this way, at least if you want work with your own data types where multiplication is not defined.
But.
But why,
The hell wouldnt you use a fucking recursion to do it?
Even a monkey would see that there is a obvious pattern to it and even a easy simple recursion or a while/for statement would do the job.

Seriously why is it the case that once someone touches a keyboard his brainactivity goes straight to 0?

...

He's testing signals, not soldering.

>Seriously why is it the case that once someone touches a keyboard his brainactivity goes straight to 0?
Not true, normal programmers have no problems with this.

1st Is this real?
2nd That can only be c++ right? Don't konw any other language with that kind of syntax. Which would mean it's plain wrong

It's only women that suffer from this problem

p sure this was shopped no?

def multiply(a, b):
i = 0
c = 0
while i < b:
c = c + a
i+=1
print(c)

Slow and doesn't work

int product(int a, int b) {
if(b == 0) { return 0; }
if(b == 1) { return a; }
return a + product(a, b - 1);
}

I'm now wondering about this.
Would it be a 10,000 slide slideshow of a dude cutting down a tree?
If so, topkek.

Slow and doesn't work

>multiply routine prints the result instead of returning it
>requires O(b) instead of O(log b) additions
0/10

I "built" a computer at 11 by saving lunch money and doing chores and shit, I even bought a second hand CRT so I had more money for the PC.
And in those days computers weren't exactly like LEGO.

Nah i have also seen it several times in university.
Yeah, there are still luckily people with common sense but the amount of people without any common sense is supprisingly high.

Redundant b==1 case

Doesn't work for negative integers

#
>unnecessary variables
>printing
average python """programmer""" ladies and gentoomen

why two base cases?

WHIZKIDZ AN SHIET

>his

What's wrong with printing?

It doesn't compose. You can't use this method in another method that requires multiplying things.

multiply :: (Ord a, Integral a) => a -> a -> a
multiply a b
| b < 0 = - multiply a (-b)
| b == 0 = 0
| odd b = a + r + r
| even b = r + r
where r = multiply a (b `quot` 2)

-- Testing
propMul a b = a * b == multiply a b


λ import Test.QuickCheck
λ quickCheck propMul
+++ OK, passed 100 tests.

lambda a,b: eval('+'.join([str(a) for x in range(b)]))

I built my first computer when I was 9 and it was a 486.

>doesnt work with negative integers

>just started programming
>mad that im a beginner
have to start somewhere clown

>mac
Why am I not surprised.

>Constructing a string at runtime, parsing and JIT compiling this
Jesus fucking christ, hats off for finding the worst possible fucking “solution”.

Also still doesn't work for negative b :^)

>doesnt work with negative integers
Now try multiply(2, -9)

...