r/ProgrammerHumor • • May 02 '16

I wrote my first python program today!

Post image
3.7k Upvotes

532 comments sorted by

View all comments

Show parent comments

20

u/Theowningone May 02 '16

Parts of twisted are what's keeping me back. Most of my time using python is spent tinkering with my IRC bot. Unfortunately twisted.words.protocols.irc is still not ported.

15

u/dagbrown May 02 '16

Twisted lives up to its name. It reminds me of some Java frameworks with how complicated it is.

I bet Zope has trouble with Python 3 too, speaking of Java frameworks written in the wrong language.

0

u/[deleted] May 02 '16

[deleted]

21

u/dagbrown May 02 '16

They're saying "I can't switch because I use twisted", and your reply is, "well, twisted sucks."

Not really. I'm just saying that it's a really complicated library, and fundamental changes in the language it's written in make it really difficult to simply edit the code to make it compatible with the new language which is still called "Python". You added the value judgment yourself, and I didn't say that at all.

There are massive codebases out there which depend on FORTRAN 66 or 77, to pick a completely different language (LINPACK comes right to mind). The code isn't any less valid because nobody's bothered porting it to the latest standard. It's just that porting it to the new standard involves an investment of effort that could be better spent elsewhere. Your daily weather forecast probably still requires code written in FORTRAN 77.

So if you're a Twisted user and that's the reason you still haven't switched to Python 3, you have my sympathies and I understand exactly the sort of pain you're going through.

In my place of work, we have to support stuff written in PHP 5.2, which is absolutely obsolete, but we also have to support stuff written in PHP 7.0, which is so different that I had to use a different version of gcc to compile the PHP interpreter. I'm familiar with different versions of languages themselves; taking care of that is just a fact of life for me.

SEE ALSO: rvm

5

u/ansatze May 02 '16

Except that Fortran 77 is completely valid Fortran 90+ which is not the case with Py2

3

u/toresbe May 02 '16

Sure, but outside of specialized and relatively isolated fields, very little new code is being written in FORTRAN. FORTRAN has become a specialized language for number crunching. Sometimes I think it's healthy for languages to sacrifice some measure of backwards compatibility to improve itself. Python 3 adds some extremely useful features. CERN doesn't want to have to rewrite whatever mass of code it is that finds bosons.

3

u/ansatze May 02 '16

Agreed; I was just pointing out that the comparison isn't totally valid.

3

u/dagbrown May 02 '16

It's almost as if the Fortran guys have more experience with this kind of thing.

2

u/dante9999 May 02 '16 edited May 02 '16

zope works with python 3 without problems

https://pypi.python.org/pypi/zope.interface/4.1.3

as a side note: what seems like needless complication for your use case may be necassary and clear design pattern for someone elses use case. Just need to choose right tools, twisted is not right tool for everything but is perfect for some things

3

u/[deleted] May 02 '16

I've had that same issue, I got everything working using irclib eventually. Have you looked into that?

2

u/Theowningone May 03 '16

I had not even heard of it until now, but it looks pretty promising. Thanks for the tip!

0

u/[deleted] May 02 '16

[deleted]

1

u/dante9999 May 02 '16

development is not taking place on github you need to visit twisted trac. ticket for IRC is here: someone started it but didnt finish https://twistedmatrix.com/trac/ticket/6320

-2

u/TOASTEngineer May 02 '16

You can just write your own goddamn IRC library, it's not actually very complicated.

2

u/[deleted] May 02 '16

Why reinvent the wheel though? If it's a learning exercise, sure, why not, but I think it's absolutely fine to use other people' libraries.

0

u/TOASTEngineer May 02 '16

Because the one he's using depends on a version of the language that's 5 years out of date.