Web Programming with Google Apps Script
- Andrew Argeros
- Jul 18, 2020
- 3 min read
This summer, I signed up for a summer class at Hamline on web programming with Google Apps Script for the development of web apps. Basically, the story behind this is that I wanted to get out of the required "Intro to Python" course that would frankly be review, and saw that this summer class was offered by a professor I really like, so I figured "why not pick up an additional skill while saving yourself from the Python class". So I did.
If you're not familiar with Google Apps Script, it's basically Google's flavor of Javascript that leverages tools in the G Suite in bespoke ways from web apps to macros in sheets. All of this is baked into Google Drive as well, so getting started is as easy as having a Google account and an Internet connection. A nice feature of this is that websites can be responsive and data driven without the need for a server or a database. Sites can instead have the backend of a Google Sheet that can also be used for analysis in things like R/Python without the need for ODBC connections and SQL queries.
This does come with some drawbacks however. Joining data from sheet to sheet is far more of a pain than it would be with a SQL database, and frankly, GAS just lacks some of the functionality that someone in a data science background has learned as second nature in other tools. Also, I want to point out that the editor in GAS is possibly the worst development environment possible. Not to sound like a techie nihilist, but for everything good the G Suite has to offer, the Apps Script editor just feels like it was designed in 20 minutes with no regard for its users. Dear Google, please let the damn tab key work.
So far in the class, much of what we've been building has been relatively useless for the real world. Think, a website that knows your name and counts how many times you've clicked a button. However, I'm working on two projects using the language: a time sheet for my internship and a scheduler for the local county park district. Hopefully these will be slightly more useful to people than the aforementioned projects.
Basically the impetus for the time sheet app is that my internship doesn't have a standardized process for paying yours truly by the hour (perks of being the only intern 😀), so the process has become a gross Excel sheet with every pay period scattered across it. If I can leverage GAS, my hope is that I can alleviate some of the bad parts of the process for the people with the cash, and create some effective tools for myself on the "employee side" of the app.
The scheduling app is a little more complex and was inspired by a few things. First, my mom works part-time at the park district and is paid hourly. Currently, it's an extended process to schedule the employees, meet most/all of their requests, and distribute these hours to the respective employee's calendars. Since the park district already leverages the G Suite for certain things, this is a natural fit. The professor teaching the GAS class is also using the language for something similar at Hamline with room scheduling for classes. Since both problems deal with forms of resource scarcity (time, rooms, etc), this will likely use a genetic algorithm to find the optimal allocation in each problem.
That's all for now. If anyone has any experience with GAS and has some tips, feel free to reach out! Thanks!
Comments