#986 closed enhancement (fixed)
Code Cleanup: Tabs instead of Four Spaces
Reported by: | MaThIbUs | Owned by: | skippy |
---|---|---|---|
Milestone: | 2.1 | Priority: | low |
Severity: | minor | Version: | 2.1 |
Component: | General | Keywords: | bg|dev-feedback bg|has-patch |
Focuses: | Cc: |
Description
WordPress can be made even more lightweight by replacing every instance of four repetitive spaces by a tab. I did this for the whole wp-includes/ directory. [Patch included.] Its size went from 406,374 bytes to 383,963 bytes. Spaces are all over the place.
Attachments (6)
Change History (15)
#3
@
19 years ago
- Keywords bg|dev-feedback added
- Owner changed from anonymous to skippy
- Priority changed from normal to low
- Status changed from new to assigned
- Version changed from 1.5.1 to 1.6
I agree this is a good idea; and 1.6 makes a good target for this.
#4
@
19 years ago
- Milestone set to 1.6
Agreed. 1.6 milestone.
This should be checked over though, and not a blind search/replace. I've seen 5 spaces be used sometimes, not just 4... so if you just replaced 4 spaces, you'd be left with tab + single space.
I don't know if we should be doing this as we patch other issues or on a pure cleanup patch run... or a little of each. I find it hard to resist doing code cleanup as I go, and MaThIbUs is the same way. The only problem with that is that it clutters up the changeset... makes it harder to see what actual functional code was changed.
#5
@
19 years ago
This should be checked over though, and not a blind search/replace. I've seen 5 spaces be used sometimes, not just 4... so if you just replaced 4 spaces, you'd be left with tab + single space.
Indeed. I actually spent an entire morning creating the patch that has now been deleted, just because of the many repetitive spaces used in functions (i.e. that have their use) and the 5 vs. 4 spaces thing. So... yeahhh.
The excellent UltraEdit-32 Text-Editor features some 1337 functions for this stuff ("Leading Spaces to Tabs", just one click on a button!).
#7
@
19 years ago
I'm going to be working through the files in batches, fixing this and many more problems. Going to wait until some of my pending fixes go in before spending time on this... this is the kind of patch you want to go in immediately, before any other code is changed.
If we do this, let's wait for a major release. I personally loathe tabs, but the official WP coding guidelines require them. So, doing a big tabify commit at the start of our next major release development cycle could happen. I'd rather not churn the files in the 1.5 dot releases.
edited on: 02-26-05 21:02