'let' it be (remix.run)
Tags: remix, remixrun, javascript, react
Published: 2021-11-30 12:21:16

---
title: 'let' it be (remix.run)
published: true
description: Why does remix.run use let all the time? Shouldn't they also be using const?
tags: #remix #remixrun #javascript #react
cover_image: https://i.imgur.com/3UmzY1Y.jpg
---


## let vs const in remix.run
The Remix.run documentation and source code uses `let` for everything. This somewhat breaks "convention" and is usually the first thing people notice when learning remix. This is too bad. 

Remix.run is an amazing framework. It has the possibility of changing web development in the same way JSX changed templating or graphql changed working with web apis. It truly feels like one of the transformational technologies that simplifies development by removing many of the boilerplate challenges that modern front-end or even static generated sites have introduced like state management, REST/graphql and too many hooks. 

What's truly amazing is it does this while getting us back to "foundational web" or "embracing the web platform." I like to think that remix is "old school cool". It's like working in php or a traditional rails app, but in a good way.

![old school cool](https://i.redd.it/iai6qpkiq8571.jpg)
Old School cool [Joan Jett](https://www.reddit.com/r/OldSchoolCool/comments/nznxfr/joan_jett_without_her_signature_black_eyeliner)  without her signature black eyeliner (1976) on reddit. 

So let's think through the arguments for and against using only `let` and speculate maybe why the core team made this decision. 

### ARGUMENT FOR: It forces you to challenge your existing beliefs.
![red pill / blue pill](https://i.imgur.com/ddWPLLu.jpg)
This is my favorite argument for using "let". It doesn't really impact your code. If you zoom out a little bit, it kind of gets you into the mindset that "remix" is going to change the typical way you do things and that's ok. 

When starting to develop with remix, I had this same reaction doing full-page post backs using POST. You might feel the same way when using html forms for sending data to the server or not being able to use the DELETE verb when deleting a record. Remix challenges you as a developer to do things different and that's great! This helps weed out developers that are too closed minded.


### ARGUMENT FOR:  It's controversial. That's good for online engagement.
![online engagement](https://i.imgur.com/abLaA6j.jpg)
I'm actually fine with this argument. Again remix is amazing and one of the most important things right now is to make it popular. Let's get people talking about it. Let's Increase the online engagement by taking this technically incorrect opinion or style. 

The core team created and maintained React Router and offered best in class React training for years. They have more credibility than they need. They can burn a little bit with a hot take like this. With tech and open source, being technically superior or making better trade offs is not enough, it also has to be massively popular. 


### ARGUMENT FOR:  eslint 
![eslint](https://i.imgur.com/QcG5rnS.png)
If eslint can easily fix this, it can, why bother talking about it? Every developer or team can make their own decision here and just let the auto-formatting handle it. Should this also be an argument against? Maybe it's neither?


### ARGUMENT FOR: It's less to type on your keyboard ![keyboard](https://i.redd.it/b7xsbzhjzb181.jpg)
some [cool guy on reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/r0b95q/who_needs_numbers_definitely_not_me_with_my/)'s keyboard

I love a good keyboard as much as the next guy. But I prefer to use it as little as possible. There's just something about a nice 3 letter combo. Your fingers can type this in about 500 ms. Let the muscle memory take over. 

This probably not the best argument, but it certainly feels nice. The type of developer that is upset that you are using let when you should be using const is only going to be even more triggered when they hear this answer. I just hope it doesn't turn them off to remix entirely.


### ARGUMENT AGAINST: It doesn't matter. It is a distraction from learning remix.run.
![remix.run](https://i.imgur.com/47Kvvsb.jpg)
I'm excited about remix.run! I want to evangelize and tell everyone I know. Having to argue about a modern "tabs vs spaces" is a waste of time and energy. [Kent](https://twitter.com/kentcdodds) says "He just doesn't care enough to challenge it!" I too just don't care! I don't care so much that I want to stop talking about it ever again. Can we get back to remix? The quickest way to do this is to correctly use const/let. 

![only pinned message](https://i.imgur.com/nLoIMZV.png)
When I first go to a discord I generally look at the pinned messages in the general channel to get started. If the only pinned message in your general channel is this (see above) does that maybe tell you something? Is this really what you want the your first impression about this amazing framework to be?


### ARGUMENT AGAINST: It signals the wrong thing to the developer
![i have no idea](https://i.imgur.com/F44eCDc.png)
It might make your feel like you don't know what you are doing. In most react code, almost everything is const. The only time you should see let is if you need to re-assign the value.

{% twitter 798661929363324928 %}

 This is good because when looking for bugs you can focus on 'let' as you scan the code knowing that if something is getting re-assigned it could be the issue as it's not generally something we ever need in React. When we do it could be a sign that there is some complexity that needs to be inspected.



## In conclusion
Let's just 'let' it be. Ultimately it's remix core team's choice, obviously. I could see a compromise where the training materials and documentation use let/const properly and the source code uses they 'let' only style, but assuming positive intent we could just go with the "it forces you to challenge your existing beliefs" argument and call it a day. 

What ever side of this argument you agree with please go to [remix.run](https://remix.run/) and give it a try. I hope you will learn and become as excited about remix as I am!

### What about you?
What do you think? Leave your arguments for or against let in the comments below