|The best way to protect customised .CSS content?|
I would like to ensure that no-one can view my .CSS templates
Is there a simple way to ensure that competitors cannot 'borrow' from the .CSS templates which will shortly form the basis for a complete site redesign?
I'm extremely confident that the conversion to .CSS will bring great benefits in terms of spiderability and page load times.
But what's to stop anyone else simply copying the templates and duplicating the work that has been done?
Nothing you can do will stop anyone determined to see your code. At most, all you can do is make it more difficult to read by putting all of it on one line (using a minfier to remove extra whitespace). But even that can be easily undone. Don't bother trying... it's a waste of time.
But what I don't see is any attempts to resolve this in the minds of the people asking.
Obviously we work hard at this, and deserve our credit, and are concerned someone is going to steal our hard work. But let's put this in perspective: how did we all learn what we know? Didn't you (and I, and everyone else) learn what we know by example, by doing the very thing we're trying to prevent?
Let'd take another path down humility lane: we all learned this from someone else, and even if the student has become the master, somewhere along the wisdom road there is the one person or small group of people who truly pioneered the technology we so voraciously protect. Even the Tim Berners-Lee's and Albert Einstein's of the world built their knowledge upon the lives of those that came before them. They were just fortunate enough to be blessed with both being in the right time and place, and had the inspiration to recognize the opportunity. Where would we be if they followed the same thinking and protected their technology?
So I resolve these concerns in my own corner of the world by reminding myself of a quote by Douglas MacArthur: The only thing new is what you don't know about history. While you may add your individual flair to it, you're really not doing anything that hasn't been done before, or that is done better by hundreds of thousands of others.
People can steal your code, but it's not the code your clients buy. It's what you add to it. They can steal it and copy it but in no less than three changes from your original they will make a mess of it and it will be worthless. I have seen it happen. Rest assured in this, and don't worry about them stealing your code.
Now, if you have something **TRULY** new, something that's never been done before, you had better beat your path to the patent office. :-)
|Obviously we work hard at this, and deserve our credit, and are concerned someone is going to steal our hard work. But let's put this in perspective: how did we all learn what we know? Didn't you (and I, and everyone else) learn what we know by example, by doing the very thing we're trying to prevent? |
I second this :) I would also like to put in a quote I find relevant, by Voltaire:
"Originality is nothing but judicious imitation."
What you've learnt you've learnt from others, so we in turn should be gracious and let others learn. Isn't that what the Webmaster World community is about? For what purpose would this community exist if not to learn from, and teach others?
I haven't gotten around to it, but I would like to put in my default documents a small comment saying "Look, learn, but please don't steal."
I think the message is much nicer than methods to stop people from stealing, by appealing to a better nature.
[edited by: Setek at 1:03 am (utc) on Dec. 21, 2006]
Wise words folks, but I should qualify my above post by stating that the code is not by my hand.
I'm keen to protect the work of my CSS guy, who has done an amazing job converting the designers HTML pages into perfect CSS versions.
Obvously I don't want everyone in my industry to copy this code.
Obvously I don't want everyone in my industry to copy this code.
Then you have missed the point entirely of the replies posted above.
If you take out e.g. the reason why you have hacks anybody trying to maintain it in the long run will have trouble understanding why you did what you did. Aside that, there's nothing you can do.
If somebody blatantly copies it all, you have copyright to protect you, but just like there's no prohibition to write a detective story where the butler did it, just because that's what's been written before, the exact words are protected, btu not the ideas.
And to be honest that's the way it should be: work on the aesthetics and those get protected, leaving the technology there for others to reuse and improve and you can even get bits and pieces back in the long run.
On one of my sites that has some code that was a fair amount of work (for me anyway), I've done just the opposite of hiding it.
Each of the four links invokes a PHP script which grabs a current source file just used to render the page, formats it, and serves it up as HTML, along these lines:
#Prototype PHP page for viewing any kind of document
#set two variables here:
$filename = 'FULL PATH TO THAT DOC ON THE LOCAL SERVER';
#all below is invariant
$pagetitle = $label . ' source code for www.example.com';
$datestr = 'Consulted: ' . gmdate('D, d M Y H:i:s \G\M\T', time() );
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-us">
<meta name="robots" content="noindex,nofollow">
echo '<title>' . $pagetitle . '</title>';
<link rel="stylesheet" type="text/css" href="http://www.example.com/example.css">
echo '<div class="header">' . $pagetitle . '<br>' . $datestr . '</div>';
$text = file_get_contents($filename); // get file contents to string
$text = htmlspecialchars($text, ENT_NOQUOTES); // encode basic html entities
$text = str_replace(' ', ' ', $text); // preserve spaces
$text = nl2br($text); // insert <br /> at every /n
echo $text; // emit whole file as html
So far there has been very limited interest in seeing these files, according to the analytics. But if anyone wants to take a look, it couldn't be easier for them, and what they get is guaranteed to be current with no duplicate copy to keep in sync.
An unexpected benefit was that once the four links were added to the footer I felt like I needed to scour the code closely again for errors, correct the small details of the formatting, and add a few comments, all of which had the result of making the code clearer for me to maintain!
Sounds like a good application for a CSS obsfucator. Purposely bad formatting along with lots of noise should render the CSS unpalatable in its public form.
|Obvously I don't want everyone in my industry to copy this code. |
Good luck. WPTS used to have an "Amazon Look-Alike" page, in which they featured sites that were...derivative...of Amazon.
I HIGHLY recommend against screwing with your CSS (obfuscating), as I see many problems with browser compatibility, and you'll make your CSS guy work harder.
Your CSS guy almost certainly learned his (I assume that "guy" means male) trade the way we all have, through the open and generous nature of the Internet. Has your CSS guy asked you to copyright his stuff, or is this your idea, because it is so cool, and you own it now, and want to protect your investment?
I like giving back. I've published some fairly kewl stuff in an effort to give back to the community. ALA has a policy of "steal our code," as does Eric Meyer, et al.
In any case, no matter how kewl you think it is, I would be very surprised if you could beat this guy [cssplay.co.uk]. who always publishes all his stuff.
Just keep outdoing yourself. It forces everyone who copies into the position of follower, and hones your own skills. That's what has made the Web what it is today.
Just keep outdoing yourself. It forces everyone who copies into the position of follower, and hones your own skills.
I give my whole-hearted endorsement of this comment.