Re:Digital pollution
by james-skemp on Saturday October 19, 2019 @10:16AM
(#21298599)
Removing spaces from the end of lines, changing double spaces in HTML to one, and using tabs for indentation, these are a few of my favorite things.
Re:Digital pollution
by throwaway744678 on Saturday October 19, 2019 @10:51AM
(#21298782)
And most importantly, use only one-letter variables. Mother Earth will thank you.
Re:Digital pollution
by PavlovsCat on Saturday October 19, 2019 @11:32AM
(#21298993)
I find myself doing the opposite, since I write stuff once (at most, since there is auto-complete and copy & paste), but read it a lot more often. I find reading long variable names takes exactly as long as reading short words, but with less mental overhead. So instead of something like srv_mem_max, I have stuff like "server__max_allocated_memory". It doesn't affect the output or the compiled result, after all.
Re:Digital pollution
by james-skemp on Saturday October 19, 2019 @02:49PM
(#21300045)
I think, and hope, the throwaway was being sarcastic. :)
Re:Digital pollution
by PavlovsCat on Saturday October 19, 2019 @11:15AM
(#21298900)
For Sublime Text, you can add "trim_trailing_white_space_on_save" to the user settings and set it to true :)
Re:Digital pollution
by james-skemp on Saturday October 19, 2019 @02:54PM
(#21300070)
VS Code is very similar, with the additional support for .EditorConfig files.
I do have a new line at the end of files now so that Git doesn't complain. That and new lines before some curly braces (either JS/TS/C#, can't recall which) is the only thing I've changed over the last decade+. The fact that I don't recall which I do where suggests I might want to reevaluate that, if it's not in a language that's going to compile it out.
Also don't overlook that just one byte more can double the amount of packets that need to be sent for something, just a little bloat can mean individual items in a list of millions no longer fully fit in the CPU cache, and so on. We also can't really know how many times things (that are put on the web) get handled by how many computers and users, so any byte you save could be multiplied by infinity. If I can do it easily, cutting out bloat is always good IMO. Personally, I find it enjoyable.