• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Pet Hate......
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pet Hate......


  • Subject: Re: Pet Hate......
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 18 Jun 2015 11:16:36 -0700


On Jun 18, 2015, at 10:12 AM, Dave <email@hidden> wrote:

It amazes me that XCode still actually puts formatting information in the file itself, IMO, it would be better to store source files with no white space and reformat it as per the users preferences when they open the file.

That would make source code unreadable in other text editors, in ‘git’ diffs, on Github, etc. It would probably also completely break merging in any source control system, since that’s always based on source lines. Source control would probably treat the file as binary and refuse to do any diffing/merging.

That way, we could all views comments and format it how we like to see it. For instance, some people like the K&R Style and some don’t, some like to indent code, some don’t. 
This is how Think Pascal worked IIRC (was a *long* time ago!).

Yeah, and about ten years ago I dug up an old floppy with some interesting Pascal code I’d written back in 1989 and wanted to have a look at. Only I couldn’t read it, because THINK Pascal saved source files in an proprietary binary format. I had to dig up an old copy of the app (on another floppy) and find an old Mac that it would run on, so I could open the files and save them as text. If that happened now I would probably just give up. :-p

I think the most reasonable solution is what Go does — there is one standard blessed official style, and Go ships with a tool that reformats source code into that style. Generally you want to always check in code in that style, so a lot of editor plugins will automatically invoke “go fmt" to reformat your code whenever you save. I like this a lot, actually.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Pet Hate......
      • From: Sean McBride <email@hidden>
    • Re: Pet Hate......
      • From: Dave <email@hidden>
References: 
 >Re: Pet Hate...... (From: Steve Mills <email@hidden>)
 >Re: Pet Hate...... (From: Sean McBride <email@hidden>)
 >Re: Pet Hate...... (From: Dave <email@hidden>)

  • Prev by Date: Re: Pet Hate......
  • Next by Date: Re: Pet Hate......
  • Previous by thread: Re: Pet Hate......
  • Next by thread: Re: Pet Hate......
  • Index(es):
    • Date
    • Thread