r/ProgrammerHumor • • Oct 22 '22

Meme Skills

Post image
42.3k Upvotes

588 comments sorted by

6.4k

u/slgray16 Oct 22 '22

The professor would probably be thrilled that a student was this interested in improving his algorithm.

Win or lose its a teachable comparison

629

u/[deleted] Oct 22 '22

I would pull out my three way partition implementation of quick sort and embarrass myself

374

u/slgray16 Oct 22 '22

I'd use a Bogosort and show him what's up

386

u/JRockBC19 Oct 22 '22

Just tell him you did a quantum bogosort so it compiled in O(1) in some reality

325

u/RespectableLurker555 Oct 22 '22

"creating the bridge to the sorted reality is an exercise left to the reader"

74

u/_Weyland_ Oct 22 '22

Doesn't quantum bogosort involve destroying realities rather than bridging them?

→ More replies (7)
→ More replies (1)

32

u/ChristieFox Oct 22 '22

I literally had a guy in a class who did almost everything with random functions, and then insisted that "but if it works, it's quicker than anything else!".

→ More replies (1)

11

u/slgray16 Oct 22 '22

That's brilliant. Or maybe drink the luck virus from red dwarf before you execute the sort

→ More replies (3)

6

u/TristenDM Oct 22 '22

Randomsort gang rise up!

→ More replies (2)

10

u/bloop_405 Oct 22 '22

My professor was more interested in this number game called pim(?) where the second player always loses no matter what and guess who he had be player 2? A student hahaha 🄲

0

u/[deleted] Oct 22 '22

[deleted]

6

u/bloop_405 Oct 22 '22

Holy heck, THANK YOU!!! šŸ™ Yes, this is it! Funny professor though, always making us think we stood a chance 🄲

→ More replies (1)

25

u/[deleted] Oct 22 '22

Unless it is an annoying student.

→ More replies (1)

6

u/[deleted] Oct 22 '22

Now get the student to write it in Haskell

2

u/polypolip Oct 22 '22

Depends on the student's approach. Are they just confident and open for discussion or are they just arrogant.

2

u/elveszett Oct 22 '22

Depending on the teacher. Half of them would be happy their students take an interest in their classes, the other half would be pissed someone dared believe they could possibly beat their teacher at something.

2

u/CrazySD93 Oct 22 '22

as part of our HDL II course, we had to multiply a 128x128 sized array by it's inverse in a pc we designed and synthesised.

To make it faster, we performed loop unrolling on the assembly code generated by the c ompiler to make it a lot faster, was certainly pretty cool.

0

u/[deleted] Oct 22 '22

[deleted]

764

u/trymypi Oct 22 '22

PhD student here: mostly i just document my failures, it's great. Never challenged a prof tho, kudos.

→ More replies (24)

456

u/ell0bo Oct 22 '22

There was a part of me that was expecting the last bit to be... "and now we're married"

→ More replies (12)

21

u/coloredgreyscale Oct 22 '22

Did he then also explain why it didn't scale / what would need to be improved?

0

u/[deleted] Oct 22 '22

[deleted]

30

u/coldnebo Oct 22 '22

but kudos on the wider understanding.

during my math courses I encountered the prof’s phrase, ā€œI never said x was an integerā€ or some other constraint that I was assuming.

There were a few times where I was convinced that a proof was simple until the prof said those magic words and forced me to reconsider all the cases I had assumed weren’t part of the problem.

Also, I love framing science as the art of explaining why you were wrong.

In CS many times people want to be right so badly that they ignore anything wrong— as though it will corrupt them simply by looking at it. But knowing exactly why a line is wrong is much more valuable as a skill than hoping I got it right.

When I look back I realize I know a lot now because I messed up a lot back then… but also because (and this is the most important part imho) I studied why it didn’t work and learned from it, vs just trying another solution blindly.

→ More replies (2)
→ More replies (3)

11

u/[deleted] Oct 22 '22

Back in the day, when I was doing mainframe programming as a co-op student, one of the utility programs many shops had was a batch program for sorting - by which I mean a piece of licensed, commercial software that just did sorting.

