• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

If you start working on a development project

And the person before you coded a very different style then the way you do, do you....

1) Match his or her style as much as you can to keep the flow going?

or

2) Code your own style because it makes the most sense to you, making the development go faster, but at the same time, the project will have two entirely different styles embedded.

 
I try to keep it consistant with what was in the program already even if I don't like the style.

But most places I've worked have standards so its always pretty much similar to begin with.
 
Depends on the company policy. If no policy is in place, or they let me do whatever I want, I code my style, i.e.

private void foo(int x)
{
....if(x==1)
....{
.........dostuff1();
....}
....else
....{
.........dostuff2();
....}
}


With proper indentation of course in case forum fvsks it up.

EDIT replaced spaces with dots.

I really hate old school

function foo(int x){
}

Decreases readability tenfold all for saving one line.
 
Originally posted by: fleshconsumed
Depends on the company policy. If no policy is in place, or they let me do whatever I want, I code my style, i.e.

private void foo(int x)
{
....if(x==1)
....{
.........dostuff1();
....}
....else
....{
.........dostuff2();
....}
}


With proper indentation of course in case forum fvsks it up.

EDIT replaced spaces with dots.

I really hate old school

function foo(int x){
}

Decreases readability tenfold all for saving one line.

motto a developer once told me: why write 2 lines when you can write one?

 
If I'm in a team then I conform to their standards. If I've been given someone else's code to modify, I code my own style, but make it clear where the old code ends and where my code begins. e.g.

ihatethisbraketstyle()
{
..if(x)
..{
..foo(); }
}

/* new code added by my-name, 17/11/06 */

ilikethisbracketstyle() {
..if(x) {
....foo();
..}
}

/* end new code */
 
Originally posted by: Hyperblaze
motto a developer once told me: why write 2 lines when you can write one?

So that the code will be easier to read in the future. Sure your developer "may" waste one keystroke bringing open bracket onto the next line, but should you have to modify that code in the future, any semi-complex function will take much longer to figure out because of a code mess.
 
Originally posted by: Hyperblaze
Originally posted by: fleshconsumed
Depends on the company policy. If no policy is in place, or they let me do whatever I want, I code my style, i.e.

private void foo(int x)
{
....if(x==1)
....{
.........dostuff1();
....}
....else
....{
.........dostuff2();
....}
}


With proper indentation of course in case forum fvsks it up.

EDIT replaced spaces with dots.

I really hate old school

function foo(int x){
}

Decreases readability tenfold all for saving one line.

motto a developer once told me: why write 2 lines when you can write one?

LOL, last week a developer for the company I contract for asked me why he was getting an error message that went something like this "unexpected value on line 8" so I figured eh, no problem I'll just check what is going on in line 8. Nothing like finding 9400+ characters on a single line of code. He didn't understand why I wanted him to use proper indentation hah.
 
Originally posted by: DaiShan
Originally posted by: Hyperblaze
Originally posted by: fleshconsumed
Depends on the company policy. If no policy is in place, or they let me do whatever I want, I code my style, i.e.

private void foo(int x)
{
....if(x==1)
....{
.........dostuff1();
....}
....else
....{
.........dostuff2();
....}
}


With proper indentation of course in case forum fvsks it up.

EDIT replaced spaces with dots.

I really hate old school

function foo(int x){
}

Decreases readability tenfold all for saving one line.

motto a developer once told me: why write 2 lines when you can write one?

LOL, last week a developer for the company I contract for asked me why he was getting an error message that went something like this "unexpected value on line 8" so I figured eh, no problem I'll just check what is going on in line 8. Nothing like finding 9400+ characters on a single line of code. He didn't understand why I wanted him to use proper indentation hah.

:Q
 
Originally posted by: Hyperblaze
And the person before you coded a very different style then the way you do, do you....

1) Match his or her style as much as you can to keep the flow going?

or

2) Code your own style because it makes the most sense to you, making the development go faster, but at the same time, the project will have two entirely different styles embedded.

(1) One if I'm working in something he/she created.

(2) If I'm creating something new.
 
Originally posted by: fleshconsumed
Depends on the company policy. If no policy is in place, or they let me do whatever I want, I code my style, i.e.

private void foo(int x)
{
....if(x==1)
....{
.........dostuff1();
....}
....else
....{
.........dostuff2();
....}
}


With proper indentation of course in case forum fvsks it up.

EDIT replaced spaces with dots.

I really hate old school

function foo(int x){
}

Decreases readability tenfold all for saving one line.

I don't have a problem reading code like the second style you posted. I started doing it that way in college (before I used to code like you) and can read it quickly and match up braces fine.

As for the OP, I tend to keep the same style that was done originally, unless it's horrendous.
 
Back
Top