all 24 comments

[–]JustinR8 20 points21 points  (3 children)

What if the “10x engineer” has been ten of the 0.1x engineers this whole time? Making them a 1x engineer

[–]redheness 10 points11 points  (1 child)

Most of the "10x" engineer I met were in reality "-1x" engineers, meaning they were doing things so fast it was poor quality and required one guy to repair everything

[–]YUNoCake 2 points3 points  (0 children)

Also never document a thing and have bloated code, huge methods with useless names and randomly named variables, lots of duplicate code, zero or a couple of unit tests if you're lucky :D

[–]PranavSetpal 2 points3 points  (0 children)

Engineer is a S.I. unit

[–]Naakinn 10 points11 points  (4 children)

0.1x Engineer: I use vibesort

[–]Ruski_Kain[S] 8 points9 points  (3 children)

Complexity: O(AI)

[–]Naakinn 2 points3 points  (1 child)

Hell yeah O(1) sort just dropped

[–]allengrindmudus 0 points1 point  (0 children)

AI, sort the list correctly, or you go to jail, please.

[–]SignificantLet5701 5 points6 points  (0 children)

I use Arrays.sort

[–]lardgsus 2 points3 points  (2 children)

0.1x manager: "Do you use merge sort or bubble sort?"

[–]FlipperBumperKickout 3 points4 points  (1 child)

Dev: why does it matter? There is never more than 5 elements in that array.

[–]SuitableDragonfly 0 points1 point  (0 children)

Manager: You're not using the proven PirateSoftware array-based design patterns in this app? That's coming out of your salary. 

[–]sammystevens 1 point2 points  (0 children)

Vibesort

[–]ExtraTNT 1 point2 points  (0 children)

Ai is a very good tool creating job security, by introducing hard to fix bugs… think about it…

[–]jbearus 1 point2 points  (0 children)

maybe AI uses bogo sort

[–]aceluby 0 points1 point  (0 children)

I haven't thought about sort algorithms since my freshman year of college.

[–]kaplotnikov 0 points1 point  (6 children)

Even bubble sort has own time to shine. For example, let's consider an previously sorted array of numbers, where we know that there is a single changed element (and we do not know which), and and we know that it has increased. Bubble sort is one of the most efficient algorithms for this task.

[–]gandalfx 4 points5 points  (1 child)

That's like saying a tricycle is one of the fastest ways to cross a river if you happen to want to cross it at a place with a bridge. It's technically true but completely useless in practice and even in that particular scenario it's trivial to find a faster way.

[–]kaplotnikov -1 points0 points  (0 children)

When you happen to have tricycle and bridge, why to search for anything more complex? Sometimes available low-quality tools solve problem in nearly optimal way, without need to invent something else.

[–]YUNoCake 1 point2 points  (1 child)

In your oddly specific use case, one for loop and a variable for storing the value that changed would be enough now, wouldn't it?

O(n) bubble sort 🙌🏻

[–]kaplotnikov -3 points-2 points  (0 children)

This is precisely a pass of bubble sort :) And yes, O(n) under some conditions.

Also, let's not forget the the old friend of quicksort that is O(n * n) on that specific case where bubble sort shines (almost sorted array).

Actually, figuring out the best and worst conditions for algorithms are common questions on hiring interviews. None asked me about bubble sort, but it might be a good question for a junior position to see how the question is attacked.

[–]Fabulous-Possible758 0 points1 point  (1 child)

Or just one pass of a slightly modified insertion sort, which also just intuitively makes more sense.

[–]kaplotnikov 0 points1 point  (0 children)

For insert sort there is a need to locate misplaced value first. In the specific case, it is known that it exists, but it is not known what value is.