News for hackers. Stuff that matters.
Re:On Learning Rust and Go: Migrating Away from Python by computerex on Sunday March 24, 2019 @10:13AM (#19476428)
Wow. It's amazing the lengths people go to to maintain their delusions. Show me one python IDE in action doing effective refactoring across a large, nontrivial python code base. And you didn't even mention concurrency and skipped over it altogether!

> use type hints or one of the many libs that enforce types...

As if that's pythonic. Heard of duck typing? And those are things you have to do yourself, as additional work and maintenance rather than getting it free because it's a feature of the language. And you don't always have full control over the stack.

Is there an IDE that will guarantee that no runtime errors will take place due to typing?

> Adoption rates keep exploding

Because python made its way into the rapidly growing machine learning market. Python is great for writing glue code/scripts because it's easy to extend with C. Everyone and their grandma getting into data science use python.

> I have no problem with that, just don’t try to sell it to me on technical grounds, because it looks very much like you have none.

Looks like you are just not willing to accept or even recognize any valid criticism of Python. This type of fanaticism towards the language is not the first time I am seeing it.

Re:On Learning Rust and Go: Migrating Away from Python by dang on Monday March 25, 2019 @02:33AM (#19480675)
You crossed into personal attack here, and incivility elsewhere in this thread. That's not ok on HN. Would you please review https://news.ycombinator.com/newsguidelines.html and follow the rules when posting here from now on, regardless of how wrong someone is, or you feel they are?
Re:On Learning Rust and Go: Migrating Away from Python by sgillen on Sunday March 24, 2019 @10:27AM (#19476498)
With regards to refactoring I’ve never had a problem using pycharm for refactoring python. But that is literally the only tool I can say that for.
Re:On Learning Rust and Go: Migrating Away from Python by mylons on Sunday March 24, 2019 @10:23AM (#19476481)
i’ve used pycharm to refactor 100k+ LOC bases.

pycharm also uses the type hints that are PART OF THE LANGUAGE (aka pythonic) as of python 3.x and enforces them.

Re:On Learning Rust and Go: Migrating Away from Python by AsyncAwait on Sunday March 24, 2019 @10:46AM (#19476624)
I've used Pycharm extensively in production. It's hands down the best Python IDE, but the refactoring is nowhere near as reliable as with IDEA, Golang etc. Having a static type system provides refactoring certainty that simply cannot be achieved with a dynamic language.

You cannot do with heuristics what you can do with static types.

Re:On Learning Rust and Go: Migrating Away from Python by sandGorgon on Sunday March 24, 2019 @08:54PM (#19479618)
Pycharm is built on top of IDEA.
Re:On Learning Rust and Go: Migrating Away from Python by AsyncAwait on Monday March 25, 2019 @05:44AM (#19481232)
Yes, I know, but it doesn't provide the same quality of refactoring as IDEA can for Java due to the dynamic nature of Python.
[dead]
Re:On Learning Rust and Go: Migrating Away from Python by mylons on Sunday March 24, 2019 @10:31AM (#19476532)
ok. tell me what i’ve done and haven’t done. you’re the expert.
Re:On Learning Rust and Go: Migrating Away from Python by computerex on Sunday March 24, 2019 @10:55AM (#19476670)
> pycharm also uses the type hints that are PART OF THE LANGUAGE (aka pythonic) as of python 3.x and enforces them.

Just goes to show you how incredibly messy the transition from 2 to 3 really is. Duck typing and typing hinting are two fundamentally different approaches of doing the same thing that rub against one another. That's one more thing adding onto the long list of things that make it a pain in the ass to migrate from python2 to python3.

Re:On Learning Rust and Go: Migrating Away from Python by duckerude on Sunday March 24, 2019 @12:18PM (#19477105)
They're optional, and it's possible (and not unusual) to use them in Python 2-compatible code with an alternative comment-based syntax and a backport of the typing module.

It's possible to start using type hints without migrating to Python 3, and it's possible to migrate to Python 3 without using type hints. They're almost orthogonal.

It's weird to bring it up like this - do you have any experience migrating code to Python 3?

Re:On Learning Rust and Go: Migrating Away from Python by vonseel on Sunday March 24, 2019 @01:20PM (#19477493)
I’ve done all of that. I guess it depends on the codebase, but transitioning to Python 3 wasn’t so difficult, I suppose it should only be easier now than it was in 2016/17.

Coming back to Python in 2019, it seems almost mandatory to be on Python 3.4+. I can not imagine someone still using Python 2.7. Except for this one place I worked that was stuck in the last century, God bless their little souls.

Re:On Learning Rust and Go: Migrating Away from Python by computerex on Sunday March 24, 2019 @05:02PM (#19478762)
You missed the point, so I'll repeat it. The parent I was responding to made the comment that python has type hinting, responding to OP's criticism of Python's lack of static typing. My point was, there was no notion of type hinting in python until PEP 484 or whenever it was released, long after the initial release of python. Python was released in 1991 and type hinting was introduced in like 2014. So for the 23 years the language existed prior to type hinting, people made all sorts of arguments/excuses for why that's not needed/unnecessary for Python. Hell, even now as a consequence of this type hinting in python isn't all that common. It may have to do with the fact that for 85% of the language's lifespan, there was no type hinting and duck typing was rampant, which like I said is an approach that goes against type hinting.

So if you want people to be pythonic in py3, they have to make massive changes like replacing duck types with abstract classes.

I think it's weird that you don't question why vast majority of python code has no type hints. Do you have experience in Python?

Re:On Learning Rust and Go: Migrating Away from Python by duckerude on Sunday March 24, 2019 @05:58PM (#19479022)
It makes sense now, thank you. I think the word "pythonic" was misused in the parent - usually it's normative, but type hints are strictly optional.

I don't think I've seen anyone argue that Python 3 code without type hints is unpythonic. Except maybe the parent, but I think that's just unfortunate wording. It's explicitly using a non-standard definition of pythonic ("part of the language").

Re:On Learning Rust and Go: Migrating Away from Python by joshuamorton on Sunday March 24, 2019 @05:07PM (#19478791)
You know that protocols and static duck typing are possible, right?

They're not at odds at all.

Re:On Learning Rust and Go: Migrating Away from Python by computerex on Sunday March 24, 2019 @10:36AM (#19476563)
Not telling you what you have done or not done. But this is the internet, you need to provide proof in order for your statements to be taken seriously. I am not telling you to do anything, by all means don't provide any proof.
Re:On Learning Rust and Go: Migrating Away from Python by hello_moto on Sunday March 24, 2019 @11:57AM (#19477005)
> But this is the internet

I find that on the internet, after proofs are given, more disagreement ensues. When one mind's is set, is set in stone. Proof or without proof.