Live data from Hacker News

Write Clean, Professional, Maintainable, Quality Code in Python

blog.jetbrains.com

21–30 of 56 posts

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#21
My biggest problem with the JetBrains IDE is that it scatters file turds through your project; making it a pain for developers to use source control without generating random conflicts. An IDE's files have no reason to be version controlled in every project (nor should a project require every developer to use the same IDE).

If they had a sane way to keep IDE files in a single top level project directory, I would be much happier.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#22
post #13

Earlier quoted context omitted.

Me too!

You know about the free community edition, right?

Unfortunately the community edition can't do a lot of nice stuff i care about like remote debug/run, remote interpreters, vagrant integration and some other nice things that make the difference between ST3 and pycharm for me. Without those i can stick with ST3 and python plugins.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#23
post #12

Earlier quoted context omitted.

[deleted]

Certainly in eclipse it's possible to specify formatting rules. You can also use the checkstyle plugin to enforce correct formatting.

Almost all good IDEs allow that. All IntelliJ ones do that. They can even share the code formatting rules and they can be committed to version control so that your whole team uses the same rules.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#24
post #21

My biggest problem with the JetBrains IDE is that it scatters file turds through your project; making it a pain for developers to use source control without generating random conflicts. An IDE's files have no reason to be version controlled in every project (nor should a project require every developer to use the same IDE). If they had a sane way to keep IDE files in a single top level project directory, I would be m…

I find that this typically isn't a problem when you instruct git to ignore those files.

Brilliant way of describing the IDE metadata files, BTW. I got a nice chuckle from that.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#25
post #21

My biggest problem with the JetBrains IDE is that it scatters file turds through your project; making it a pain for developers to use source control without generating random conflicts. An IDE's files have no reason to be version controlled in every project (nor should a project require every developer to use the same IDE). If they had a sane way to keep IDE files in a single top level project directory, I would be m…

I have no idea what you are talking about. PyCharm stores every setting in a directory called ".idea"

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#26
post #21

My biggest problem with the JetBrains IDE is that it scatters file turds through your project; making it a pain for developers to use source control without generating random conflicts. An IDE's files have no reason to be version controlled in every project (nor should a project require every developer to use the same IDE). If they had a sane way to keep IDE files in a single top level project directory, I would be m…

I've certainly seen the IDE turd files you mentioned, but I'm pretty sure they all live in .idea. Github has a nice .gitignore build for these (and other common ignores):

https://github.com/github/gitignore/blob/master/Global/JetBr...

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#27

I have been using PyCharm for few months after using Sublime Text 2 for years. It is very well engineered tool and has greatly improved my code quality. Just came to know 'Python code compatibility checks' option. Will definitely be helpful as I am starting to write Python 2/3 compatible code.

I too am a convert from ST to PyCharm and PHPStorm. Although, I'm still using ST for editing javascript. I need to break that habit.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#28

vim+python-mode is more than enough for my needs.

Same here. It seems like a really solid IDE, but I like a more lightweight development environment, and there's always that one vim command that vim emulator plugins miss. However, I've recommended PyCharm to several of my coworkers who use IntelliJ for Java development, and they love it.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#29
post #8

An IDE will never help you develop "Clean, Professional, Maintainable, [and] Quality" code if you're not interested in writing it in the first place. And if you're interested in writing good code in the first place, an IDE is hardly a requirement. Frankly, as a developer who has tried a number of IDE's and text editors, I'm not sold on the idea that your choice of editing environment has any correlation to any of tho…

Nor will python. Python is dynamically typed. It may not be impossible to write big functioning python apps, but it's damn hard.

And specifically, it's a lot harder than doing it in java or C++. I've seen C++ codebases that exceed 8 million lines of code and held together (not without friction, that I guarantee). I've seen java codebases with about half that that held together a lot better than the C++ ones.

Even accounting for the fact that python easily lets you achieve 5 times as much in the same amount of lines (at the cost, imho, of more surprises when wrong types get passed to your functions). I'm not sure "normal python" is more than a little bit more succint than (good) C++ though. Easier to read, sure, if you're allowed to make assumptions about types. But not that much shorter.

I've yet to see the first million line python codebase. And python has certainly had sufficient time to develop such codebases. Why aren't they here already ? Those C++ codebases were almost operating systems though (with extremely tricky threading support libraries, every project it's own of course), something you fundamentally can't do in python. The java codebases were financial stuff though, something that could easily be done in python, and they certainly have the money to absorb the increased hardware cost, and looking to have faster development turnaround. That's another discussion I can guarantee you will have with your boss if your app really grows, the hardware cost. When it comes right down to it, a programmer is worth (rule of thumb) about 15 servers. If python means one less programmer, but 50 extra servers, you will lose that discussion with your boss.

Dynamic typing is certainly a massive advantage for small codebases. It becomes more and more of a disaster on larger ones though. So an IDE for python ... it merely lets you lose the battle with your code that much faster.

Re: Write Clean, Professional, Maintainable, Quality Code in Python

#30
post #8

An IDE will never help you develop "Clean, Professional, Maintainable, [and] Quality" code if you're not interested in writing it in the first place. And if you're interested in writing good code in the first place, an IDE is hardly a requirement. Frankly, as a developer who has tried a number of IDE's and text editors, I'm not sold on the idea that your choice of editing environment has any correlation to any of tho…

However, I think great IDE will help OTHER people to maintenance and refactor code to clean, professional, and maintainable one. I always use IDE to refactor code, as other developers might not writing clean code, even myself.

"Senior Code Janitor" would be a fun title to hold.
Post reply on HN