So this is the power of web devs

So this is the power of web devs...

Attached: web.png (900x495, 163K)

Other urls found in this thread:

css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/
bugs.chromium.org/p/v8/issues/detail?id=2229
twitter.com/SFWRedditVideos

Explain whats wrong with this.

Your face when forEach will be faster than for in the next js version due to visionaries like this guy.

>JavaScript

Indeed
css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/

for loops are obviously the default way of doing that so expect even the shittiest compiers to optimize that
besides if you really care about such microoptimizatins you wouldnt be using js in the first places

I don't think you understand what being a code artisan is about. Code is more than just speed and optimization. It's power and beauty, the human existence expressed in plain text. Sorry to break it to you, but aesthetic code is more important than performant code. The boomer programmer is dead. We don't write code, we make art. Deal with it.

disregarding the fact that you should never use a map outside the objective of transforming a list...
the last time this shit was posted, some user explained that there was the overhead of [n*function calls] for the functional versions

>aesthetic code is more important than performant code.
only to the cunt writing it

yeah, how long do you think that "art" concept of yours holds up? try to picture a mona lisa painted by more than 1 artisan, that besides that would by some law of programming unknown to me gone to shit after the first thousand brushstrokes (lines of code)

This is unironically the fault of functionalfags.

draw some painting or play some music, GTFO from programming

I hope the self driving car you'll eventually own crashes into a wall because it was written by a code artisan focused on (((aesthetic))) code.

forLoop is automatically unrolled into a for loop by the VM, you fucking imbecile.

But using map() instead of forEach() is also retarded.

Actually the inlining is rather recent.
bugs.chromium.org/p/v8/issues/detail?id=2229

>Coding conventions are part of the patriarchy
>I just wanna express my unique identity

>bugs.chromium.org/p/v8/issues/detail?id=2229
afaik forEach() inlining in V8 has been around well before 2016.
But not for map() and other array functions which could have been treated the same.

Oh my God, fuck off and go back to r.eddit!

B A I T

This is the dumbest thing I read today. I read some stupid shit on this board, but this makes me feel dumber for simply having read it.

I doubt the performance is even noticeable unless he's doing lots and lots of data. This is also something for the compiler to handle, aside from map which has other implications than forEach.

Holy shit

It actually makes some sense. The only difference between map and forEach is that map returns an array based on the individual returns of the called functions. There's really no point in having separate map and forEach functions, you can do everything in map. And using 'for' loops is ugly in the sense that it brings in implementation details that are unsuited to the (normally) high-level code that they are surrounded by.

VERY nice bate

Why allocate an array you don't need?

Saved this bait for later. Lots of (you)'s

I think that unless you're mapping over a very large array, the overhead of allocating an array of equal size is minor enough that unless you want to squeeze absolutely maximal performance out of your code, it's perfectly justified to do it in order to have more elegant code. Of course, if you're mapping over a huge array, it might be a bad idea - but that's rarely the case.

So many fucking newfags who don't realize this shit is bait/sarcasm.

He's reasoning is correct, the real problem is javascript.

Plain for loops are ugly. Most of the time, you use a for loop to perform an action on every element of a collection. You really shouldn't be bounds checking and shit to do this in a high-level language, it's just line noise. forEach and forEach loops are essentially just syntactic sugar in C++ and Java.

Very nice impression of a leftist web dev.

>it's perfectly justified to do it in order to have more elegant code
How does this result in more elegant code? Saving 4 characters per loop construct? You realize you're sacrificing readability for future maintainers who don't adhere to this convention.

Holy shit this is the best bait I’ve seen in a while

Put me in the screenshot XD

fucking newfags

Attached: pathetic.jpg (720x960, 42K)

Using map when you mean forEach also makes the code harder to read. It's an unwritten rule that a map operation generally won't have side effects, but if you use a map to do what a forEach should be used for, then by definition it has side effects (or it's doing nothing).

I only use goto.
int i = 0;

loop:
arr[i] = i;
i++;
if (i == lim)
goto exit;
goto loop;
exit:

10/10, enjoy your (You)s

7/10 bait. good job faggot

>code artisan

Attached: 1407450960134.jpg (310x310, 33K)