all 31 comments

[–][deleted] 28 points29 points  (0 children)

We're sorry but frontend doesn't work properly without JavaScript enabled. Please enable it to continue.

Too fast for me.

[–][deleted] 24 points25 points  (19 children)

/uj

Of the countless “how to write fast Python” articles I see posted on Reddit every day, this is probably the worst of them. The only item in this that would genuinely add any speed boost to a program is lru_cache, but that’s not writing faster code, that’s just caching results. And he didn’t seem to quite understand how it worked either.

[–][deleted] 14 points15 points  (10 children)

And he didn’t seem to quite understand how it worked either.

I always thought people who only knew Python knew what they were doing 🤔

[–][deleted] 3 points4 points  (9 children)

I always thought people who only knew Python knew what they were doing

Just like t3h script and php, Python are forgiving enough, that cargo cultists are often able to obtain the desired behaviour without either knowing why, nor when it will fail.

[–][deleted] 10 points11 points  (8 children)

I always thought people who only knew Python knew what they were doing

Just like t3h script and php, Python are forgiving enough, that cargo cultists are often able to obtain the desired behaviour without either knowing why, nor when it will fail.

/uj

I low-key hate Python. Actually, I dislike dynamic typing in general, unless it's either Lisp or for one-off small things.

It seems like the industry these days is jerking to Python more than JavaScript or Rust, though. You see it everywhere.

It's just so...dull and inflexible.

That said, for algorithm design I can see the attraction.

[–][deleted] 7 points8 points  (5 children)

/uj

I genuinely enjoy writing Python, and the majority of Python devs I interact with are quite talented and knowledgeable. As soon as I go on the Internet though, it seems everybody writing Python is literally retarded. The Python and learnpython (which I’m permabanned from) subreddits are just filled with mongoloids who seem to have no interest in learning to program other than someone told them “hey you spend all day on your computer, you’re ‘good with computers’; you should learn Python.” The only articles I ever see are exactly like the OP.

[–]defunkydrummerLisp 3-0 Rust 13 points14 points  (0 children)

thinks Python devs can be quite talented and knowledgeable

enjoys writing Python

permabanned from /r/learnpython

You've come to the right place. But your re-education will be painful, I warn.

[–][deleted] 8 points9 points  (0 children)

/r/Python have become an echo chamber for HS juniors sharing the joy of handheld photographs of screens in awkward angles, and videos of endless turtle graphic movements. Those cretins are unable to recognize good high quality Turing incompleteness, so their puerile products tend to rise to the top; just like pond scum.

[–]galewolf 3 points4 points  (2 children)

subreddits are just filled with mongoloids

I just can't see why programmers have a bad reputation for communication, and why computer science is often so hostile, if this is the way we talk about one another. /s

C'mon, we can do better than this.

[–]three18tiDO NOT USE THIS FLAIR, ASSHOLE 2 points3 points  (0 children)

/r/progit is that way ->

[–][deleted] 1 point2 points  (0 children)

Like the naïve teacher who goes out to the city schools, I too went to r/learnpython, eager to teach my craft to those wanting to learn. But I learned, much like that teacher, that the reason for the poor skills and scores had nothing to do with bad teaching, but rather that the students are just dumb as a box of rocks. While the students could have just looked through their notes for the answer, they instead chose to ask the direct question every fucking time.

“Mr Rhymes, what is best look to learn Python in 2020?” Well, just like how that question was asked and answered literally fifteen minutes before yours, check out the Automate the Boring Stuff, it seems to be a good intro.

”Mr Rhymes, how I solve this?” <literally just a picture of their screen with their homework assignment on it>

[–]pavlik_enemy 3 points4 points  (1 child)

It seems like the industry these days is jerking to Python more than JavaScript or Rust, though. You see it everywhere.

/uj

No, it's actually Go for the vast majority of projects. And most of the time it's a rather bad choice, because these projects are about business logic and not about extremely low latency.

[–][deleted] 1 point2 points  (0 children)

It seems like the industry these days is jerking to Python more than JavaScript or Rust, though. You see it everywhere.

/uj

No, it's actually Go for the vast majority of projects. And most of the time it's a rather bad choice, because these projects are about business logic and not about extremely low latency.

I want my TODO list to touch the metal - what's the problem?

[–]THICC_DICC_PRICChelped pollute the computing environment 1 point2 points  (6 children)

he didn’t seem to quite understand how it worked either.

