Your first code review 😬 #coding

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

"it's your second week in a sparkling water company"
Turning algaes into algoes.

HistoricaHungarica
Автор

Array ordered by vibe: [0, 4, 2, 3]
Here's the reasoning:
0 has a calm, neutral vibe, representing nothingness or a clean slate.
4 has a balanced, even vibe, symbolizing stability.
2 feels dynamic but stable, representing duality or balance.
3 has an energetic, odd vibe, suggesting creativity and spontaneity.

ChadGauthier
Автор

Ah yes, the Python philosophy—if it's worth doing, someone has already done it right (and you should be importing _their_ implementation).

GSBarlev
Автор

It is fairly important for programmers to understand that Big O notation is not about the time it takes to execute an algorithm, it's about how the time to execute grows as you add iterations of the algorithm.

Just because an algorithm executes in linear time doesn't mean it's faster than the algorithm that executes in exponential time. It does mean there is a point where the linear algorithm is faster, but there's nothing that says that point can't be more iterations than there are atoms in the known universe.

jeffwells
Автор

"Order this array by vibe" -- literally choked on my tea. It would be so embarrassing to die by YouTube Short

hagstruan
Автор

“It runs in linear time… but not in a good way”

the-official-tomato
Автор

I believe they meant setTimeout(() => console.log(n), n)

console.log(n, n)) doesn't sort

sadanyagci
Автор

I had a co-worker who kept asking me if I thought his code was "eclectic". He really wanted to be told it was "eclectic". I told him that yes, it was the most "eclectic" code I had ever seen! I still wonder what he thought "eclectic" meant.

davea
Автор

The “Oh you fixed it 😁… Oh Umm 😬 well now it’s wrong” haunts my dreams

frewdy
Автор

If I wanted the answer to be wrong I would've asked ChatGPT 😂

drewzero
Автор

The funny thing is that the mismatched closing parenthesis means that this code DOESN'T work. I absolutely don't mean this as a criticism – I just figured it'd be good to give an explanation for anyone curious:

The goal of the code is to do a bizarro sort, so it's trying to make each number wait that many milliseconds before the number gets logged (a value of 3 gets logged in 3ms, etc.). Because this happens via the macro-task queue, all numbers are guaranteed to get queued up before any of the console.logs get a chance to run. But the parenthesis mismatch means that instead, all the setTimeout calls will log the same number twice, and the function calls all wait 0ms (there's no longer a timeout duration being passed in, so it defaults to 0). Because they're all resolving at the same time, JS does a tie-breaker by running the functions in the order they were queued up. In other words, we log the original array elements in the exact same order that they started in, but now we're printing two of each value

Still an accurate representation of actual code reviews because a mismatched parenthesis 100% could've gotten a LGTM

DubiousNachos
Автор

This sleep sort actually has a bug and doesn't even work :P

Urizieli
Автор

As a tech lead this is so spot on 😂. Or like when you have to bring up something like "this is good, but have you thought about authorization? Currently anyone can destroy all the users" 🙃

een_schildpad
Автор

Nothing will ever beat that one class I wrote during my internship, which does the most bizarre math so that your scroll bar stays in the same place when a new item is added.

MechMK
Автор

first (sleep sort) has constant time complexity because not depends on len of array but maximum value.
second (gpt sort) has O(n^2) complexity because self-attention mechanism requires computing attention scores between all pairs of tokens in the input

wolk
Автор

I have no idea what your saying… but the way you say it is so entertaining, I keep watching, and so now the algorithm thinks I know how to code.

caitie-takes
Автор

“sometimes say never” needs to be a thing 😂😂

ericc
Автор

“It’s faster, but it’s wrong”
I need that on a stamp.

PointySword
Автор

there's also stalin sort algorithm too, where you eliminate the ones that aren't in order

rosyidharyadi
Автор

sleep sort isn't even constant time, it's just that you're offloading the actual sorting to the js task scheduler :D

ThatJay
join shbcf.ru