DEV Community

Discussion on: Beginners Guide to Auto Formatting

hanpari profile image
Pavel Morava

I believe there is no need to start bragging about Python with the old cliche comparison of how Java and Python print a line.

Seriously, I saw this too many times. As for readability of Python, trust me I saw one-liners made in Python cryptic enough to make you cry.

The rest of article is fine. As for Black, even if it is highly opinionated, one still can at least use directives to make it skip particular lines or blocks.

But most importantly, Black is priceless when it comes to git as the formatting stays consistent with no additional settings across platforms.

I guess one of the most used autoformatters in Python world would be the one built in PyCharm, which I suspect to be home-made by Jetbrains.

Anyway, good summary.

vybhav profile image
vybhav72954 Author • Edited

I get it! Maybe i failed to convey my point correctly here, People use Python because they think the Syntax is way easier and hence should be a go-to language for everyone. This is not wrong actually but is not what Python stands for. The comparison between Java and Python is meant to showcase what we actually perceive is the biggest benefit of Python vs what the actual benefits are.

I will keep this in my mind for next for sure.

And I definitely agree Python many a time could be way complicated.

If am not wrong Python uses autopep8 only, with some additional customizations available.

Black definitely allows some changes as I stated explicitly but compared to others is way more strict (that's the whole point of Black anyways).

Thanks for the suggestion, I would try to incorporate your suggestions next time and would work on my writing skills.

hanpari profile image
Pavel Morava

I think you do not need to introduce Python when you want to write about part of its ecosystem.

I guess somebody who knows nothing of Python will hardly find attractive Python's autoformatters 😉

Moreover, the comparison you used is dated to Java 7 times I believe.

Since then Python and Java have changed. Thanks to optional static typing, Python is visually more complex while Java has improved a bit.

Moreover, if Kotlin prevails over Java, Python will have harder times as Kotlin is more sexy than Java. 😁

Thread Thread
vybhav profile image
vybhav72954 Author

I wrote everything from a beginner's perspective and not going to lie, it makes blogs needlessly lengthy. Actually what inspired me to write this article was the DeepSource code analyzer I have in one of my Repos, and most new contributors always are terrified about failing checks in the Pull Requests because of unstructured code. I think auto formatters would be actually a good tool for them to use and would cause me lesser headaches as well, as I can expect some better quality code.

Definitely, Kotlin is love, I just started playing around with it, it's fun. Don't get me wrong, Java being the first language I learned, is one of my favs.