Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Kevin Korte
Kevin Korte
28,149 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,149 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!