freelance84 Posted March 21, 2012 Share Posted March 21, 2012 I'm currently in the middle of a debate with a friend.. I'm quite strict when i lay out my code, everything is indented properly... and i like to indent with tabs. However I keep getting slowed down when I hit some code which has been indented with spaces. I have been tag teaming some freelance over the past few months with a friend who insists on using spaces over tabs. I know this is a very small thing but i was wondering what other people did, and if they had a reason..? Cheers, John. Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/ Share on other sites More sharing options...
Philip Posted March 21, 2012 Share Posted March 21, 2012 Spaces. Period. Tabs are inconsistent on sizes across platforms. Spaces will remain the same size. Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1329926 Share on other sites More sharing options...
KevinM1 Posted March 21, 2012 Share Posted March 21, 2012 Yup, spaces. Of course, any good IDE will allow you to map x spaces to the tab button, giving you the best of both worlds. Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1329931 Share on other sites More sharing options...
freelance84 Posted March 21, 2012 Author Share Posted March 21, 2012 That makes sense.. cheers Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1329933 Share on other sites More sharing options...
Mahngiel Posted March 21, 2012 Share Posted March 21, 2012 tabs of 4 spaces and LF format for line endings Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1329947 Share on other sites More sharing options...
scootstah Posted March 21, 2012 Share Posted March 21, 2012 It's common to see tabs for indentation and spaces for alignment. This is what I do. Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1330014 Share on other sites More sharing options...
thehippy Posted March 22, 2012 Share Posted March 22, 2012 The PHP fig (framework interop group) that was formed to help flush out some common standards between the big frameworks has and is still having a discussion over a common coding style. As part of the discussion a survey was made of some of the projects of how they format their code. Here is a google spreadsheet with what they've collected. While most people... err I mean developers use spaces there is still a tab following. Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1330329 Share on other sites More sharing options...
kicken Posted March 26, 2012 Share Posted March 26, 2012 I tend to prefer tabs in my code. I can see where for a larger project with several developers, spaces may yield more consistent formatting overall. Regardless of which you choose every needs to agree on the same thing and same width as well or it doesn't really make a difference. Quote Link to comment https://forums.phpfreaks.com/topic/259438-tab-or-space/#findComment-1331377 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.