Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Kevin Korte
Kevin Korte
28,110 Points

Moral discussion on code you write at work.

Here is an interesting topic I was thinking about that I'm curious to poll the field. Maybe treehouse has addressed this issue with their team?

At my job, on aspect of it is to develop, create, maintain all the websites. Lets say while at work, I write a nifty block of PHP and Javascript code that uses a weather API to display the weather and a forecast, and I use that block of code on our companies website.

Do you feel its morally acceptable to take that same block of code, and reuse it on a website or project outside of work, say for a personal site or freelance? I wrote the code, however I wrote it on the companies time. What is your thoughts?

BTW, this is a real world example :)

2 Answers

If using my code outside of work isn't against company policy, then I would have absolutely no moral issues. Don't most employment contracts explicitly forbid this type of action though? Coca-Cola chemists and Amazon programmers can't just start using soda formulas and search optimization algorithms outside of work without some serious legal repercussions.

Kevin Korte
Kevin Korte
28,110 Points

There really isn't anything about this in our policy handbook or my personal contract. We are a small business, not in the web industry, and so I inherited the companies websites. I should be fine there, and when I put myself in my employers shoes, I wouldn't have an issue with it as our information and code was protected.

And being the code I want to reuse is just code for APIs, its tempting for instance on the google maps API I already wrote for the company to not just copy and paste that same code block, change the API key, the latitude and longitude values, and be done with it.

Thanks for your feedback Ryan!