Additional Preparation For Angular Tutorial

Once I managed to overcome the few speed bumps on the way to installing Angular CLI on MacOS, technically speaking I’m all set to start writing my first Angular app on my own computer. And some people are happy to launch their vi or emacs and start working, but I’m going to do a few more things.

The first is Visual Studio Code, which is conveniently available for MacOS as well as my usual development environments Ubuntu and Windows. The fact the online tutorial used StackBlitz, which was built with VS Code components, should make the transition to local development easier. But how do I get all the Angular helper goodies I saw in StackBlitz? A search for Angular on VSCode marketplace returned many hits, a good sign of a large development community. One of the extensions appears to be published by Angular themselves, which sounds like a promising addition.

While installing the Angular extension, VS Code suggested that I might also be interested in Prettier code formatter extension. This is a different approach than my last experiment in maintaining coding conventions and I thought it might be worth a look. I like the concept of keeping code formatting configurations as a file in the project. This keeps all developers working on the same project on the same page, rather than requiring everyone to set it up on their own machines. I seemed to have goofed something in the setup, though, as Prettier didn’t seem to do anything as I proceeded through the tutorial. I’ll come back to this later.

The last bit is actually a decision I have to make. When I run ng new to create a new Angular project, I can optionally specify “strict mode” with the --strict flag. I had no idea what this meant, so I went and did some reading. It activates several flags passed to underlying mechanisms that I didn’t fully understand. (webpack? tree shaking?) But I liked the sound of what it aims to accomplish:

Enabling this flag initializes your new workspace or project with a few new settings that improve maintainability, help you catch bugs ahead of time, and allow the CLI to perform advanced optimizations on your application.

Since it is a code quality improvement, I expect it to add some overhead to my coding life up front. Which may not be the best of ideas on a beginner tutorial where we want to keep things easy. But I’m a fan of making the up-front tradeoff for fewer headaches in the future, so I’ll go ahead and create this tutorial project with --strict before diving in to the tutorial.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s