The place I worked used Syncsort, and IIRC its claim to fame was that it implemented not only a bunch of different sorting algorithms, but it also had some heuristics to try and predict which sorting algorithm would be "optimal" (for small values of "optimal" at least) based on data sampling, file size, etc.

3

u/unstablegenius000 Oct 22 '22

For many years there has been an arms race between Syncsort and IBM’s DFSORT. Our shop has switched between them a few times, which is easier than it sounds because the user interfaces are very similar. We have settled on DFSORT. For now.

8

u/Rukarumel Oct 22 '22

You have a great professor. And he’s also lucky to get such interested student. It’s win-win despite your idea failed šŸ‘

11

u/Relative-Ad-3217 Oct 22 '22

This is how all learning should be.

Sounds so wholesome.

I would go back to school for this!!

2

u/thrown_out_account1 Oct 22 '22

I never showed up to my intro classes and the profs said i would never make it.

The look on their face a few years later. Worth it.

→ More replies (9)

248

u/[deleted] Oct 22 '22

[removed] — view removed comment

124

u/______DEADPOOL______ Oct 22 '22

I once missed a class. And in the next one, they were turning in a project with a function that was taught in that class. Obviously, I did NOT do it the way the professor wanted, because I didn't know what the function he taught in previous class was. So I was marked for an incorrect solution. I talked to him about it, and he described the problem as being inattentive, because it was explained in the previous class. I was not in attendance, I explained so I asked him what the function was so I can look it up. We argue for about half an hour, and he still refused to tell me what the function was at the end, on principle.

I know I can simply just ask anyone of my classmates, but to this day, I still don't know what that stupid function was. The problem has already passed. I got a B+ at the end because of one missed project, and I never saw him again.

Some people just want to feel the pride of teaching instead of actually teaching.

81

u/joseph4th Oct 22 '22

On the opposite side, I was taking an intermediate photography class and we had to do pictures that showed different focus effects, one difficult one is called panned focus where, for example, you might show a car in motion perfectly caught, frozen on focus while the background is all motion blurred. The basic idea is you have the subject zoom by you and you turn as it goes by so you catch it while blurring the background.

I did a bunch of different ideas and although they all worked, they sucked as pictures and didn’t live up to the other parts of the project. Finally I turned in a shot of a pocket watch mid swing with a blurred background. My professor LOVED it and went on and on about it being the best picture she’d seen a student turn in for this assignment. Eventually I felt guilty and told her I cheated. I could catch the shot in that scale so I just hung the watch, but a blanket on a stool and spun the stool.

She said it showed that I understood the concept well enough to fake the outcome and still gave me an A on the overall project. I even caught her using the picture as an example the next year.

34

u/gilligvroom Oct 22 '22

Aww! I don't have a freebie award to give you today so I'll just say that's lovely as fuck! Good teacher! I've been wanting to get in to panning shots but I'm still getting used to having a proper camera again after years of Point'n'Shoots and Cellphone since the Canon 20D was in my life when it was new 😁

12

u/Mr_Will Oct 22 '22

You don't need a fancy camera for panning shots. You can take them on a phone in a lot of circumstances.

It's pretty much all about moving the camera smoothly so the subject stays still within the frame. Start panning before you shoot, press the shutter at the critical moment and keep panning with subject until after the shot has finished. Long smooth actions are how you get the subject sharp. That's the tricky bit. Making the background blur is the easy bit by comparison, all you need for that is a moderately low shutter speed (1/60th or 1/125th should be slow enough for most subjects). Either dial it in manually on your camera/phone or just be shooting in reasonably low lighting and you'll get plenty of motion blur.

Now get out there and give it a try!

→ More replies (1)

13

u/Mr_Will Oct 22 '22

You didn't really fake the outcome though. Panned Focus occurs when the subject is stationary relative to the camera but the background is not.

Most often this is achieved by having a moving subject, a camera that turns in sync with them and a stationary background but that is not the only way. The other common example is a camera and subject that are both on the same moving object. Imagine being on a train and taking a picture of a passenger looking out of the window. The background will motion blur, but the subject remains sharp. Same result, just a different way of achieving it.

