Live data from Hacker News

Python's pre-declared constants are kinda weird

sebsite.pw

141–150 of 234 posts

Re: Python's pre-declared constants are kinda weird

#141
post #18

Earlier quoted context omitted.

Who cares tho. The agents deal with all of that, if you’re still looking at the code or caring about anything other than the loops and orbs you’re at the wrong level of abstraction. The important thing is the models have tons of python in their training data.

I've heard of orbs but what is it actually?

It’s basically self-contained cloud agents. I’m not sure why they’re called that but I think it’s just the next grift, kinda like “loops”…

Re: Python's pre-declared constants are kinda weird

#142

Earlier quoted context omitted.

I hate Python and I'm onboard with putting it down in many ways, but significant whitespace isn't weird in a first programming language. It's only weird if you've absorbed from some other language the convention that whitespace shouldn't be significant.

Oh, by "significant whitespace" I meant whitespace sensitive indentation, which I think Python and YAML are the only languages that has that feature.

Haskell, Lean, and Agda too. But even if Python were the only one, it wouldn't be weird to someone for whom this was their first programming language. It would just seem the way programming languages are. There's nothing intrinsically weird about indentation being significant. It's quite visibly part of the code you write and read.

Re: Python's pre-declared constants are kinda weird

#143

Earlier quoted context omitted.

I hate Python and I'm onboard with putting it down in many ways, but significant whitespace isn't weird in a first programming language. It's only weird if you've absorbed from some other language the convention that whitespace shouldn't be significant.

Oh, by "significant whitespace" I meant whitespace sensitive indentation, which I think Python and YAML are the only languages that has that feature.

F# as well.

Re: Python's pre-declared constants are kinda weird

#144
post #135

Earlier quoted context omitted.

If I'm not allowed to toot my own horn, I think for controls, you probably should not start with choosing a programming language, the first step is learning control theory and automata theory, you kinda have to understand feedback control/PID/steady state/jitter/hysteresis and the like. Python has never had great control libraries to begin with as far as I can remember (my info could be a bit outdated though), so the…

Please do toot your own horn. I assume you're referring to https://github.com/yuechen-li-dev/oct — tell us why it's good.

Sure, short list: - Easier to write than Python other than the simplest script, almost no way to write bad code and have it compile, reads like pseudocode most of the time - Compiles into Go binary, runs at Go speed, compiles at Go speed - Trivial to wrap any Go library via LLMs, so any Go library is also an Oct library. - Can metaprogram existing Go codebases, so it doesn't really replace Go, just supplements it - Easy concurrency/parallelism - SI units as types - Can be used as build script for C/C++ in place of CMake - Einstein tensor notation - Builtin GPU acceleration via Vulkan

It was designed as a teaching language for academics to stop writing bad code, but now I just get LLMs to do research/science for me with it for fun.

Re: Python's pre-declared constants are kinda weird

#145

Earlier quoted context omitted.

I’m not a regular JS user and haven’t touched the language in a long time, but I remember a (popular?) website for teaching modern JavaScript mentioned that some aspect of the function/macro that returns the type of an object was just plain wrong in a specific and important case. This was years ago however, so maybe the problem isn’t there anymore. Anyhow, I added JS to the list mainly because it is known as a badly…

There are certainly weird things about it, but they're all things you can ignore especially in modern times, whereas in Python you're constantly dealing with it head-on.

I'm not sure what world you live in but I remember quite well when prototypical inheritance was The Way in JS to do object-oriented programming. Then they copied the C#/Java syntax for classes. Then they aded a bunch of reactivity with Observable with a ton of quirks.

Every single new, large feature in JS has been full of quirks. The same cannot be said for Python; the exceptions are few and far between and more often than not they're not actually exceptions but rather something bound to core language fundamentals which once understood don't present a challenge because there is an actual underlying consistency.

Re: Python's pre-declared constants are kinda weird

#146

Earlier quoted context omitted.

> JS is a lot less weird than Python. I challenge you to find Python behaviors as weird and off-putting as anything here: https://wtfjs.com/

A lot of those are stuff I'd never do like `Test.prototype = null;`. Some are legit footguns, but they rarely get in your way. Python has weird file imports (no relative ones either), broken package management, historical differences between asyncio and blocking that still cause issues, threading/GIL caveats that trip up even experienced users, indentation for scope (esp weird given it was designed for REPL), weirdly…

What you put as an example isn't a footgun if you know how the language evaluation rules work. Once you understand that the "footgun" explains a dozen behaviors, which may be a weird behavior but it is consistent.

Re: Python's pre-declared constants are kinda weird

#147

Python is awful. There are so many one offs in libraries, none agree on a style, it’s slow, and it’s way too easy to do the wrong thing. I often work with data scientists and have to productionize their jupyter notebooks which is pure suboptimal hell. I guess it must be a good easy learning curve for research/scratchpad

Spoken like someone who hasn't tried to get data scientists to use other languages productively, where they'll be missing half the libraries, will have to triple their dependency count because you can't count on large common libraries and will have to dig to the ends of GitHub to find random functionality etc.

Re: Python's pre-declared constants are kinda weird

#148
post #71

Python is awful. There are so many one offs in libraries, none agree on a style, it’s slow, and it’s way too easy to do the wrong thing. I often work with data scientists and have to productionize their jupyter notebooks which is pure suboptimal hell. I guess it must be a good easy learning curve for research/scratchpad

I’ll never not be bitter than Python “won” the scripting language war over Ruby, more or less just because someone did a bit of AI work in it first and it took over that space by default. Ruby has such a nice holistic consistency to it. With a few exceptions, it feels like it was conceived of by one person with a core idea in mind. Python feels like a mess.

How is a language that has different semantics for referring to lambdas vs other functions consistent?

Ruby's most important error is that it does not support namespaces. This by itself makes it a far less scalable language than Python.

Re: Python's pre-declared constants are kinda weird

#149

Earlier quoted context omitted.

There are certainly weird things about it, but they're all things you can ignore especially in modern times, whereas in Python you're constantly dealing with it head-on.

I'm not sure what world you live in but I remember quite well when prototypical inheritance was The Way in JS to do object-oriented programming. Then they copied the C#/Java syntax for classes. Then they aded a bunch of reactivity with Observable with a ton of quirks. Every single new, large feature in JS has been full of quirks. The same cannot be said for Python; the exceptions are few and far between and more ofte…

You've probably just gotten used to it so you don't notice it anymore: https://github.com/satwikkansal/wtfpython

(Note some of these are outdated, but some of those only mention that towards the end of the section rather than the beginning)

Re: Python's pre-declared constants are kinda weird

#150

Earlier quoted context omitted.

Python is a language for "consenting adults". It doesn't try to prevent you from doing awful things so you can do great things. People who can't program well are given plenty of rope to hang themselves. It shares that with Perl and Ruby. That said, I find it the nicest, cleanest option of the three. I still wouldn't use it for large and complex projects. I really like it for stuff where one might otherwise use shells…

>language for "consenting adults". It doesn't try to prevent you from doing awful things so you can do great things. People who can't program well are given plenty of rope to hang themselves. This is exactly what I remember being said about C (which I agree with) and often given as a reason why higher level languages like Python or Java have so many protections against things C/C++ allowed (memory management being th…

Well, there are plenty of safety mechanisms that Python doesn't have and dangerous (usually powerful, occasionally badly designed) mechanisms that it does have.
Post reply on HN