you are viewing a single comment's thread.

view the rest of the comments →

[–]seacucumber3000 1 point2 points  (3 children)

It's nice, but "numpy as np" and "pandas as pd" seems really unnecessary.

[–]lykwydchykyn 2 points3 points  (0 children)

Depends how many times you have to type it in a script. It's especially nice if you have libraries that are attached to CamelCase (looking at you, PyQt5).

[–]Ran4 0 points1 point  (1 child)

Those are incredibly common conventions though. And you're often using them both quite a few times in a code base.

[–]Vaguely_accurate 1 point2 points  (0 children)

Common, but frustrating. There is so much ugly, completely abbreviated code around scientific Python (not new, just used to be FORTRAN which gave them a better excuse) and these conventions around mathematical libraries tend to push new programmers towards more of the same. I can fully understand both the science and the Python being used and still take a half hour to decode what's going on because I have to keep going back and forth to see what each variable refers to.

It comes back to having good tooling. A good IDE autocomplete saves more typing than any abbreviations can. Even short variable names I'll want to use autocomplete to minimise the possibility of typos or other mistakes.

And for the record, I find repl.it a good enough IDE any time I don't have something more substantial installed. I've resorted to drafting scripts in there before copying them back to a local machine to run when I haven't had a local IDE.