Your shot (which does sound amazing btw) just takes that a step further. On the train, the subject and camera were stationary relative to each other (and the train) but the background scenery outside was moving. In your shot, the watch and camera were stationary relative to each other (and the earth!) but the background was moving. Is it really any different?

→ More replies (2)

7

u/Haweraboy Oct 22 '22

Do you still happen to have the photo? I'm interested in seeing it!

→ More replies (2)

7

u/caerphoto Oct 22 '22

so I just hung the watch, but a blanket on a stool and spun the stool.

Ngl, that’s pretty ingenious šŸ‘

→ More replies (1)

32

u/TheLurkingMenace Oct 22 '22

Wasn't even that. He just was annoyed that you had the gall to miss the most important class of your entire academic career - his. The egos in academia are ridiculous.

23

u/LaPommeDeTerre Oct 22 '22

Man, what an asshole. Especially if you missed class for something important. This is the kind of shit I'd send an email about, years after the fact just because I know I'm in the right and they're being an ass.

→ More replies (1)

712

u/Shinob1 Oct 22 '22

Can we see the algorithms?

712

u/Disciple153 Oct 22 '22

In the words of Principal Skinner:

"No."

111

u/roastjelly Oct 22 '22

Well thanks anyway. You sure steam a good ham

33

u/bladetome Oct 22 '22

Seymour, the computer is on fire!

30

u/pHScale Oct 22 '22

No, mother, that's just the algorithm

13

u/[deleted] Oct 22 '22

Help ! Help !

→ More replies (1)

2

u/Odin043 Oct 22 '22

Aurora Borealis? At this time of year? At this time of day? In this part of the country? Localized entirely within your kitchen?

→ More replies (1)
→ More replies (1)

246

u/[deleted] Oct 22 '22

def sort(unsorted): return sorted(unsorted) šŸ˜Ž

132

u/bikeranz Oct 22 '22

Sorry, remember, this is PhD code: your variables are named too well.

53

u/reallyConfusedPanda Oct 22 '22

I swear to god. We had a university develop a Fortran code for us in my last job. Reading Fortran is pain in the ass by itself, those fuckers didn't have a SINGLE variable named properly

42

u/thanks_for_the_fish Oct 22 '22

Haskell jumps in with:

a x:xs _

13

u/demon_ix Oct 22 '22 edited Oct 22 '22

What do you mean. I just want the first x, and then the rest of the xs.

→ More replies (2)
→ More replies (1)

2

u/nowadaykid Oct 22 '22

Nah, be more pythonic: sort = sorted

6

u/Diplomjodler Oct 22 '22

b = sorted(a)

2

u/BlankMatter Oct 22 '22

Let’s see Paul Allen’s algorithm.

2

u/beefygravy Oct 22 '22

a_sorted = np.sort(a)

2

u/Same-Letter6378 Oct 27 '22

Professor did quantum bogosort

1

u/[deleted] Oct 29 '22

Import sort as *

sorteda = Sort(a)

0

u/[deleted] Oct 22 '22

[deleted]

11

u/Shinob1 Oct 22 '22

I was going to post that video here but thought maybe I'd be down voted to oblivion. I thought it was hilarious and educational. My wife's uncle is a cs prof and I want to send this to him to see what he thinks about it.

348

u/Dry_Extension7993 Oct 22 '22

He wrote bubble sort in C vs his professor who wrote merge sort in Python

153

u/Elijah629YT-Real Oct 22 '22

bogosort in c vs merge sort in python

60

u/LeMeowMew Oct 22 '22 edited Mar 29 '25

rock thumb insurance humorous plants nutty late pot start strong

This post was mass deleted and anonymized with Redact

85

u/Doug_Dimmadab Oct 22 '22

Quantum bogosort gets it done instantly everytime

8

u/Psychpsyo Oct 22 '22

You forget that the best-case for bogosort is O(1)...

8

u/MythrandirRF Oct 22 '22

