Write Clean, Professional, Maintainable, Quality Code in Python
blog.jetbrains.com
blog.jetbrains.com
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 those titular descriptors in the first place.
I always use IDE to refactor code, as other developers might not writing clean code, even myself.
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.
Working on the code base with dynamic typing wasn't _that_ hard. Certainly not as hard as people make it out to be.
One of the main benefits of using Python for me, is that there is usually a (decent quality) library written. If you are having to re-implement everything from scratch and are not including the libraries.
The last thing close to a million lines of code I worked on was horrendous. Legacy banking app in VB6 (after MS had stopped support). I would write a method to do something, then a month later I would find another method somewhere else in the code doing the same thing . At the time I had a lot of Perl experience and could see looking at it the code size could be halved using a more powerful language, and in my opinion, that would have reduced the chance of repeating code (though to be fair the management practices were a far bigger offender).
Good design will give you a lot cleaner professional maintainable code.
I do databases, but I like Linus's quite about getting the data structures right, and not needing to worry about the code. I find if the application level is getting too complex, it probably means the database design isn't matching the problem correctly. Others on my team would keep adding "if" statements to the forming ball of mud. (Usually) I find it easier to take the pain of a schema migration up front. The code then becomes simpler, more reliable, and I can usually forget about it.
As for the text editor comment. In general no, but I know a lot of poor programmers who are too lazy to set up / learn an IDE (or any other way of using a step through debugger).
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 wish they had another big sale so i could afford the latest pycharm again.. :(
I wish they had a "startup" package so even boots trappers can get started right.
You could also stay at your day job for a day or two longer and save up for the $99 personal edition.
Wishful thinking: We'd be willing to pay a higher price in the future since that would mean more pizza money for us now
In another startup that I was a part of, we were more than happy to pay the significantly higher price for Atlassian products once we grew past the 10 people limit.
More details here: https://www.jetbrains.com/estore/startup/
I keep repeating a cycle where I try an IDE because it sounds interesting, but a few weeks later I find I'm spending a lot of time doing things like arranging tool windows, dismissing alerts, trying to figure out how to turn off or customize features. So I always go back to a simpler text editor that I've been using for 15+ years and does everything I need very well without the sluggishness of a feature-rich IDE.
For example, every time I open a PyCharm project I get an alert I need to dismiss that managing files will be slow because they're on a network drive. Technically it's a network drive but it's really mounted from a VM on my local machine, so no, it's not slow, and if it was I wouldn't need Clippy telling me so. There may or may not be a way to turn off this alert, but I shouldn't have to hunt for these things so often. I want to use PyCharm but keep getting annoyed with it.
> Maybe everyone needs only 2% of the feature set, and a different 2%, but we all have to pay for the bloat anyway.
This is not a useful mental model for thinking about software. First, big doesn't equal bloated, and one thing my IntelliJ IDEA fanboy colleagues highlight is just how sleek, light weight and fast it is, especially compared with Eclipse (we're in Java land). Second, if everybody only uses 2% of the package, then basic price theory tells us that everybody is only paying for those 2%. (I think, in reality, the number is significantly higher, although I agree that probably nobody uses 100% of the features).
Jetbrains' products are not immune from bloat.
So an IDE, also, can get into that state. Which is maybe why I can never find an IDE I like to use. I could only see calling PyCharm "sleek" if that was in comparison to something like Eclipse. It's a better choice than that, but still not the experience that it could be, or that I'm looking for.
Maybe it gets better with practice, so I'll keep trying a bit more, but currently, count me as unimpressed:
1 - About code inspection. Well, I fully understand that inspecting Python code is hard, and any tool will have either false positives, or false negatives. But PyCharm gets false positives to the extreme, it complains about not resolving Python standard functions (like open), and it can't find some libraries at my virtualenv. It's so full of false positives that I'm not sure I'll be able to keep reading them - I normaly can't stand code with warnings, but in PyCharm there is no other way.
2 - About formating. It fully enforces PEP8, the most completely enforcement I've seen on any tool (no I didn't try the emacs el for that). That's a good thing if there is an option to turn it off, what I don't know, because I didn't search for it yet.
3 - About refactoring. No, PyCharm, I don't want Django to change because I changed a function name in my code. Maybe there is a way to tell it not to touch some dirs, but the default settings makes PyCharm much less reliable and slower than grepping the old name and replacing it by hand. I'll try to find such setting when I get out of work today, but it's making the case of PyCharm being easier to setup way less appealing.
If they had a sane way to keep IDE files in a single top level project directory, I would be much happier.
Brilliant way of describing the IDE metadata files, BTW. I got a nice chuckle from that.
https://github.com/github/gitignore/blob/master/Global/JetBr...
gitignore .idea/ and you should have no trouble. What other type of files are you finding scattered in the project?
I'm a fan of JetBrains and I own PyCharm and WebStorm, but I don't want this to become a trend...
I do mostly Java, and wow I never realized how much I'd miss that until it was gone!
I would like 2 spaces for JavaScript and HTML but 4 for Python.
Or, it's certainly possible to have custom formatting rules in IntelliJ and AppCode and I assume that PyCharm is the same.