Sharing Code

  • Comments posted to this topic are about the item Sharing Code

  • Sometimes I wonder if other authors out there feel the same way. Do writers assume their code will be rewritten by someone before it is used. Digital rights and intellectual property are immature fields, and I'm not sure how we ought to best handle the re-use of code. Authors have the right to decide how they want their works to be shared, and should publish their decision. I would hope that others out there would respect that.

    I actually hope and pray this happens, that they re-write it. Otherwise they don't understand what they've implemented, and my name's on a comment tag somewhere at a company I haven't even gotten around to yet, blowing stuff up. :hehe:

    I don't like not getting credit, but ask anyone who does webpage work and "View Source" became the enemy. Code use, re-use, re-re-re-re-use has been going on a long time. I worked a shop once where I asked someone what some feature on the front end was doing (he had *just* deployed it) and in his words: "I dunno, I copied it off the web and it worked, why?"

    I hope the SQL community never ends up at that level.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • For me, it's an incredibly simple equation. The number of times I've trawled the Web to see if someone's already solved the problem I'm encountering is huge. The number of times I've found a knowledge gap in the Web that I can fill is very small. I owe the public a favour or two, so it would be churlish if I didn't try to make a contribution here or there. As for recognition, I don't really care. So long as no-one's benefiting from putting their name to any of my work ('cos I don't like being exploited), I'm not after any credit for what I do put back.

    Naturally, if I had a piece of code or a tip or trick that would adversely affect me were someone else to use it (trade secrets and so on), I'd take reasonable steps to protect it. However, if I've got a marketable idea, I expect it'll be the idea that makes the money, not the code that puts the idea into practice.

    Semper in excretia, suus solum profundum variat

  • I know that i have not invented an amazing new mouse trap. If the bits of knowledge that I communicate out there are helping, great. Yes, if you just steal my article (or book, as happened) as your own, I'm coming after you. But if you use my ideas & script in your systems, yee hah!

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Code reuse is going to happen, there is no way around that. As far as taking someone's article and calling it your own is a different issue. People have been thrown out of college or failed classes for such things. I say, give credit where it is due. It only takes a few extra keystrokes to add a reference.:cool:

  • Copy, paste, run.

    That is a bad way to handle the vast number of code snippets available. I always change the code to make sure it applies to my situation and solves the current problem. I tend to learn more that way, too.

    But, the main reason I don't copy, paste, run is that I don't want to do more harm than good to my employer.

    Then, if I use an idea from a website, I will put a link to the article in comments and a little explanation as to why I used it.

    I would never try to pass off someone elses's published work as my own. It's just not right.

    Thanks to all on SSC who provide assistance.

    Tom

  • I once nicely suggested to a Indian coworker who was always trying to reinvent the wheel when it came to solutions and many times just wasted a lot of company time doing it. "Please don't re-invent the wheel, that solution has already been addressed by someone before. Just google it and you will see." You just couldn't tell him anything, he had to find a way to make it look like he was always the smarter one in the room, even if he had to spend five times longer on it than was necessary. Well...to make a long story short when it came to layoffs he was one of the first to go. Bottom line, don't reinvent the wheel folks when someone has already found a solution to your problem.:-D

    "Technology is a weird thing. It brings you great gifts with one hand, and it stabs you in the back with the other. ...:-D"

  • For the code I have posted here I hope that it is reused to make a system better and I do pray that it is more than a cut/paste job becuase that shows a complete lack of understanding of how it works and I know that periodically I am guilty of doing that for a particularly clever piece of code. But if it is going to "live" for any length of time I always come back and figure out how it works. For the couple of articles I have written, I don't think you could just plug the code in and have them solve your problem, they have to be adapted, and I hope that the accompanying article provides the detail for the developer to do just that.

    For code I have posted on CodePlex I have generally the same feeling but since they are complete solutions I would either like them used, improved upon, or used as inspriation for something even better. Only in the case of "improved upon" doe I look for credit and then only if my code was the starting point..

    I guess the base point is that when I provide code I hope it will be used and adapted for better performance, better understanding, and personal developer growth.

    CEWII

  • SQL and T-SQL code tends to be derivative, especially if it's a general purpose script intended to do something like return the name of all unused indexes. Not to diminish anyone's ego, but it's rare that someone posts a general use T-SQL script that's truely original, something that hasn't been seen before in some other variation in the public domain. You may think you've just "discovered" the sys.dm_exec_sql_text dynamic management view or at least a new use for it, but really whatever you're doing, it's been done before.

    Of course, there are people out there who are genuinly plagiarising. However, plagiarism is generally defined in dictionaries as: "the wrongful publication of another author's work and [the representation of them as one's own original work]." If an author publishes an example of T-SQL, they should (or course) expect others to use it, modify it, and even go on to publish a derivative variations. If you don't claim to be the original author, then it's not plagiarism, but it should be considered good practice (professional) when a blogger is posting code to cite a reference and link to any other code they copied or derived from.

    There are some websites like http://pastebin.com/ where an author can publish a sample of programming code for public consumption in a central repository, and anyone else can then included that code on another website (complete with color formatting) using javascript and a url.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • The power of community is sharing information. From ancient history, stories (if only Homer told the tales of Ulysses it would be gone upon his death), songs, techniques (agriculture, tools), knowledge passed from one human to another, that is how the human species grew so effectively. Other animals learn things but that knowledge is not transmitted. Each generation starts all over again.

    Most people can recognize that plagerism is basically dishonest, but to simply learn from how others solved problems, and build upon that learning, is one thing that makes us human.

    ...

    -- FORTRAN manual for Xerox Computers --

  • I guess we are missing main point of the blog, or I'm really wrong... it wouldn't be the first time I see things differently.

    To me, the googleing and use and re-use of code is fair and the main tool of any good DBA.

    What's wrong is to use some else code to write another blog, article or whatever without giving credit where it's due. That is plagiarism. The fact that we are publishing this in an open-source format, it does mean that people can just take it as their own, and worst, profit from it.

  • Plagiarism - no, I won't allow it.

    Copying code and using it: I prefer that the code comments have a link to where it was found. But, most importantly... see the tag line in my signature - I think that sums it up pretty good!

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • WayneS (1/25/2011)


    Plagiarism - no, I won't allow it.

    Copying code and using it: I prefer that the code comments have a link to where it was found. But, most importantly... see the tag line in my signature - I think that sums it up pretty good!

    Yep, kind of a no brainer though. If you can't explain what the code is doing that your copying, then of course, you should not be using it at all, but particularly on a production system. Duh! 😀

    "Technology is a weird thing. It brings you great gifts with one hand, and it stabs you in the back with the other. ...:-D"

  • WayneS pretty much sums up my attitude. I've been the beneficiary of countless code samples found on many sites, and I try to give credit to the author(?), or at least the publisher of such code. I expect the same as a professional courtesy. If I publish code to the internet, and its any good, then I expect someone to use it, so I don't publish anything that I would object to seeing in someone elses product.

    However, when it comes to prose, keep your hands off!

  • I would hope that somebody is able to use the code or get an idea from the code to make it better and use it. Other published articles and blogs - don't copy word for word.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 36 total)

You must be logged in to reply to this topic. Login to reply