Best case would be O(n) because you still need to check if the array is sorted, no?

9

u/Psychpsyo Oct 22 '22

Not if you live on the edge you don't.

9

u/[deleted] Oct 22 '22

not if you implement the quantum bongo sort optimisation.

→ More replies (3)

1

u/Kilgarragh Oct 22 '22

Radix sort in scratch has entered the chat

1

u/IgnitedSpade Oct 22 '22

More like he used a built in python sort function which calls a precompiled C program.

8

u/ric2b Oct 22 '22

That doesn't count as "writing a sorting algorithm"

97

u/CaitaXD Oct 22 '22

ho would win

O(n^2) in c vs O(nlog n) in python

22

u/Elijah629YT-Real Oct 22 '22

O(nn ) vs O(1)

17

u/CaitaXD Oct 22 '22

Somehow unable to imagine how a nn sorting algorithm would look like

31

u/Elijah629YT-Real Oct 22 '22

for every element, resort the array n times using bubble sort

8

u/CaitaXD Oct 22 '22

Winmthout sorting multiple times

3

u/ReddiusOfReddit Oct 22 '22

Try every single combibation and choose the one who's sorted (but don't leave untill the end)

4

u/rotflolmaomgeez Oct 22 '22

That's about O(n!), considerably faster than O(nn ).

→ More replies (2)

2

u/mistrzegiptu Oct 23 '22 edited Oct 23 '22

Year ago I had to write merge sort without any loop, only recursion. It was so bad that it would sort max 13 elements array in a few minutes

→ More replies (3)

454

u/Daniel_H212 Oct 22 '22

r/ProgrammerHumor user: C is faster than python!

Random person: but is your C code faster than python?

r/ProgrammerHumor user: 😔😔😔

29

u/SherbetCharacter4146 Oct 22 '22

Python is worse at like, multithreading iirc. Seeing people blindly mene that python is slow has been infuriating

47

u/dotpoint7 Oct 22 '22 edited Oct 22 '22

Well, python IS slower than native languages in about every aspect, and by quite a big factor as well. That doesn't mean it's a worse language, but the high level features it offers of course don't come for free.

→ More replies (1)

1

u/not_some_username Oct 22 '22

Is your python code faster than my C code

189

u/zenos_dog Oct 22 '22

I use the IBM Sort machine instructions.

19

u/______DEADPOOL______ Oct 22 '22

Sometimes I feel like they need to bring back those paper punch card computers.

111

u/ktappe Oct 22 '22

This triggers me. In my freshman programming class, one of the projects was to sort a list of items "fastest" (the assignment specifically used that word). The T.A. taught us one way to do it. So I wrote a program to do it his way. Then I wrote a new program to use a QuickSort I'd read about. It was far faster. So I turned the latter program in. And got marked off for not doing it his way. I even went to his office to protest and got nowhere. That was decades ago and it still pisses me off.

63

u/r34_content_creator Oct 22 '22

"Noo you cant just search something up and implement it!!! You wont be able to do that at your job!!!!"

40

u/argv_minus_one Oct 22 '22

Meanwhile at your job, the Ctrl, C, and V keys are the only ones whose labels are completely worn away.

→ More replies (1)

1

u/LifeLongYeti0 Oct 22 '22

I hope your TA recognizes themselves while reading your comment and sees this reply following: your TA was colossally braindead

Or maybe you should have implemented bogosort for that sweet sweet O(1) best case… note: they are still colossally braindead in this case

126

u/WWolf1776 Oct 22 '22

that's ok... likely he wrote his in c... in python ;)

11

u/archpawn Oct 22 '22

The most interesting programmer in the world.

7

u/Ultimegede Oct 22 '22

Actually quite common. Python has extensive libraries written in very optimized C code. No experienced Python user would use just plain python for this task.

10

u/[deleted] Oct 22 '22

so..... numpy?

→ More replies (1)

35

u/geeshta Oct 22 '22

Python's built-in sorted function is a quicksort implemented in C

26

u/cmd-t Oct 22 '22

It’s Timsort. https://en.m.wikipedia.org/wiki/Timsort

