3 ms·
If 100 things are each responsible 1% of the total "pollution", how significant would you rate each of them? Also don't overlook that just one byte more can do
by PavlovsCat 7y ago
If 100 things are each responsible 1% of the total "pollution", how significant would you rate each of them?
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.
- james-skemp 7y agoRemoving 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.
- throwaway744678 7y agoAnd most importantly, use only one-letter variables. Mother Earth will thank you.
- PavlovsCat 7y agoI 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.
- james-skemp 7y agoI think, and hope, the throwaway was being sarcastic. :)
- PavlovsCat 7y agoFor Sublime Text, you can add "trim_trailing_white_space_on_save" to the user settings and set it to true :)
- james-skemp 7y agoVS 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.