I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
To be fair, the amount of bandwidth saved by a company using tabs instead of spaces for code indentation probably doesn't even approach that used by one site visitor loading this post.
Oh, I commented before I remembered what I was going to add: your editor should be able to switch between spaces and tabs, so if you personally like spaces, then it will use those, but convert back to tabs when you save. Or when you commit, or whatever.
Indeed, you are right, for local and individual use, it has little impact!
But on a global scale, itβs something else and each individual action is important!
Let's take a concrete example: Worpress.
The current version 6.4.3 has 1,385,052 indentations using tabs.
The total uncompressed weight is 69.7 MB
If we replace all tabs with 4 spaces, then we get 1,385,052 * (4 - 1) = 3,975,156 bytes
WordPress is therefore 4 MB lighter by using tabs instead of 4 spaces per installation of this CMS.
With more than 40 million WordPress sites, we can estimate the overall gain at 152 TB.
That's huge!
It would be interesting to know how much 152 TB costs in energy and carbon footprint.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
The key word there is "uncompressed" :) Nothing is regularly sent over the wire in that format - and once the wordpress zip file is unpacked, 99% of those files will sit there doing nothing anyway.
Still, you're right - if everyone optimised everything they could, the world would be a better place!
your editor should be able to switch between spaces and tabs
Or more simple, your editor lets you set how large a tab is ( : I have mine set to 3, because 2 felt too small and 4 was too large.
I suppose the distinction matters if people use the Space key instead of the Tab key to indent code, though even when I was using spaces I always used the Tab key to indent.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
Thinking about it I very rarely use anything to indent manually. The editor does it for me and if I want to shift the indentation of a block I'll use something different there as well.
Ah, I just remembered a formatter like Prettier would automatically take care of all that, and I don't have that on every project which is why I still manually indent every once in a while.
You're right, the editor takes care of most of it. I mostly find myself adjusting things when either copying and pasting or dealing with multi-line strings.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To be fair, the amount of bandwidth saved by a company using tabs instead of spaces for code indentation probably doesn't even approach that used by one site visitor loading this post.
Oh, I commented before I remembered what I was going to add: your editor should be able to switch between spaces and tabs, so if you personally like spaces, then it will use those, but convert back to tabs when you save. Or when you commit, or whatever.
Indeed, you are right, for local and individual use, it has little impact!
But on a global scale, itβs something else and each individual action is important!
Let's take a concrete example: Worpress.
The current version 6.4.3 has 1,385,052 indentations using tabs.
The total uncompressed weight is 69.7 MB
If we replace all tabs with 4 spaces, then we get 1,385,052 * (4 - 1) = 3,975,156 bytes
WordPress is therefore 4 MB lighter by using tabs instead of 4 spaces per installation of this CMS.
With more than 40 million WordPress sites, we can estimate the overall gain at 152 TB.
That's huge!
It would be interesting to know how much 152 TB costs in energy and carbon footprint.
The key word there is "uncompressed" :) Nothing is regularly sent over the wire in that format - and once the wordpress zip file is unpacked, 99% of those files will sit there doing nothing anyway.
Still, you're right - if everyone optimised everything they could, the world would be a better place!
Or more simple, your editor lets you set how large a tab is ( : I have mine set to 3, because 2 felt too small and 4 was too large.
I suppose the distinction matters if people use the Space key instead of the Tab key to indent code, though even when I was using spaces I always used the Tab key to indent.
Thinking about it I very rarely use anything to indent manually. The editor does it for me and if I want to shift the indentation of a block I'll use something different there as well.
Ah, I just remembered a formatter like Prettier would automatically take care of all that, and I don't have that on every project which is why I still manually indent every once in a while.
You're right, the editor takes care of most of it. I mostly find myself adjusting things when either copying and pasting or dealing with multi-line strings.