Write Great Code

in the Cloud

Linda Nichols

@lynnaloo

@lynnaloo
#serVAless

Virginia is for Lovers

JavaScript

^

#jaVAscript

What is Serverless?*

@lynnaloo
#serverless

* "Serverless" is a catchy, made-up, marketing term.

Kind of like, "Cloud."

What is Serverless?

@lynnaloo
#serverless
  • Fully-managed services

  • Event-driven architectures

  • Pay for only what you use

  • Focus on applications

  • Fewer wasted resources

@lynnaloo
  • Less time writing redundant code

  • Support for all* programming languages

  • Less concern about infrastructure

  • Built-in services and libraries means less code

  • FaaS map to microservices

  • Faster time to production

It's for Developers!

But there are servers?

@lynnaloo
#serverfull
@lynnaloo

Let's Talk About Serverless

and developers

^

@lynnaloo

Developers Have Lots of Opinions

JavaScript

^

@lynnaloo

They Love Process and Best Practices

@lynnaloo
  • Favorite editor

  • Favorite language

  • Favorite frameworks

  • Code formatting tool

  • Formatting tool for code prettiness

  • Real-time static code analysis

  • Consistent rules and formatting

Developers Want (need):

@lynnaloo

Vim

VS Code

Emacs

Atom

IntelliJ

Visual Studio

Eclipse

Notepad

Lint

Prettier

EditorConfig

pylint

eslint

Mechanical Keyboard

Stack Overflow

Java

.Net

npm

nuget

Ruby

CoffeeScript

Python

Rust

TypeScript

yarn

@lynnaloo
  • Pair-programming
  • Your opinionated testing framework
  • Unit tests
  • Integration tests
  • Code coverage up to 90%

You Must Test the Code:

@lynnaloo

Wait, should we have written the tests before the code?!?

@lynnaloo
  • Use opinionated revision control system
  • Current popular branching strategy
  • Squash those insignificant commits
  • Very detailed commit messages
  • Branch names match the task

Then Commit the Code:

@lynnaloo

Github

Gitlab

Visual Source Safe

Bitbucket

Gitflow

Github Flow

Subversion

CodeCommit

GitOps

@lynnaloo
  • Pre-commit hook

  • Push the code to a dev branch

  • Issue a pull request

  • Code analysis and builds are passing

  • Make sure all of the tests are passing

  • Request a code review

Merge the Code into Master:

@lynnaloo

Your branch isn't up to date??

Why aren't the tests passing?

Why did you use tabs and not spaces?

Squash those commits!

The linter is failing!

@lynnaloo

Sometimes, reviewers can be tough.

@lynnaloo

OK, LGTM. Merged.

@lynnaloo

Cue the CI/CD Tool:

@lynnaloo

Travis CI

Azure Pipelines

Gitlab CI

Jenkins

Circle CI

Bamboo

CodeDeploy

Flux

Github Actions

LaunchDarkly

CodeBuild

@lynnaloo

What about code written for the cloud?

@lynnaloo

Pre-recorded Demo Time

@lynnaloo
@lynnaloo
@lynnaloo
@lynnaloo

Unfortunately, no service is fully-managed enough to format, test, and debug your messy code.

@lynnaloo

So, why do those who hold process so dear, throw it all away when they write code for the cloud?

@lynnaloo

Because cloud development is new and can be a little scary.

@lynnaloo

But all of the development practices that we love, still apply in the cloud.

and there are many, many new tools and services to support your process.

@lynnaloo

My (highly opinionated) Toolset

  • Static Code Analysis:  Eslint
  • Enforcing Style:  EditorConfig
  • Pre-commit Style:  Prettier
  • Revision Control:  Github
  • Testing:  Mocha
  • CI:  Github Actions
  • Editor:  VS Code
  • Language:  JavaScript
  • Cloud:  Azure*

Demo

@lynnaloo
https://www.github.com/lynnaloo/only-zuul

Who is the best Ghostbuster?

Conclusion

  • No-ops does not mean no DevOps
  • Online editors != revision control
  • Love your linter
  • Put your editor to work
  • Testing in prod is not testing
  • Abstraction is not CI/CD
  • Don't abandon what's important
@lynnaloo

Thank you

Credits

Travis Webb

YOLO Programmer

Write great code, in the cloud

By Linda Nichols

Write great code, in the cloud

Write great code, in the cloud - JS World 2021

  • 791