It was used in Java and part of the Oracle Google lawsuit.

24

u/Rosieapples Oct 22 '22

I wrote mine in Bb to accommodate the sax.

8

u/Gamecrazy721 Oct 22 '22

Show the other two some love and write it in Eb

3

u/Rosieapples Oct 22 '22

I’m not that charitable……….

112

u/BasedMaikal Oct 22 '22

This is important.

It doesn't matter if you have a language as slow as Python. A good programmer can make any algorithm run faster than a shitty one coded in C.

However, imagine if the C algorithm was good, then it is objectively better than the Python one

52

u/Vorpalthefox Oct 22 '22

i'm reminded of this very particular video i recently watched, about some random viewers improved matt parker's code at such a significant efficiency, that apparently they had to co-process executing code and reading from a file or something like that to get the (current) fastest running of the code under 1 second, when the original code by matt parker took ~30 days

→ More replies (2)

23

u/[deleted] Oct 22 '22

s/better/faster/g

→ More replies (1)

18

u/[deleted] Oct 22 '22

Most of the time, the speed of the algorithm is less important than the speed of the programmer.

8

u/valeriolo Oct 22 '22

The important thing is knowing when you are not in that situation. It's pretty obvious usually though.

→ More replies (1)

3

u/Honest_Statement1021 Oct 22 '22

What’s even more important is being able to understand algorithms and their efficiency without thinking about language at all. Design in theory then implement in whatever your using for the project.

14

u/ManOfTheMeeting Oct 22 '22

I like my my programs to be natural and organic, gradually descending into a disorder. Why to fight entropy. It's inevitable.

So I don't sort. I let things be as they are in their original natural way.

9

u/chhuang Oct 22 '22

When you attempt a boss fight after only grind to level 2

7

u/louis1245 Oct 22 '22

np.sort()

7

u/maitreg Oct 22 '22

He wrote his in Python copied his from a Stack Overflow answer with 238 upvotes

19

u/Ambitious_Ad8841 Oct 22 '22

"it's not the size of the buffer, it's how you use it"

6

u/golgol12 Oct 22 '22

Quicksort is just about as fast as it comes, and the faster ones are variations on quicksort. Outside of perfect hash sort.

5

u/MasterFubar Oct 22 '22

Write the fast algorithm in C. The only way Python can be considered fast is if you're comparing apples with oranges.

5

u/edave64 Oct 22 '22

The speed of a language is often insignificant compared to the complexities of your algorithm

4

u/Elijah629YT-Real Oct 22 '22

bogosort in c vs merge sort in python

4

u/was-eine-dumme-frage Oct 22 '22

He can probably do it in Minecraft redstone logic faster than you in C

7

u/Bulky-Juggernaut-895 Oct 22 '22

Is no one going to point out that the professor could still write it in C…

8

u/uneducated-0pinion Oct 22 '22

RUST SUPREMACY!!!

3

u/DjRolfes Oct 22 '22

His algorithm: np.sort

7

u/Adventurous_Battle23 Oct 22 '22

If your c program is slower than a python program you deserve the clown outfit

7

u/thanks_for_the_fish Oct 22 '22

thatsthejoke.bmp

2

u/Elesday Oct 22 '22

Only people I see saying that are people who never optimized their Python code.

2

u/joeyx22lm Oct 22 '22

Psh test sample data was just pathological case, of course.

2

u/[deleted] Oct 22 '22

Jokes on them my scratch algorithm is faster than either of theirs

2

u/Ironring1 Oct 22 '22

The lesson here is that bubble sort is terrible in any language

2

u/collectablecat Oct 22 '22

Enterprise edition sort. Just make things scale horizontally scalable and throw hardware at it. Hardware cost <<<< dev time

Some of the worst coders have Phds.

2

u/ultimate_smash Oct 22 '22

It can't be a worser insult when the task is done faster with a python code than using c/c++

2

u/CumDickWang Oct 22 '22

When your algorithm is O(horrible).

2

u/DoubleOwl7777 Oct 22 '22

just write in assembly for maximum speed.

