# Code style

This topic is 4521 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, Here is my problem: A few month ago i worked on a well-known commercial great game engine. I really like this work and of course this engine. Now, I am founding my own society and I am working on our own house game engine. Note that we want to sell this engine. I am not a plagior (not sure of the english word, read thief instead) but I automaticaly use the code style of the great engine. You know like variables write style, globals variables write style, functions style, projects style... (some variables have the same name and the same utility) Understand me, I know that in front of the justice, it will be no problem (I hope) because the codes are really different. But the problem is i don't want bad publicity, i don't want justice problem etc. Is there a problem or is it just .. nothing ? (note that 99.99999% of the code is different) [Edited by - Woodchuck on January 5, 2006 6:36:08 AM]

##### Share on other sites
i cant imagine anyone being annoyed if you use there coding sytle( i think you would find the opposite to occur more frequently ).

by coding style you mean( examlpe )
//thisint main( int argc, char **argv ){   if( somethingTrue() )   {      doSomethingElse( 0, "foo", &bar );   }}// as opposed toint main(int argc,char **argv) {   if (something_true ())      do_something_else (0,"foo",&bar);}

##### Share on other sites
I believe you can run into problems if you copied a large part of the interface (class signatures) of an existing design.
Apart from that, the style of how you set your braces and spaces is entirely your matter.

##### Share on other sites
Quote:
 Original post by rip-offi cant imagine anyone being annoyed if you use there coding sytle( i think you would find the opposite to occur more frequently ).by coding style you mean( examlpe )*** Source Snippet Removed ***

Exactly. Thank you for the answer.

Quote:
 Original post by KonfusiusI believe you can run into problems if you copied a large part of the interface (class signatures) of an existing design.Apart from that, the style of how you set your braces and spaces is entirely your matter.

Ok, thank you. That's what i think too, but i preferre have some external opinions to know if i must be worried about this purpose.

##### Share on other sites
Doing things the same way is to be expected - some of it won't even be deliberate if you worked on the other engine a long time. There are areas where this is a problem but normally your contract with a company should cover this - are you still working there at the same time as writing this new engine?

And what guiding principles will your new society run on? [wink]

##### Share on other sites
Quote:
 Original post by d000hgDoing things the same way is to be expected - some of it won't even be deliberate if you worked on the other engine a long time. There are areas where this is a problem but normally your contract with a company should cover this - are you still working there at the same time as writing this new engine?And what guiding principles will your new society run on? [wink]

I do not work any more on the engine. And when i said I worked on it, I would have say I worked with it.

Quote:
 Original post by d000hgAnd what guiding principles will your new society run on?

We don't want that any kind of people does some link of this style and we don't want copy any kind of code\interface\design...

I just want the style because I like it.

EDIT: but note that by doing the same things (game engine) with the same style make appear some little resemblances (not sure of the word sorry) like same variable name for the same variable utility (but not the same class signature), some same project name, same file names, just little things like that. I do not copy anythings.

I want to know if i must be worried about that.

##### Share on other sites
Ok I have some more opinions, that's what I wanted.

Thank you !

##### Share on other sites
What!? There is no patent about braces, identation and variable/function names!?
Oh boy, i'm gonna get that one! [grin]

##### Share on other sites
Well, they would have to show maybe that you stole "trade secrets"... However I don't believe class interfaces and such are really such a strong argument. Unless you are ripping code out of their engine, I'm pretty certain that you're fine.

What kind of non-compete or non-disclosure agreement did you / do you have with them? Not that I think an NDA would really protect against this stuff - they're mostly ideas or conventions, and reusing good ideas is... well, a good idea.

IANAL.

##### Share on other sites
Well, if I think of all that people that have learned not only a programming language but also a programming style from reading their first book about that language ... That works really fine for good as well as for bad styles ;-)

• 23
• 10
• 19
• 15
• 14