Chapter 9: What to do next

* If you need help with the content of this article for work or development, individual support is available.

Goal of this chapter

  • Objective: Know the roadmap to graduate from beginner
  • Time required: 10 minutes
  • Note: Do not try to do everything (Git, TypeScript) at once

Congratulations on completing the course! Finally, I will tell you the "next weapons" you should learn and the mindset as an engineer.

1. Challenge to TypeScript

One of the biggest benefits of using Clasp is TypeScript. This is an "evolved version of JavaScript" and is a language that allows you to write code more safely.

What is good about it?

JavaScript is too free a language, so mistakes like this happen.

// In case of JavaScript
function tax(price) {
  return price * 0.1;
}
tax("1000 yen"); // Result: NaN (Not a Number) -> Proceeds without error!

With TypeScript, you can write like this.

// In case of TypeScript
function tax(price: number) { // Specify "Only accept numbers"
  return price * 0.1;
}
tax("1000 yen"); // Red line appears on VS Code saying "Error! Put a number here!"

Since you can notice mistakes before executing, bugs decrease drastically. With Clasp, just by changing the file extension from .js to .ts, it automatically converts and uploads it. Think of it as "JavaScript with safety device" and please try it.

2. Get a "Time Machine" with Git

This time we only used clasp push, but originally it is used in combination with a tool called Git. Git is like a "time machine" that saves the change history of files.

  • "I want to return to yesterday's state"
  • "I want to see the state before adding this function"
  • "I want to know where team members changed"

All of these become possible. Since VS Code has Git functions as standard, please search for "Git introduction" etc. and touch it little by little. Since you can create "save points" yourself, you will be able to make bold modifications with peace of mind.

3. AI Agent (Copilot) Prompt Technique

Since GAS is a very major language, it is a field that AI is good at. Programming from now on will be important "How well you give instructions to AI Agent".

Template for good prompt (instruction sheet)

When asking Agent to write code, accuracy increases if you convey the following 3 points.

  1. What you want to do: (e.g. I want to check all URLs in column A of the spreadsheet)
  2. Input data: (e.g. Column A contains strings like https://...)
  3. Output result: (e.g. If there is a URL that cannot be accessed, I want to write "Error" in column B)

Actual example of asking (VS Code Chat)

"@workspace /new Please write GAS for Google Spreadsheet. URLs are in column A from the 2nd row of the active sheet. Please create a function that accesses these in order with UrlFetchApp, and if the status code is other than 200 (error), writes 'NG' in column B of that row, and 'OK' if normal."

If you instruct specifically like this, the Agent will return almost perfect code. You change from "person who writes code" to "director who gives instructions to Agent".

4. Finally: You are already an "Engineer"

You who have read this far are no longer a "GAS beginner". You are a "Clasp user" and an "AI Agent user". Hitting the black screen (terminal) and writing code while interacting with Agent in VS Code. This is essentially the same as what engineers at Google and Amazon are doing.

This skill (VS Code, Terminal, Node.js) is a weapon for a lifetime that can be used as is in programming other than GAS (Web development, Python, etc.).

Please automate the "troublesome" things around you and create time! And please learn new technologies with the time saved.

Happy Coding!


Frequently Asked Questions (Q&A)

Q. Is TypeScript mandatory?

A. JavaScript is OK at first, but you should migrate when you get used to it. There is no problem writing in .js at first. However, as the code gets longer, you tend to waste time on "variable type mistakes". To reduce that stress, TypeScript becomes a very powerful weapon.

Q. Git seems difficult…

A. Let's think of it as just creating "save points". At first, just two commands git add and git commit are enough. Just by acquiring the habit of leaving records frequently with the same feeling as "game save", the sense of security in development becomes completely different.


Understanding Check Test

Q1. What is the language that is an evolved version of JavaScript and allows you to write code more safely? Answer: TypeScript
Q2. What is the tool like a “time machine” that saves the change history of files? Answer: Git
Q3. What are the 3 elements to convey when asking AI to write code? Answer: What you want to do, Input data, Output result

>> Return to Series Top

Series Index

ZIDOOKA!

Need help with the content of this article?

I provide individual technical support related to the issues described in this article, as a freelance developer. If the problem is blocking your work or internal tasks, feel free to reach out.

Support starts from $30 USD (Estimate provided in advance)
Thank you for reading

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Policy on AI Usage

Some articles on this site are written with the assistance of AI. However, we do not rely entirely on AI for writing; it is used strictly as a support tool.