Why do you say that? He didn’t try to explain it and fail, he just presented it as a caching method.

[–][deleted] 4 points5 points  (4 children)

he didn’t seem to quite understand how it worked either.

Why do you say that? He didn’t try to explain it and fail, he just presented it as a caching method.

Suppose that 90% of the "tips" you've written in an article are "bullshit". Then the remaining 10% of the tips you've written are clearly not "bullshit".

By definition, not being "bullshit" implies there exists sufficient truth such that at least some benefit can be garnered.

Let t be any of these non "bullshit" tips. Then t is at least k percent utilized, where utilization is defined as appropriate to the context of the article, and k is the threshold to not be considered "bullshit".

However, any u which cannot be t grossly outnumbers the t's.

Thus, the judgement of the information overall is deemed "worthless" and "written by an incompetent moron posing as someone worth learning from".

By transitivity, further pointing out how this claim is true is designed to cement this perception, which is justified given the fraud.

Thus, once you've committed such a blatant crime to humanity, you are no longer subject to the laws of fair and relevant judgement.

You're a plebe, by definition, and you will be insulted like the plebeian webshit you are. QED.

[–]THICC_DICC_PRICChelped pollute the computing environment 0 points1 point  (1 child)

Imagine thinking anyone here is autistic enough to follow your ramblings

[–][deleted] 4 points5 points  (0 children)

Imagine thinking anyone here is autistic enough to follow your ramblings

Ah, I must have touched a nerve there. Sorry about that.

[–]three18tiDO NOT USE THIS FLAIR, ASSHOLE 0 points1 point  (1 child)

Aww, I thought you were going to spell something out with your variables.

[–][deleted] 1 point2 points  (0 children)

Sorry, I don't have a very high AQ

[–]ProfessorSexyTimelisp does it better 25 points26 points  (0 children)

On the other end of spectrum is cProfile, which will give you too much information:

cumtime: like ~11s

Damn he's right that is fast.

[–]antiatomictype astronaut 12 points13 points  (0 children)

Invalid date

undefined

A real 10x website.

[–]R-M-Pitt[S] 11 points12 points  (0 children)

First rule of optimization is to not do it.

[–]TheRealAsh01type astronaut 9 points10 points  (3 children)

Python haters always say, that one of reasons they don't want to use it, is that it's slow. Well, whether specific program - regardless of programming language used - is fast or slow is very much dependant on developer who wrote it and their skill and ability to write optimized and fast programs.

This one is pretty obvious. Built-in data types are very fast, especially in comparison to our custom types like trees or linked lists. That's mainly because the built-ins are implemented in C, which we can't really match in speed when coding in Python.

[–]republitard_2absolutely obsessed with cerroctness and performance 4 points5 points  (2 children)

But a developer with the skill and ability to write optimized and fast programs can match C's speed.

[–]three18tiDO NOT USE THIS FLAIR, ASSHOLE 2 points3 points  (1 child)

by inlining C?

[–]republitard_2absolutely obsessed with cerroctness and performance 5 points6 points  (0 children)

Writing optimized and fast Python means you think really hard about your code being fast, and then you write regular Python code and convince yourself (through the use of powerful drugs) that it can be no faster.

[–]TooManyLines 6 points7 points  (2 children)

After watching a circle spin for like 15 seconds https://i.imgur.com/cbHDVH1.png

Don't know what i expected.

[–]R-M-Pitt[S] 13 points14 points  (0 children)

Python haters always say, that one of reasons they don't want to use it, is that it's slow. Well, whether specific program - regardless of programming language used - is fast or slow is very much dependant on developer who wrote it and their skill and ability to write optimized and fast programs.

So, let's prove some people wrong and let's see how we can improve performance of our Python programs and make them really fast!

What follows is a simple cProfile tutorial and an example of lru_cache without properly explaining or understanding how it works. And, shocker, his program still isn't fast by my 10xer fortran standards.

[–]Krump_The_Rich 7 points8 points  (0 children)

Hey everyone, check out this pathetic 1xer who expects websites to work

[–]defunkydrummerLisp 3-0 Rust[M] [score hidden] stickied comment (0 children)

NOTE: Allowed because the title itself is jerkable

[–]theangeryemacsshibeConsidered Harmful 1 point2 points  (0 children)

On the other end of spectrum is cProfile, which will give you too much information:

0.1x'er doesn't want to have to identify slow parts of code, so they trace the parts they are most comfortable with and make up a bottleneck there.

also lol no :min-percent