Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@m12i Looks like I'm going to be working on a prettify plugin install for my editor then.
-
It shouldnt be something that should prevent you from being productive. If there is a standard in your company to stick to. Do so, else find a preference and setup your environment to handle it for you. That question will invoke too many split and biased preferences.
-
catadoxa4166yI love the evil little timebombs you can create mixing tabs and spaces in Python. Since they only have to be consistent at the block level you can totally make a working function that uses both tabs and spaces but as soon as someone tries to modify it they are in for a world of pain. Also in Python 2.x 8 spaces = 1 tab, so you can do even more evil shenanigans.
Mind you, I wouldn't actually do this (probably) but it's fun to know you can. -
jonii25346y@catadoxa you sound like a crazy chemistry teacher "[...]and this is how you would build a bomb. We won't do that though! But just knowing how to does feel powerful, right?"
-
janbe3026yI always use tabs. Unless otherwise specified by company or something. It’s easy, makes code readable and pretty.
-
I personally use 2 spaces for javascript and tab for Python but as i always say.. Whatever floats your boat man. 🤷🏻♂️
Also check out https://editorconfig.org -
For c/c++ 8 spaced hard tabs 😅😅
But when I use rust, go, then 4 space hard tabs
For lisp, Nim, elixir, crystal, 2 space tabs (not hard) -
4 for everything. And spaces over tabs. Consistency makes reading any language feel familiar. Spaces allow any IDE/compiler/interpreter to parse without an issue
Related Rants
What is considered best practice for code indentation? When I'm working with HTML and Javascript my rule of thumb is 2 spaces for indentation, and with Java and Python it's 4 spaces.
Also I'm trying to break my bad habit of mixing tabs and spaces. It's messing with the laws of physics.
question
tabs
indentation
spaces