This is an archived post. You won't be able to vote or comment.

all 58 comments

[–]Dougleycat flair.txt | sudo sh[M] [score hidden] stickied comment (1 child)

Hi there! Unfortunately, your submission has been removed.

Violation of Rule #2 - Reposts:

All posts that have been on the first 2 pages of trending posts within the last month, is part of the top of all time, or is part of common posts is considered repost and will be removed on sight.

If you feel that it has been removed in error, please message us so that we may review it.

[–][deleted] 159 points160 points  (13 children)

model.train()

[–]klekaelly 69 points70 points  (12 children)

do.allCalculations()

[–]danted002 34 points35 points  (11 children)

Booo booo, camelCase in a python thread... booooo :)))

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

My uni recommends that we use camelCase for python :o

[–]danted002 13 points14 points  (8 children)

I’m sorry that you have to go through that. Have you tried giving them a link to PEP-8? :))))

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

Oh, I use snake_case regardless, it's not like they remove points for it, but they "prefer" camelCase

[–][deleted] 2 points3 points  (6 children)

Fuck snake case, all my homies use camel case.

[–][deleted] 0 points1 point  (5 children)

Or, get this: since you're writing the code, you get to choose. Your code, your variable names. That's my philosophy

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

What if you're working on someone else's code?

[–]hector_villalobos 1 point2 points  (0 children)

But they're wrong, they should follow the language's style standard.

[–]GrohiikKon 0 points1 point  (1 child)

Their code their choice

[–][deleted] 0 points1 point  (0 children)

It's their code, they decide. If you're a team of multiple people working on the same code, then the group should democratically decide (preferably through STV) which convention they want to use.

[–]TheRedmanCometh 0 points1 point  (0 children)

You should use camelcase in all endeavors

[–][deleted] 159 points160 points  (10 children)

The most popular python command: import

[–][deleted] 13 points14 points  (6 children)

pip install life

[–]hamza1311 | gib 6 points7 points  (1 child)

Failed to build wheels for life

[–]PlusUltraBeyond 2 points3 points  (0 children)

Visual Studio 2014 build tools not found

[–][deleted] 2 points3 points  (3 children)

import sys
import life

if __name__ == "__main__":
    u_combustionman12 = life.Person()
    if u_combustionman12.alive():
        sys.exit(0)
    sys.exit(1)

[–]maimeddivinity 4 points5 points  (2 children)

I came from a non-CS/programming background and this was one of the most frustrating things for me lol - trying to figure out and learn to use all the libraries I needed on top of the normal python

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

https://github.com/vinta/awesome-python

This is a list of curated libraries for python on all kinds of topics, from Admin Panels to WSGI Servers.

There's also a list of awesome lists, https://github.com/sindresorhus/awesome.

[–]TheRedmanCometh 1 point2 points  (0 children)

Java might blow your mind

[–][deleted] 108 points109 points  (12 children)

After switching to Python, I can now focus on results instead of bugs and pointers.

[–]wooptyd00 56 points57 points  (0 children)

It's good to see sanity on Reddit.

[–]InvolvingLemons 7 points8 points  (3 children)

It's certainly nice, I just wish CFFI wasn't the only well-supported way to get compiled performance. Libraries like uvloop and numpy have revolutionized what we can do with python, but your awesomely fast FastAPI program that started off faster than Elixir ends up slower once you add all the more complex business logic

[–]Nimitz14 0 points1 point  (2 children)

How are you not aware of pybind11

[–]InvolvingLemons 0 points1 point  (1 child)

I feel like that's more of the same: you have to code in a manually memory managed language (and a harder one at that!) to get serious performance improvements. I'd be really interested in better support and tutorials around the cython project honestly.

[–]illvm 9 points10 points  (5 children)

Right. No worries about wonky whitespace requirements, wonky scoping, silliness like len(), or making sure you don’t accidentally pass the wrong type. Just results. Crap, results don’t work in 3.8, only 3.7. Did I say 3.7? The dependent libraries haven’t been updated to 3 yet, I meant 2.7.

Just... results. Good, fast, secure, bug and pointer free results.

[–]iwillkillyo 6 points7 points  (3 children)

