Live data from Hacker News

Write Clean, Professional, Maintainable, Quality Code in Python

blog.jetbrains.com

41–50 of 56 posts

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

#41

PyCharm was the reason I started coding in Python. I know it sounds weird, but I was a visual studio addict & going to sublime text or a plain text editor just didn't compare. I wish they had a "startup" package so even boots trappers can get started right.

They actually do. It says "50% OFF for startups" on the pricing page: http://www.jetbrains.com/pycharm/buy/

More details here: https://www.jetbrains.com/estore/startup/

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

#42
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…

I was thinking exactly the same thing reading the headline.

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).

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

#43
post #38
post #35

In PyCharm can you set the indentation size (# of spaces per tab) per file type? I would like 2 spaces for JavaScript and HTML but 4 for Python.

Yes, you can. They can be set from: File->Settings->[Project Settings] Code style. You'll then be able to set the indentation level for each filetype separately.

Thanks, I always use the Help -> Find Action to get to settings. I never thought to look under File.

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

#44
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…

All of the IDE files are in fact in the .idea folder.

gitignore .idea/ and you should have no trouble. What other type of files are you finding scattered in the project?

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

#45
post #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 acc…

Do you include all libraries when you measure the size of a codebase?

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).

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

#46
post #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 acc…

Python is currently making inroads in finance, both Bank of America and JP Morgan have large projects involving it. I've worked on one of them, and like you I'm unusure if it's a good long-term plan, though I don't have experience with large codebases in other languages. Performance is an issue and navigating a large Python codebase is tricky. One thing that doesn't help is that many of the developers come from Java/C#/C++ and pick up Python quickly but with "unpythonic" habits, the code ends up being almost as verbose as Java but with none of the type safety.

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

#47

Earlier quoted context omitted.

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.

WebStorm is a solid javascript IDE, I recommend giving the trial a shot.

PHPStorm is essentially a superset of WebStorm.

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

#48
The linked article is really nothing more than an advertisement for PyCharm. Is it acceptable now for companies to just post links to advertisements for their products on Hacker News?

I'm a fan of JetBrains and I own PyCharm and WebStorm, but I don't want this to become a trend...

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

#50
post #41

PyCharm was the reason I started coding in Python. I know it sounds weird, but I was a visual studio addict & going to sublime text or a plain text editor just didn't compare. I wish they had a "startup" package so even boots trappers can get started right.

They actually do. It says "50% OFF for startups" on the pricing page: http://www.jetbrains.com/pycharm/buy/ More details here: https://www.jetbrains.com/estore/startup/

Sweet! Thank you! If you're ever in Melbourne, FL, you can swing by & partake in he extra pizza you just helped us buy!
Post reply on HN