Did people start using Python 3 yet?
I generally try to write code that builds and runs on both 2 and 3, but I don't always have the time, and whether it _actually_ works is largely dependent on how much of an effort I put into writing tests.
>learn a real programming language
Java is easily as "real" as Python.
Runs important and performance critical stuff in the back-end of like every second really big commercial website, runs much of the show on the wildly successful Android, runs a lot of business software...
>shitposts over Java
>recommends Python instead
The print function meme aside.
I'd say probably the biggest hold out and probably the larger chunk of the userbase is from academia, so let's look at it from that perspective. There's basically no incentive to port billions of lines of code to Python 3 when:
>There are no real advantages.
>If there is, this is not being communicated to the academic community.
>No one else is doing it.
>Most academics who will be using 2.7 for the forseeable future don't even have a dual install.
>print musle memory is import for development, and this is actually a problem not just a meme since it's one of the first things people trying to switch find.
>They will have to pry 2.7 from my cold, dead hands.
REBEL AGAINST PYTHON 3, FORCE THEM TO END SUPPORT FOR 3 AND KEEP 2 MASTER RACE.
why doesn't (didn't? how many years since python3 now?) someone just make something like gofix for python code so that migration to python3 can be automated and painless?
There's a tool called 2to3 that can handle many details but not everything. If you don't have good test coverage who knows what will be broken afterwards.
And given how tied the stock Python C API is to the interpreter's implementation, I wouldn't be surprised at all if shitty enterprise C libraries failed to work in Python 3.
Exists, not reliable enough. Still will require a lot of manual porting and testing, and all that usually for no tangible benefit.
Besides most Python deployments never had preparations in build tooling and the environment (often Windows on many semi-unmaintained boxes) to handle this change sanely either.
So really, Python2->Python3 remains a mess after like a decade despite being utterly undramatic in scope as compared to what other ecosystems pulled off in months (no they didn't migrate all software entirely either, but the still actively developed libraries people relied on and everything like that DID migrate there, and the rest kinda branched off to legacy support).
Try Kotlin, Ceylon or Scala.
Well, they can't really replace Python as sysadmin scripting language and middleware between C or C++ programs.
But they're have some fairly big advantages for just programming software.
Somehow Java feels like it's _just_ high level enough to suffer from it in terms of performance, while still being as stiff as a system programming language and having less flexibility than most of those too.
It's not all bad; Java tools tend to have really strong code intel and refactoring features because the nature of the language makes it easy to understand what some token at a given position means. Working on an Android project for a while was almost refreshing because the code completion actually worked all the time and errors were pointed out before compilation.
But if I wanted to throw something together quickly and not wade through boilerplate and project wizards, I'd definitely start with Python.
The print function is actually very nice, since it allows for optional parameters that can turn off newlines or print to a different stream.
Which was always a bit awkward in Python 2.
>Somehow Java feels like it's _just_ high level enough to suffer from it in terms of performance
Performance is generally no big problem, most of the big website deployments actually run performance critical stuff on the JVM (Java and Scala).
> while still being as stiff as a system programming language and having less flexibility than most of those too
Depends very much on what you're doing. But C++ got less stiff quicker than Java did recently, yes.
But Python? It's not really more flexible. It's kinda even more constrained to its own niches in smaller non-system programs... unless you want performance issues and lots of issues with code maintenance over time and so on.
> But if I wanted to throw something together quickly and not wade through boilerplate and project wizards, I'd definitely start with Python.
Java minus boilerplate? Learn Scala / Kotlin / Ceylon.
Indeed it is. Though if you somehow get to the point where the VM just doesn't cooperate and you have to start pooling objects or something to keep the heap and collection pauses under control, one starts to wonder if this was the right tool for the job. Somebody at my last workplace had basically run and documented -Xcthulhuftagn=12347M guessing games for a living before.
>And the strictness tends to be a good thing since it catches a lot of errors already at compile-time.
Or even before that, which is _very_ nice coming from Python and C.
I've been meaning to check out Scala anyways, maybe I'll do just that.
>Or even before that, which is _very_ nice coming from Python and C.
That depends on the IDE, I think Clion can catch compiler errors/warning while you type too.
Compiler integration is getting a lot better thanks to clang (gcc purposely tries to be hard to integrate with anything else - fuck you rms)
Yeah, I think Xcode does something like this too. It's nice but probably much harder for an IDE to get right because of the preprocessor and everything; having a real compiler frontend probably helps.
I think I saw some discussion on the gcc mailing list about how its frontends should be better at exporting symbols, but they're so afraid of someone taking the syntax tree and dumping it into a closed backend it's not likely to go anywhere.
If you're using print for anything else other thanprint 'TEST'orprint [VAR]you should probably be using something else.
>it allows for optional parameters that can turn off newlines
Except you could place the string in a single entry tuple and get the same effect with the statement.