I'm in the process of learning to use python to automate some tasks in ArcGIS, and while I've done a couple of on line courses about python I'm still learning to use it within ArcGIS. I've had some success, but I have a question about the correct way of doing things sometimes. I can get it to work (which is important, of course), but don't always understand the purpose of doing something this way or that.
My question is pretty simple I think. Using the example of the Spatial Analyst operation 'Plus', why would you choose to use the syntax outlined in the ESRI help page for the command over the syntax used by building the command in model builder and then exporting as a python script. I understand how they are each working, but don't understand why one would be chosen over the other.
Example:
ESRI help
#Import modules, environment settings, set variables, get license
#Execute plus tool and save result to a file
outPlus = Plus(inRaster1, inRaster2)
outPlus.save("C:/sapyexamples/output/outplus")
Model Builder export
#Import modules, environment settings, set variables, get license
#Execute plus tool, and output to variable raster3
arcpy.gp.Plus_sa(raster1, raster2, raster3)
Is this just a style preference? I assume both of these would run outside of ArcGIS, so why would someone choose on over the other?