Jump to content

Spacing style


proggR

Recommended Posts

I started working at a job a couple months ago and the boss really stresses "proper" spacing. I do it because I have to and its not really that different from how I normally code but it is strange to get used to. I was wondering how everyone else spaces their code.

 

How I normally space my code:

if(condition){
    //code
}

 

How I space my code at work:

if (condition) {
    //code
}

 

 

As I said, its not that different but getting used to those extra spaces is actually harder than I thought it would be.

 

I'd be interested in seeing what other people use.

Link to comment
https://forums.phpfreaks.com/topic/244853-spacing-style/
Share on other sites

I started working at a job a couple months ago and the boss really stresses "proper" spacing.

They were probably saying that because both the PHP manual and the Zend Framework use the same exact style for IF blocks, but are different when it comes to class constructors and methods.

Link to comment
https://forums.phpfreaks.com/topic/244853-spacing-style/#findComment-1257829
Share on other sites

I really shut setup my environment to format the way I'm asked. It would make things a lot easier. I've had it autoformat a file once but it wasn't setup the same way so I stopped using it. I used to use it before every save when I worked with Java in Eclipse/RAD. There were no formatting guidelines to follow there though.

Link to comment
https://forums.phpfreaks.com/topic/244853-spacing-style/#findComment-1258715
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.