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
-
Wtf???!!!!
Spaces are better indeed.
They get displayed equally in every editor, while tabs get displayed, according to the editor settings. -
Actually official Google style is spaces, becouse od limited set od white signs which are allowed in file.
Android Studio also uses spaces in auto format. -
Pressing the space bar is shit, but when the editor handles them like they're tabs (and does it well) spaces are better because they display consistently. Doesn't matter if you're the only one working on the project, but then you have other problems.
-
Konsole30496yAll good editors use spaces instead of tabs. Spaces are always much better. Especially when you are working with python.
Otherwise be ready to get inconsistent Use of space and Tabs error.
All good editors like VSCode , Pycharm etc usually insert spaces whenever u use tabs -
Rocket3G2006yWith spaces you get into the argument wether to indent by 2, 4 or maybe even 8 spaces. Without shared editor configuration this will end up in inconsistent code where one file is indented with 2 spaces and others are indented with 4 spaces.
If you'd just indent with one tab you can set wether one tab is displayed as 2 spaces, or 4, or even 3 if you fancy. That way, everybody can be happy!
Use tabs for indentation, and spaces for alignment, but always comply to the standards in the project -
There is Typescript. But JS is by far not the biggest problem in web development really.
-
Iskander5886y@snaz Whoever does this is retarded. If we could just agree that 1 tab = 1 indentation level then everybody will be happy. Depending on my screen and/or preferences, I can set the tabs on my IDE to be displayed as big or as small as I want (2 spaces, 4 spaces, 8 spaces, whatever I want)
Related Rants
1. Kill every last bastard who uses spaces instead of tabs or anyone who thinks that's better.
2. Break every text editor that has the option of transforming beautiful code tabs into hideous spaces.
3. Make a statically typed language that's good enough to replace JS and the pile of hacks we have in the web today.
rant
wk141