1 hour in Java
1 hour in Java
1 hour in Java
But one compiling error is Java is 7 run time errors in python.
There is a type error and you couldn't have known it beforehand? Thanks for nothing
I will confess that I get a sense of psychological comfort from strict typing, even though everyone agrees Python is faster for a quick hack. I usually go with Haskell for quick stuff.
I find it's possible to operate Python as a statically typed language if you wanted, though it takes some setup with external tooling. It wasn't hard, but had to set up pyright, editor integration, configuration to type check strictly and along with tests, and CI.
I even find the type system to be far more powerful than how I remembered Java's to be (though I'm not familiar with the newest Java versions).
Ime anyone who is experienced enough knows how to avoid these Types of issues anyway (through tooling and good convention etc)
In Java you get a bunch of unexpected NullPointerExceptions instead...
usually this means you made a booboo, try catching these exceptions if it's a possibility.
The IDE can assist you before it even becomes a problem, so even more time saved.
Did everyone become stupid in the last 10 or so years? We used to write huge apps in Python without any type checkers or static analysis tools and never had any problems we wouldn't have had in statically typed languages.
no, we didn't, we made a bunch of small programs
This little hack is gonna cost us 51 CPU cycles.
And
++++++++ [>++++++++++++>+++++++++++++<<-] >++++. -. >+++++++. <+. +.
in brainfuck
Check out my whitespace:
Thanks, I hate it
Good old brainfuck 👌
Yeah but due to the extra indentation in the second image, the python party doesn't work.
I mainly found it annoying while writing code, because the lack of braces makes it difficult to tell when a scope ends. Plenty times, I've wanted to add something to the end of a for-loop, but had too little indentation.
Usually this means I get a runtime error, because it can't access some variable from the loop-scope. But worst case, it only executes once after the loop and I don't notice the problem.
Another big thing I miss when not having explicit braces, is opening up new/anonymous scopes to isolate variables, which helps prevent mistakes down the line + reduces code complexity.
For example, this is a thing I do quite regularly:
let client = { let client = new Client() let timeout = config.load("client.timeout") client.set_timeout(timeout) client //implicit return value of this scope when evaluated as an expression } client.request_something()
It allows me to visually group the initialization code for the client and I don't need to have the timeout
variable in scope afterwards. Depending on the language, you can also have the client
variable mutable inside the scope and then immutable outside.
Yes, this could be pulled out as a function to achieve something similar, but in my experience people (including me) will often just not do that, because it's only the timeout
variable or whatever.
Try finding a bug related to indentation in a 15 year old python codebase by the worst programmers on the planet. You won’t think that there’s no issues with it after that point. In any other language you literally just reformat and you’ll see the bug. That’s not the case in Python.
I've been coding around 25 years and got my start in perl. I absolutely hated python when I first used it. I use it all the time now. I still prefer my curly braces but I don't have any trouble with python or mind the whitespace anymore. I just run it through ruff every save. I do the same with go everything goes through gofumpt. I really think a lot of it is a generational thing. Older people are just used to curly brackets.
I do get peoples complaints about the packaging. Unless you're a dev already it's a bit extra to deal with shuffling virtual environments because the system python environments almost never work out of the box, at least in the last few distros I've used. Once I adjusted though it's no problem. I run half my dev stuff in toolboxes with their own environment anyway.
I have never had any problems with it either but don't get me started on YAML.
Sorry, are we talking about spaces or tabs? I want to comment on same indentation to not break the thread
Java feels like McDonald's and python feels like a grocery store.
Rust feels like a femboi hooters where they offer IVs you don't think they're qualified to administer.
I don't understand any of these analogies at all
Me neither but now I'm interested in Femboi-Hooters 👀
Oddly specific
C is a makeshift kitchen deep in the Lacandon Jungle. If you burn your food, you start a forest fire and die.
And about 20 in perl. But the return trip is 300 years
can you really call python programming though? The reason why python is so quick to write is because its so-called libraries are pre-compiled C programs. so you're not writing new programs, you're scripting existing ones.
And 42 seconds in jython.
My indirect experience with python is that it is slow as hell. Anytime I install an app that includes python it lags 15-30 minutes on that step. Anytime I'm asked to install something with conda it takes 30 minutes to an hour.
I'm sure that is just due to environmental and implementation issues, but the Java fans say the same thing...
It's near-universally regarded as a great prototyping language. For prod you should use something big-boy, like Java, or if you want to get fancy, Rust.
Yeah conda is slow af, but you can change the env solver which makes things much faster and there's also mamba/miniconda which I haven't tried but is supposedly much faster
With things like wsl, conda has also become less useful. Anaconda is terrible software and the need for conda managed packages is mostly lost outside of the windows OS in my opinion.
Conda actually now uses the Mamba solver under the hood, as of the 23.10.0 release: https://docs.conda.io/projects/conda/en/latest/release-notes.html#id43
Unfortunately, their release notes page is buggy, so this link will stop pointing to the correct release when they publish their next release...
That feels like a packaging issue, which would be a problem specific to the developer of that app, not Python. For the most part, pip packages install basically instantaneously.
And a second in julia
It's about writing the code, not execution time. Otherwise Assembly wouldn't take 7 years...
I can see it going both ways. Talking about execution times, this would be an exaggeration, but then, these memes always are.