You wouldn’t typecast a car.
I may be on the wrong side of history but I can’t see what other role a car could get in the film industry except vehicle.
What about typecasting to a car?
Rust is completely correct to be a dick about it as well. Type safety is there for a reason.
a compile-time error is highly preferable to a run-time error
For our American friends: the Opel Corsa is a car.
Debatable.
For the Brits, it’s a Vauxhall Corsa.
For everyone : it’s a sh’tbox (never again)
It works and is a pile of jank - Python
It doesn’t work and is a pile of jank - C++
You violated gods laws with how bad your code is and it still runs (right through the wall) - C
You know, I always wondered what the original image looked like, and even trusty Know Your Meme doesn’t show it. It looked like this:
And that’s why I don’t use Python for anything more than simple scripts
Hey at least it’s not JavaScript which is perpetually high on crack with Object object
1 + 1 = “11”.
[] + [] = “”
Well, that happens when you don’t override the
toString
method. Not worse than Java’s 0xf00cu
In bigger projects, you tend to miss type safety really bad, really fast. Rust has it built in, Python can have it bolted on. That’s simply one of the many aspects to consider when choosing your programming language.
But don’t worry about it too much. If one thing’s for sure, it’s that you will regret that choice in any case.
Yeah I usually love Python but right now I’m working on a paid project where I need to deal with tasks that are critical to mostly work on first try. Now, if it would be a different matter if my code was just completely idiotic and still worked but Python doesn’t error even when there is obvious typo that any statically compiled language could’ve picked up on a breeze at compile time.
I am scared to even implement a better logging system in my program because sometimes I forget to sanitize the arguments and my program fucking crashes at runtime because I added a new fucking logging statement.
I so fucking wish I had static type checking right now. The libraries I am using doesn’t have types (via annotations) so unless I spend days fixing their shit, I will have to continue with these shitty runtime crashes for the shittiest small mistakes. I also can’t trust these annotations because even if they are “wrong” their code coul perfectly work fine and they could even ship the wrong types. I would have the burden of dealing with their shitty annotations if that happens.
Perl when I iterate over an object and treat the result as a hash reference: “fine, whatever. Fuck you, tho”
C when I cast a
char * *
to achar * * const
: okC when I cast a
char * *
to achar * const *
: okC when I cast a
char * *
to achar const * *
: WTFC when I cast a
char * *
to achar const * const *
: okThe WTF case isn’t allowed because it would allow modification of the const. From https://en.cppreference.com/w/cpp/language/implicit_conversion
int main() { const char c = ‘c’; char* pc; char** ppc = &pc; const char** pcc = ppc; // Error: not the same as cv-unqualified char**, no implicit conversion. *pcc = &c; *pc = ‘C’; // If the erroneous assignment above is allowed, the const object “c” may be modified. }
Please stop, I have CPTSD.
You don’t even need to cast in Python, a reference is a reference.
Python doesn’t have casts and is strongly typed.
Did you a word?
Do we need any more proof Python is superior?
(I’m ^joking, ^I ^love ^Rust)