News for hackers. Stuff that matters.
Re:'Clean your desk': My Amazon interview experience by nommm-nommm on Thursday December 08, 2016 @11:48AM (#13131641)
But usually, code on SO is kinda like the docs, they show you how to do something and is often more of a template than a complete solution (unless you asked the question). Its not like people are writing complex solutions and putting them on SO. I mean how are you going to copyright this? (taken from a SO post):

for (Map.Entry<String, Object> entry : map.entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); }

Re:'Clean your desk': My Amazon interview experience by mherdeg on Thursday December 08, 2016 @11:58AM (#13131768)
Or, famously (in a case where people thought carefully about both copyright and patents):

  private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
    if (fromIndex > toIndex)
	    throw new IllegalArgumentException("fromIndex(" + fromIndex +
            ") > toIndex(" + toIndex+")");
    if (fromIndex < 0)
	    throw new ArrayIndexOutOfBoundsException(fromIndex);
    if (toIndex > arrayLen)
        throw new ArrayIndexOutOfBoundsException(toIndex);
  }
Re:'Clean your desk': My Amazon interview experience by Bartweiss on Thursday December 08, 2016 @12:08PM (#13131888)
This is one of the reasons I followed the Oracle v Google suit with such interest.

Below some minimum threshold of complexity, it seems like software ought to cross the idea/expression divide and become copyright-exempt, just as a mathematical formula does. In fact, the example you gave is something that could easily be recreated letter for letter without seeing the original post.

I'd be utterly shocked if that sort of "could have written it from scratch" code ever caused someone an IP problem.