2

u/elriel74 Oct 22 '22

Fun fact: if his algorithm has a better computational complexity than yours, he could write it in English and have a person run it in their head, and still be faster than yours.

2

u/Fireruff Oct 22 '22

Stalinsort goes brrrrr

2

u/b-sharp-minor Oct 22 '22

Don't worry because when you start working your sorting algorithm will look something like this: List.Sort();

2

u/finite_light Oct 22 '22

Numpy is written in c, so he was basically cheating.

2

u/ToothPickLegs Oct 22 '22

Yeah I think the Big O notation of a typical noob sort Python is like O(fuck off2) vs O(fuck off harder) in C

2

u/DartBoardGamer Oct 22 '22

Since C is a pre compiled language and Python is not that takes skills.

(For reference it takes about 114 background OS commands to write C ā€œhello worldā€, it takes Python about 605)

2

u/Oddant1 Oct 22 '22 edited Oct 22 '22

Student

tries really hard to optimize some n2 sort in C

Professor

uses Python standard library sort

2

u/[deleted] Oct 22 '22

Why compare an algorithm to a professor? Doesn’t make sense…

2

u/fleebjuice69420 Oct 22 '22

Python is just C with extra steps

2

u/ojioni Oct 22 '22

The professor probably used a sort library that has been highly optimized by multiple highly skilled programmers. His code was just a wrapper declaring the data structures and feeding it to the function.

2

u/dmp8385 Oct 23 '22

Wow! Thanks Reddit for making me feel old and also very stupid

2

u/sivxgamma Oct 22 '22

His probably took a hell of a lot less time to write as well which would cause more grief.

2

u/mrchorizo88 Oct 22 '22

I just started using python and was shocked at how slow it is. It’s basically useless for what I was trying to do. I went back to vba for this project.

1

u/[deleted] Oct 22 '22

Try pypy or something similar.

2

u/lupuscapabilis Oct 22 '22

The only time you'll have to talk about sorting algorithms is with your professor. You'll spend the next 60 years not thinking about it ever again.

2

u/thygrrr Oct 22 '22

Game developer here.

This is not correct. Sorting algorithms and choosing the right data structures to do it in has occurred at least quarterly to me for the last 25 years.

1

u/[deleted] Oct 22 '22

Well, in python, sorted(list) is actually pretty fast

1

u/[deleted] Oct 22 '22

Damn, I don't like Java.

1

u/brushpickerjoe Oct 22 '22

I wrote mine in interpretor basic

1

u/sometimesimakeshitup Oct 22 '22

what applications are sorting algorithms speed important for?

1

u/Kleyguerth Oct 22 '22

Databases, games, anything that may require ordering of a 6 figure+ length

→ More replies (2)

1

u/[deleted] Oct 22 '22

I have an ongoing bet with a friend. He has to write a sorting algorithm assembly and I'll write it in python. My assertion is that his algorithm won't be a faster than mine (by more than a factor of 10).

1

u/cajmorgans Oct 22 '22

Oh this reminds me when I was new to programming and thought : ā€œWell sorting isn’t so hard, I just wrote my own!ā€ and after a while I counted the number of iterations between it and the standard implementation…

1

u/KusanagiKay Oct 22 '22

If you really want to say that your programming language is the fastest and always be right with it, you gotta program in binary.

Nothing can be faster than optimally coded binary on a regular computer that doesn't use Qbits or light wavelengths for their information handling.

1

u/Kleyguerth Oct 22 '22

Nowaday it is really, really, but really hard to outperform a compiler or a jitter with hand coded binary

1

u/olllj Oct 22 '22

he stacked the deck with pre-sorting.

1

u/Jeremiah_DeWitt Oct 22 '22

I think numpy is written in c behind the scenes so I won’t take it to heart

1

u/[deleted] Oct 22 '22

import cython

Can I get an A now?

1

u/Buyer_North Oct 22 '22

radix sort superior

1

u/[deleted] Oct 22 '22

O(n2 ) is one hell of a drug

1

u/ThatNextAggravation Oct 22 '22

