Programming Week 1: Environments & Flowcharts
This week was an introduction to Python for ArcGIS Pro. We explored different integrated development environments (IDEs), such as IDLE and ArcGIS Notebooks, and practiced using flowcharts to think through how to solve a problem or complete a task with code.
I found this week’s assignments very simple. I had never thought of writing code to do something like create new files in a folder on a computer. This seems like such a short and easy task, but I see the benefits of running a script to do it (especially because file paths/folders can be one of the most convoluted parts of programming if not set up correctly!). I was surprised and delighted that you could run geoprocessing tools directly from Notebooks in ArcGIS Pro, and I’m very excited to learn how to automate other easy but surprisingly time-consuming tasks (and hopefully some hard tasks?) within ArcGIS Pro!
As part of this week's assignment, we read "The Zen of Python" by Tim Peters, which is a fun Easter egg accessed by typing "import this" in Python. These 19 guidelines are an ode to simplicity, order, and clarity in programming. I would guess that these principles guided the development of Python as a programming language, in addition to serving as advice to Python users. From my limited experience with programming, I have the impression that many programmers focus on the practical side of programming, with the mentality of “if it works, it works–no matter how many lines of code it takes or how confusing it would be for someone else to read.” This mindset is understandable given the reality of tight deadlines and the hours of frustration it can take to get code to work. However, Peters encourages programmers to balance the theoretical, artistic, and practical sides of programming and aim for code that is not merely functional, but efficient (for both the programmer, future users, and Python itself) and elegant. Putting in the extra effort to make your code clean, concise, consistent, understandable, logically sound (and beautiful!) will save time and energy in the long run, and hopefully make programming more simple and "Zen" despite the inevitable frustration and errors.

Comments
Post a Comment