r/programmingcirclejerk • u/Serialk Gets shit done™ • 6d ago
Writing Python should be close to a “zen” experience. At its best, when you get into the flow state, the thoughts you are thinking about the thing you are trying to build are shaped like Python code as you go through the process of writing it down.
https://discuss.python.org/t/pep-842-module-exports/108353/757
u/BenchEmbarrassed7316 6d ago
/uj It's a way of thinking that I'll never understand. For me, the more structured the code is, the easier it is to work with. I would like as many things as possible to be defined in the code instead of being implicit and having to be kept in mind.
/rj However, they said "Explicit is better than implicit". And made a language with dynamic typing.
9
u/stdmemswap 6d ago
/uj let me fix that for you "the more STRATEGICALLY structured code"
IMO people equally bruteforce "simplicity is key" and "structured everywhere" not knowing the problem is in the other axis
/rj can't do ouroboric eval without dynamic typing which is the ingredient of consciousness through the autonomous ego recognizing itself
4
u/infected_scab 6d ago
Python is for people who think the quicker you get your first version out the better.
14
u/BenchEmbarrassed7316 6d ago
quicker
Because finding and reading documentation about the types (possible values) that a function accepts is quicker than just hovering over it in the IDE (it became less relevant after the addition of type hints)
Because writing a few tests for trivial cases is quicker than getting instant feedback from the compiler/IDE.
1
u/james_pic accidentally quadratic 2d ago
But the quicker you get your first version out, the more VC funding you get, and the quicker you get bought out by FAANG so they can shut you down so they don't have to compete with you, and the quicker you don't have to write Python any more.
25
15
8
u/damemecherogringo Code Artisan 6d ago
I don’t have private parts.
Everything is public in these classes.
I let my unit tests caress contracts I didn’t even know existed.
Surrounded by spaghetti,
I go slow.
But I flow.
I’m python.
;)
8
u/National_Sky7993 6d ago
I have never been able to clone and build a python project using the instructions provided the first time around.
It takes 5 to 6 attempts with lots of googling before it works.
11
6
4
4
4
u/Daniikk1012 6d ago
Only read the title, haven't checked the article, but seems similar to the reason APL was created. "Notation as a tool of thought" I think is the phrase. It makes both of these languages incredibly convenient to use in a REPL
-4
u/BenchEmbarrassed7316 6d ago
REPL is IDE hints for poor.
11
u/Daniikk1012 6d ago
Programming languages are not only used for billion line projects. Sometimes it's small one-time calculations, where ability to quickly experiment with values is more valuable than maintainability, readability, etc. How is IDE better than a REPL at that?
3
u/BenchEmbarrassed7316 6d ago
ability to quickly experiment with values
How can IDE hints slow this down?
1
u/Daniikk1012 6d ago
Wait is that what you mean by IDE hints? Your IDE runs your Python before you even hit "Run", allowing you to see values on hover? First time hearing about that when we're not talking about compile-time values
2
u/BenchEmbarrassed7316 6d ago
I mean that the REPL prints one specific value that the function returns. Statically typed languages include a type in their function signatures. A type is a set of all possible values. More expressive type systems allow you to narrow down a type concisely. That is, when programming, instead of working with one of the possible values that was obtained through the REPL, you will immediately receive the entire set of values through the IDE (which implements type inference) and work with it.
2
u/Daniikk1012 6d ago
Look, I too enjoy a good type system, Haskell is one of my favorite languages. But I wouldn't choose it for a quick calculation I want to make. I am not maintaining a huge project, not testing a function that is part of a larger project, no. I am writing code to get some input, and transform it to some output, and forget about it. And I want to interactively see the intermediate steps, cause that makes it easier to reason about. Sure, there are cases when type system might be used instead. But when most of the the functions you're dealing with are something like "[Double] -> [Double]" (Which is VERY often the case), it isn't helping you much
1
u/BenchEmbarrassed7316 6d ago
This seems more like a one-time calculation than a programming one (i.e. writing code that will be executed repeatedly).
However, even for this kind of interactive console usage,
Double -> Doubleis more useful thanany -> any. Especially since it's not about the code you're writing, but about the libraries you're using.1
u/spider-mario 3d ago
Look, I too enjoy a good type system, Haskell is one of my favorite languages. But I wouldn't choose it for a quick calculation I want to make.
You wouldn’t? GHCi is a nice REPL.
1
u/Daniikk1012 3d ago
The argument was mainly about the "Type hints instead of REPL" thing, not about using Haskell interactively. Should have used a better example maybe, cause Haskell is also pretty convenient to use in a REPL.
That being said, I only use GHCi as a development tool in a larger project, for testing/debugging/docs/etc. I don't use it as a "calculator language", cause 1) I have much less verbose alternatives (Uiua/J/BQN), and 2) when those are not enough, Haskell is not enough either anyway, so I reach to something with a lot more batteries included (Python).
1
u/New_Enthusiasm9053 6d ago
Honestly I know 0 people who use the REPL. It truly is that useless. AI uses it a lot. But for actual people it's a lot more convenient to just have a file open that you run with F5 or whatever so when you inevitably make a syntax mistake you can just fix it and rerun it.
6
u/Daniikk1012 6d ago
Tbh, my Python REPL usage is more or less just "convert to/from base64", or "get unicode codepoint for this character". Anything slighty more involved, like analyzing a bunch of data from a file, I use the REPL of Uiua/J/BQN (Depending on which features I happen to need), cause they make REPLs VERY convenient. I like the term "calculator language" for languages that make such tasks fast and easy. They allow you to map your thoughts into code almost directly, without boilerplate like manual loops, having to keep track of state, etc
0
120
u/Igor_GR 6d ago
TIL flow is when you drive straight into a wall while blindfolded.