Ticket #986 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Code Cleanup: Tabs instead of Four Spaces

Reported by: MaThIbUs Assigned to: skippy
Priority: low Milestone: 2.1
Component: General Version: 2.1
Severity: minor Keywords: bg|dev-feedback bg|has-patch
Cc: MaThIbUs

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

986-import.diff (23.2 kB) - added by Nazgul on 07/05/06 20:26:00.
986-admin.diff (172.1 kB) - added by Nazgul on 07/05/06 21:13:40.
986-plugins.diff (5.3 kB) - added by Nazgul on 07/05/06 21:19:35.
986-themes.diff (19.8 kB) - added by Nazgul on 07/05/06 21:30:04.
986-root.diff (69.2 kB) - added by Nazgul on 07/05/06 21:42:24.
986-includes.diff (210.5 kB) - added by Nazgul on 07/05/06 22:11:49.

Change History

02/26/05 12:12:03 changed by MaThIbUs

  • Patch set to No.

02/26/05 21:02:10 changed by ryan

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

06/30/05 11:07:44 changed by skippy

  • keywords set to bg|dev-feedback.
  • owner changed from anonymous to skippy.
  • version changed from 1.5.1 to 1.6.
  • status changed from new to assigned.
  • priority changed from normal to low.

I agree this is a good idea; and 1.6 makes a good target for this.

07/01/05 10:38:21 changed by markjaquith

  • 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.

09/24/05 06:58:22 changed by MathiasBynens

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!).

11/14/05 11:36:06 changed by matt

  • milestone changed from 1.6 to 2.1.

02/12/06 05:55:50 changed by markjaquith

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.

07/05/06 20:26:00 changed by Nazgul

  • attachment 986-import.diff added.

07/05/06 21:13:40 changed by Nazgul

  • attachment 986-admin.diff added.

07/05/06 21:19:35 changed by Nazgul

  • attachment 986-plugins.diff added.

07/05/06 21:30:04 changed by Nazgul

  • attachment 986-themes.diff added.

07/05/06 21:42:24 changed by Nazgul

  • attachment 986-root.diff added.

07/05/06 22:11:49 changed by Nazgul

  • attachment 986-includes.diff added.

07/05/06 22:15:06 changed by Nazgul

  • keywords changed from bg|dev-feedback to bg|dev-feedback bg|has-patch.
  • version changed from 1.6 to 2.1.
  • type changed from defect to enhancement.

I've made some patches that remove trailing spaces and converts starting spaces to tabs. It's not perfect, but it gets us in that direction.

11/19/06 07:56:38 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [4495]) Remove trailing spaces and convert spaces to tabs. Props Nazgul. fixes #986