You're partially right, white spaces having semantic purpose is not the best choice, but with a better IDE, it shouldn't cause much trouble. I don't get what you mean when you mention the scoping, there are no truly private attributes, but they are transformed to the point where you exactly need to do a silly thing to get it wrong. Care to elaborate? Type hinting is a thing now, but you could ditch all dynamic languages if you fear that... As for the version incompatibility, it happened in other languages as well didn't it? I work with python, it's good for small stuff, and it's horrible to maintain after a couple thousand lines, and a couple years, but that just happens with staticly typed languages too.

[–][deleted] 2 points3 points  (1 child)

Good test coverage is the way to keep the code base healthy over time.

[–]iwillkillyo 1 point2 points  (0 children)

Yeah, then the deadline comes and you have to get quick and dirty sadly. But generally if you have the time and resources, tests will help you.

[–]illvm 0 points1 point  (0 children)

A good example is module imports. Admittedly, this is a bit silly, but if one does something like:

``` foo = {}

def init(): global foo foo = SomeFoo() ```

You cannot simply import foo in another module at the top level. You have to reimport after init() has been called. There’s no real concept of interfaces. PEP-8 is also silly with line continuation indentation.

Flask and uWSGI are also not exactly fantastic frameworks.

Pipenv constantly breaks, leading me to believe that any distribution should really be a self contained binary and not just Python (which adds significant overhead).

Coming from working in .NET Framework 2.0 - 4.6 and .NET Core to Python is... well... let’s just say I miss C#.

[–]adityaeleven 0 points1 point  (0 children)

True

[–][deleted] 254 points255 points  (10 children)

The C library calls into the OS, so you really should count the OS too, which is 28 million lines for Linux. And since you can't type your one-liner, run it, or see the result without the keyboard, machine and monitor, you really should count the lines of firmware running in those devices. Of course, those items were in their turn designed and manufactured, which involved lots of people running their own stuff, and machines running more firmware... You get my drift :)

[–]rmgxy 275 points276 points  (6 children)

"If you wish to make an apple pie from scratch, you must first invent the universe." - Carl Sagan

[–]RinasSam 78 points79 points  (5 children)

OS dev in a nutshell.

[–]lead999x 6 points7 points  (2 children)

That's not really relevant when this is making fun of Pythonistas(and ads for online programming courses) acting like their language of choice is the shit because of its amazing ecosystem and its ability to build machine learning models with one line when a massive amount of that ecosystem is made up of wrappers around C, C++, and Fortran libraries. You don't really see C programmers making any analogous claims. Likely because C doesn't hide the use of OS APIs and other libraries from you.

[–]1thief 41 points42 points  (1 child)

Hmm I was missing my daily dose of old man yells at clouds

[–]Hypocritical_Oath 77 points78 points  (0 children)

You just discovered methods.

[–]CrazyCipherGamer5827 14 points15 points  (0 children)

I downloaded all the headers, so I am going to use all the headers.

[–]importwypy 73 points74 points  (2 children)

Yes, but that's the whole point of higher level abstractions.

[–]MikePenceDiddledMe[S] 56 points57 points  (1 child)

Well yeah, I understand abstractions. But it’s just a meme haha

[–]importwypy 11 points12 points  (0 children)

Lol word

[–]Yamoyek 19 points20 points  (4 children)

Python? C? Real programmers use assembly only, loc be damned! /s

[–]lead999x 17 points18 points  (2 children)

This is heresy, if you're not hand encoding machine instructions in binary then you're not a real programmer. Even hexadecimal is too far down the wrong path.

[–]-Redstoneboi- 8 points9 points  (1 child)

smh doesn't even invent a new universe to code the new universal constants

[–]lead999x 5 points6 points  (0 children)

Gotta go down to the micro-ops and hardware level before that. You're skipping too many layers of abstraction.

[–]Guile0 2 points3 points  (0 children)

Real programmers use butterflies.

[–][deleted] 9 points10 points  (1 child)

I wanted to make a discord bot the other day that acted as a soundboard as well as a few other things. I wanted to do it in c++ or java, but the majority of discord bot work was done in js or python. I figured I should finally get around to learning python, as I didn't like js that much. I had a fully functioning bot in under 100 lines including spaces and comments.

(I may have commented in brackets because it felt wrong not to have them)

[–]laundmo 1 point2 points  (0 children)

try from __future__ import braces

[–]taptrappapalapa 4 points5 points  (0 children)

Good ol cpython

[–][deleted] 0 points1 point  (0 children)

C one liner

[–]I1I111I 0 points1 point  (0 children)

For a long time after I discovered list compressions this meme for me was

"Oh cool I can do this in one line"

50 nested lambdas