Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A float in Python is an implementation-specific size, just like C. So I'm really confused about using it as an example here.

> Storage classes are "minutiae" however when all you want is just a straight up number.

You can have a single "straight up number" and mention the bit width in the language spec. The mere act of writing it down doesn't force coders to deal with any more minutiae than they already had to deal with.

> Yeah by way of higher-level abstractions ...

I strongly object to this. "float is at least x bits" and "float is exactly x bits" are the same level of abstraction, and almost every language, high or low level, picks one of those options.




You can strongly object all you want, but when I'm writing code in python, or any other high-level language I don't care one jot about storage size.


You could apply that same "who cares?" attitude to the size of "double" in C. Whether you burden yourself with that knowledge is not a feature of the language. More "C coders" care because they're micro-optimizing, but it's no more needed in C than Python.

Also you named Java as being on the easy side and that has four different integer sizes...


No ... not really.

Double doesn't behave like a whole number.

java only has a single int type, which is 32-bit regardless of machine architecture.


> Double doesn't behave like a whole number.

I was suggesting double for your partials, not your whole numbers.

> java only has a single int type, which is 32-bit regardless of machine architecture.

I'm so confused.

You said having a "list of what width each type is" is bad because it forces the user to deal with "minutiae".

But that's exactly what Java does. int is 32 bits, short is 16, long is 64

And then you praise a type in Python that does the same thing as "double" in C. It's usually 64 bits, but it might be something else.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: