I give up. Atwood's Law won
Tags: javascript, firstpost, go, programming
Published: 2020-11-25 21:41:25

# In the summer of 2007 Jeff Atwood jokingly wrote "Atwood's Law" 
> any application that can be written in JavaScript, will eventually be written in JavaScript.

[link to his oringal post](https://blog.codinghorror.com/the-principle-of-least-power/)

Here we are 13 years later and well the joke is on the developer community. For all the talk about how bad JavaScript is Javascript won. 

## I love ruby
I am a ruby developer and have been for a long time not. It shouldn't be a surprise that a language written to optimize for developer happiness makes developers happy. Looking at all the hoops people are jumping through to get an application built and launched I still think that for 95% of what is being built Rails is more than capable of doing and being built faster and and cheaper than the alternitives. Unfortunately for those who love ruby and the productivity of rails the other way is preferred.

## I'm done fighting against Atwood's Law
Back to the undeniable truth is JavaScript has won. 
- Does it have some odd behaviors? No doubt.
- Does it run pretty much everywhere? You betcha.
- Is it the optimal solution? Probably not.
- Does it need to be? Nope.
- Is it adequate? Probably.
- How difficult is it to avoid the really WTF parts of JavaScript? Pretty easy actually.

What does this new outlook mean? Going forward I am writing a lot more javascript... everywhere. I have also revised my opinion on the future and what skills I think developers need to be good at to remain relevant in the next decade and beyond.
1. JavaScript. Plain old vanilla javascript. Not focusing on libraries & frameworks. I am talking about writing JavaScript without 100 GB's of node_modules coming along for the ride.
2. A fast language. JavaScript is good enough most of the time but sometimes it is not. Deep knowledge of a "fast" language for the times when JavaScript is not fast enough. Languages like go, rust, elixir or scala. Things that have compilers and can handle a lot more throughput with the same available resources.

### My "fast" language choice is Go
I landed on go for a couple of reasons.
1. It is a small language. The footprint of what the language does is reallty small and gives you the pieces for building larger more complex systems.
2. It is web native. Looking at the lack of Go web frameworks that might sound silly. The reason there are not a lot of frameworks is the standard library has most of the web stuff built in. Why use a framework or 3rd party library when the standard library is excellent?
3. The small compiled binary model works well with the modern Docker containers everywhere view of the universe. Building stateless web services that can be quickly deployed in isolated containers is a win.
4. The community has spent a lot of time and energy on tooling to make the developer experience better. The language server for VS Code is very nice. Running the code formatting tool `gofmt` automatically on save really saves on bike shedding.

### Some Additional JavaScript notes
- Opinionated code formatting is 100% the way to go. I like prettier and running with the defaults. Overriding a tool like this seems like a huge waste of time and a great opportuniity to introduce problems.
- TypeScript is an improvement over regular JS. I do wish it was run time type checking instead of just compile time. But baby steps.
- It shouldn't have to be said but let the old JS syntax die and only use the es6+.
- Don't start a project by importing underscore.js until you have to.
- Coming from ruby I think 98% of the underscore library just needs to be included in the JS standard library.
- CSS-in-JS feels like inline styles with extra steps but sure lets do it
- Rendering html server side and letting JS take over on the client side is a much better experience than having a loading spinner.
- Rest API's are better than graphql. Sure graphql puts a lot of power and control in the client but it also requires a lot of reinventing the wheel to do things that the browser will give you for free using restful http verbs.
- Cypress.io is a solid tool for testing. Also listening to people say how easy the jquery inspired syntax is to use is hilarous. Jquery really did make dom manipulation sooo easy.
- Storybook + percy solves a lot of the problems with UI component libraries and unexpected changes slipping between the cracks.