Blender 2.80 introduces a new feature of collections, which (in my opinion) is a very important for various purposes like grouping objects, selectively enable / disable in view port, etc.
Accordingly, the codes also needs to be updated in 2.80 for adding an object to the active scene. From the documentation (https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API),