Lmfao

Lmfao

Attached: Screenshot_20181008-140131.png (1920x1080, 1.08M)

Other urls found in this thread:

youtu.be/lIFE7h3m40U
youtube.com/watch?v=zp4BMR88260
youtube.com/watch?v=lIFE7h3m40U
youtube.com/watch?v=B4RQmHw8EKU
twitter.com/NSFWRedditImage

What's wrong with that

no comments

>needing comments for that code

kys

Do you know what comments are for?

>using var

Attached: brainlet_js.jpg (1052x1052, 76K)

Is that the Regex that's not in quotes?

That seems to be an editing mistake.

good channel

Attached: 20181008-140131.jpg (348x388, 31K)

Attached: file.png (74x38, 5K)

you dont write comments for self-explanatory code

Retards like you.

This is what's wrong with it.

Attached: file.png (923x275, 242K)

Attached: 20181008-140131.jpg (700x728, 60K)

you don't argue with someone who got double dubs faggot and you should comment your code because people have actual work to get done

Tom Scott is cool I like his videos

Attached: bait 7.png (500x500, 18K)

for (var testWord of words) { testWord.length

brainlets

>double dubs
sorry, i didn't know minors were allowed on Jow Forums

someone explain

Attached: file.png (967x267, 50K)

Don't make fun of based Scott, he clearly states why this code is bad and asks the viewer to I'm prove on it..

Attached: 0_15b6fc_d7f09092_orig.jpg (720x930, 196K)

brainlets

Attached: 4uu34356.png (667x870, 156K)

bad_letters = ['g', 'k', 'm', 'q', 'v', 'w', 'x', 'z', 'i', 'o']
longest_acceptable_word = ''

with open('words.txt') as file:
words = file.read().split(' ')

for word in words:
if len(word)

if you're talking about the mismatched formats, he obviously did so for the code to fit on the screen

>I'm prove on it

Attached: ishygddt.jpg (663x603, 85K)

I'm talking about the continues

>does not know how to spot and check

youtu.be/lIFE7h3m40U
>What about Linux?
>NO

Absolutely based Brit destroys lincucks

What's wrong with getting invalid cases out of the way first?

Whats wrong with his eyes?
Dude looks uncanny...

post.ts = timestamp();
post.id = new_post_id();

second post handled by worker thread 1, timestamp=47s then gets preempted by the OS scheduler.
first post handled by worker thread 2, timestamp=48s, postid=...61, no preemption.
worker thread 1 is rescheduled, postid=...62.

nothing, but it should just be an if statement surrounding longestAcceptableWord = testWord;

He is commenting actively.

You retards do know what's going on, right?
>I wrote this to be bad but explanatory on purpose
>Autistic underdeveloped anons on Jow Forums make for without context

youtube.com/watch?v=zp4BMR88260

Attached: Laughing Whore.jpg (762x900, 161K)

Linus Torvalds shouldn't be writing bad code.

Nice. Upvoted!

I see makes sense. Thanks user.

>should just be an if statement surrounding
how to spot a fag that never worked with real code

eww,

redact = %w{ g k m q v w x z i o }
longest = String.new

words = (File.read 'words.txt').split /\s/
words.each { |word| (longest = word) unless word.size

He's a soulless (((Anglo))) kike thirsting for Germanic blood once again. Doesn't help he's in a nation full of these "people".

Attached: ((((Anglos)))).jpg (720x485, 55K)

germanic people aren't white

lmao.
> how many angels fit on the head of a pin?

you could probably do all of that in 2 lines with haskell

I wonder who's behind this (((post)))

What's so funny? He made a good job explaining thing, are you just jealous?

const longestWord = fs.readFileSync('words.txt').toString()
.split('\n')
.filter(word => word.match(/[gkmqvwxzio]/i))
.sort((word1, word2) => ( word2.length - word1.length ))[0];

This is the official Jow Forums way

No offense bro but this is yikes
words.each { |word| (longest = word) unless word.size

In this case it doesn't matter either way since the program is so small but in most cases you do not want if statements to wrap your function.

>node
>var

Attached: 1521660213114.jpg (947x1024, 83K)

The condition is redundant. there's no else it just checks for no reason and then continues like any other case.

In other words the last word in the file is going to be longestAcceptableWord no matter what.

you're redundant

Attached: 608.jpg (709x765, 67K)

>long identifiers
stop this
I know there are faggots here that do that
stop

>A lot of techies are surprised when I say I mostly use Windows.
>Why would anyone who writes code and edits video use Windows?
>Two reasons: one, it's cheaper. And two: it lets me bodge.

>Mac and Linux folks in the comments, are going to be going, "Oh yeah... All you have to do is connect the flumberboozle to the GKX virtual port, then write a--"

>The greatest bodge I ever pulled for that TV show involved, and I swear this is true a voice synthesiser and a copy of Sibelius on a Mac being remote-controlled by AutoHotKey on a Windows PC, which was blindly dragging the mouse around doing pre-recorded movements through a remote desktop connection, while another PC fired commands to a Google Chrome window open on the Mac over Wi-fi, because AppleScript and all the similar tools for Mac that we needed to run on Sibelius just weren't up to doing something that ridiculous.
>By the way, if anyone out there suggests using Linux... no.

Windows is better because it's cheaper and lets you hack. Also no I won't use linux stop telling me how to do things doing my autistic autohotkey hacky shit is better.

Is he retarded?
youtube.com/watch?v=lIFE7h3m40U

Ok, listen little faggot. Have you ever written a compiler? Have you ever written an interrupt routine, you little faggot? You ever written an interrupt routine? You little faggot. No, you haven't because you're a faggot. Okay. Why don't you go write an interrupt routine faggot. Haskell? You're fucking in the ocean with some nigger in the deep ocean. Got no clue what's underneath you, you little faggot. Why don't you go write an interrupt routine?

This is an interrupt routine. I wrote my own compiler. It has an interrupt keyword. Does Haskell have an interrupt routine? Can you write an interrupt routine in haskell with an interrupt keyword? Huh? Can you write an interrupt routine in haskell? Do you know what an interrupt is, you little faggot? Everything you know about haskell is something I know about interrupt routines.

i like his videos but he seems like a smug twat

>Have you ever written a compiler?
Sort of. I wrote a macro in assembly so that I can produce image files from flat binary and assembly source code without having to rely on a linker or compiler. I can cut out of a lot of bloat doing that too.

Does js not have a filter function

>O(n log n)
see me after class

based and redpilled

ew

const fs = require('fs')
const words = fs.readFileSync('words.txt').toString().split("\n")
const badLetters = /[gkmqvwzxio]/
const longestWord = words.reduce((longest, current) => current.length > longest.length
&& !current.match(badWords) ? current : longest)
console.log(longestWord)

I'm not really a good js programmer, but it can be much shorter

literally /ourguy/

this
doesn't give a fuck what others think, he just uses what's most convenient for him
I respect that

I use arch btw

>>The greatest bodge I ever pulled for that TV show involved, and I swear this is true a voice synthesiser and a copy of Sibelius on a Mac being remote-controlled by AutoHotKey on a Windows PC, which was blindly dragging the mouse around doing pre-recorded movements through a remote desktop connection, while another PC fired commands to a Google Chrome window open on the Mac over Wi-fi, because AppleScript and all the similar tools for Mac that we needed to run on Sibelius just weren't up to doing something that ridiculous.
/ourguy/

Not op, but it reads the whole file into memory just to linearly iterate over its lines. Not that cringeworthy if it's not in production.

>sort(...)[0]
Never do this

in c++ this is just
const expr = IteratorStream(words.begin(), words.end() | Filter( letterMatch) | Foldl(findLongest);

std::cout

Attached: Illya 1162 (XA).png (640x853, 481K)

in c++ this is just
const auto expr = IteratorStream(words.begin(), words.end()) | Filter (letterMatch) | Fold(getLongest);

std::cout

Attached: Illya 1132 (FP).jpg (800x1186, 558K)

Attached: senpai.gif (426x214, 1.03M)

its just n+ ologn vs n
like, with 1 billion words its 50 comparisons more efficient assuming its inplace

who gives a fucking shit you knob head. acting superior for simple little things like this, that really don't make a lick of difference.

what a fucking mong.

this is like one line of LINQ.
But the code in the video was only an example that's supposed to be easy to understand, you autists.

wrote that one liner LINQ.

...

Fuck off, Scott. I'm not gonna do it for free.

dekinai

>What's wrong with that

not using
minlength = longest.length
for ... {
if (word.length > minlength && !word.match(badLetters)) {
longest = word
}
}

>t. never written a line of production code before

.sort((word1, word2) => ( word2.length - word1.length ))[0];

>not using max()
pleb

File.ReadAllLines("dict.txt").Where(w => !Regex.IsMatch(w, badLetters)).OrderByDescending(w => w.Length).First();
Note

Dumb phoneposter

He's using for...of which means this is EMCAScript 2015 which means he should have used const, or at the very least let.

Are you high? That's not C++ unless you are using some unnamed library that I've never heard of before. Shame on you.

>Windows is better because it's cheaper and lets you hack
he talks about macos

and linux is not even a consideration, hence the "No, just no" reply. You can set up a pretty terminal with emojis in your prompt and rice the shit out of your desktop, but it won't change the fact that gimp is still shit, or that drivers, video and others, still suck ass, or that gnome is still the defacto DE face of linux while being a bug ridden slow clunky piece of shit, that STILL DOESNT HAVE THUMBNAILS IN FILE PICKER. Linux is great on many things, but on desktop it's a complete failure.

>repeatedly says this is not good code
>repeatedly this code should not be used in production
>repeatedly says this code was done the easy way
>repeatedly says he chose to have code easy to explain
>every single fucktard in this thread points how his code is not perfect
Jesus Christ, is this so hard for you to understand he addresses a larger audience in which most people will still look at this code as if it’s wizardry?

yikes...

>he talks about macos
no he's not

you seriously think ordering is a good way to find a maximum, you dumb fuck

The second part of the challenge is to find the longest x words you retard

Regex don't need to be in quotes in Javascript, the surrounding forward slashes make a regex literal.

Not for code like this.
>people have actual work to get done
And I have work to do which doesn't involve needlessly commenting self explanatory code.
If your code needs comments, except for a very good reason, then you're retarded anyway.
>should
No, fuck off.
This is a technology board, not art class.
The camel fuckers need to show off just how ugly their naming scheme is by taking it to its logical extremes by making their identifiers long as fuck.
You know, because renaming badLetters, longestAcceptableWord and testWord to reject, longest and word would have severely hurt readability.
Yes, I looked into it and he should have been able to use some existing software to make his emoji keyboard work on linux without any issues.
But I guess he only knows javascript and ahk.
I think using the excuse of connecting 10 keyboard to a computer as a good reason for him to use windows for all his other projects is a bit telling, he doesn't actually have an argument, he's just too comfortable with windows and doesn't want to learn linux. And that's fine, but he should say as much instead of smearing things he doesn't understand.

FUCKING JAVASCRIPT IM TRYING TO LEARN THAT SHIT BUT ITS SO DAMN FRUSTRATINGLY HARD

Attached: latest.png (559x360, 211K)

'its cheaper'
puzzled. you have to buy it for 1.
2. because it is such bloat/a kludge,
badly written .. you need xpensive (new,fast)
hardware to have it run satisfactorily

.. linux runs well on any old shit
there are small, fast linuxi. Even the standard issue linuxi (ubuntu,mint), are smaller, faster. if you're metered, it costs $s to maintain windows, cos the updates are so large, so frequent. It's huge, bloat. This is before you get to the productivity issue. The issue of the os treating you like an idiot all the time 'are you sure' etc etc. The issue of the huge amount of time it takes to install/configure. Llnux is cheaper to get/run/maintain absolubtely.

It's not that hard. There's many much harder languages out there. Just do it bro

It's rather easy. It's retarded how he didn't se ECMAScript 6 variables like const or let. At least he didn't use old crappy functions, because arrow functions are superior.

youtube.com/watch?v=B4RQmHw8EKU

Attached: maxresdefault.jpg (1280x720, 20K)