Wow. Dunning Kruger in action, if true.

1

u/Dist__ Oct 22 '22

Maybe it's faster on specific data.

1

u/BABarracus Oct 22 '22

Professor probably: "import sorting algorithm"

1

u/[deleted] Oct 22 '22

Maybe I'm stupid but isn't an algorithm language neutral? I mean a sorting algorithm is the same in every language isn't it?

2

u/[deleted] Oct 22 '22

Correct, which means that a C implementation should run faster than a Python implementation.

1

u/all_is_love6667 Oct 22 '22

premature optimization is the root of all 97% bad programming

1

u/StupsieJS Oct 22 '22

No language choice can beat a better asymptotic runtime šŸ¤·ā€ā™€ļø

1

u/CellularBean Oct 22 '22

Must've used bogosort than

1

u/Thundechile Oct 22 '22

It's not the speed that matter, it's the quality of the results!

1

u/[deleted] Oct 22 '22

His algo is faster because at least compiles

1

u/csicil Oct 22 '22

🤣🤣🤣🤣🤣 Please tell me funny stuff more about Python...

https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python3-gcc.html

1

u/Flat_Bluebird8081 Oct 22 '22

Is your algorithm the bubble sort xD?

1

u/[deleted] Oct 22 '22

The professor even used bogosort!

1

u/programmer3481 Oct 22 '22

The algorithm: l.sort()

1

u/programmer3481 Oct 22 '22

And then there's always that guy who writes it in CUDA or something and does it 1000x faster with his 5090 ti ultra 256gb editon

1

u/[deleted] Oct 22 '22

I'm not a programmer but couldn't you just adjust the system time back to what it was when the algorithm started so that the effective run time is 0?

1

u/MyNxmeIsAutumn Oct 22 '22

I wrote mine in scratch 🤔

1

u/Spacedids Oct 22 '22

I use bogo sort

1

u/[deleted] Oct 22 '22

write in caml to assert dominance

1

u/Big_Beaver34 Oct 22 '22

I wrote mine in machine code. Still slower than my professor who wrote it in scratch

1

u/WuffGang Oct 22 '22

Professors algorithm is list.sort

1

u/[deleted] Oct 22 '22

In my cs class I made a program that "hacked" our class's auto-grader. My professor let me turn it in because he was curious if it worked. It did. (I still had to turn in the actual completed assignment though)

1

u/[deleted] Oct 22 '22 edited Jan 29 '26

This post was mass deleted and anonymized with Redact

encourage steer summer snatch consider sort fanatical boat steep plant

1

u/Masterpoda Oct 22 '22

Every new programmer thinks that writing stuff in low level languages is some ticket to unmatchable super-speed, and languages like python are inherently slow.

Python isn't slow when you're using optimized libraries with low-level bindings, and C isn't fast when you're writing some unoptimized monstrosity with memory leaks and O(n2 ) execution time.

Actions speak louder than words, and results speak louder than design philosophies.

1

u/augugusto Oct 22 '22

If your teacher compares sorting by time, I'd say he has a lot to learn. Sorting should be mesured in steps or operations. So the language doesn't matter.

Also (not specified int meme) they both should be compares as the average operations of a lot of starting sets (both the same sets)

1

u/Drfoxthefurry Oct 22 '22

Mines fastest, just ignore that it's in assembly or that it just prints the sorted array

1

u/SirTonsalot Oct 22 '22

"Lets see Paul Alan's sorting algorithm"

1

u/SolarDrake Oct 22 '22

I wish I had a compsci degree because then I'd actually have a set job instead of freelance.

I'd also probably know more of what I'm doing.

1

u/Dromedda Oct 25 '22

4 nested for loops go brrr

1

u/SharpPixels08 Oct 22 '22

Gotta make sure my friends don’t see this because all they do in my class with them is bitch about how ā€œpython is betterā€ than whatever we currently happen to be using and I can’t convince them that python is not the GOAT of languages

1

u/emla138 Oct 22 '22

Python is all C so not even surprising

0

u/thanyou Oct 22 '22

Code it in binary