Thought about const

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Thought about const

Cyril Auburtin
After a year of using `const`, I got used to it, but even with that I often feel losing time using it, with those 2 additional chars. It's really unfortunate because it's by far the most frequently used for variables assignments.

It's also really close to console(.log,...), annoying with auto-completers

Thing are probably frozen at this time, but `cst`, `ref`, `val` would have been interesting

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Thought about const

Wes Garland
How often do you type const in a day?

Saving 2 characters will save you 250ms assuming you are a decent keyboardist.

I'll trade 250ms of typing for clarity any day.

Wes

Sent from my iPhone

On Aug 28, 2016, at 08:00, Cyril Auburtin <[hidden email]> wrote:

After a year of using `const`, I got used to it, but even with that I often feel losing time using it, with those 2 additional chars. It's really unfortunate because it's by far the most frequently used for variables assignments.

It's also really close to console(.log,...), annoying with auto-completers

Thing are probably frozen at this time, but `cst`, `ref`, `val` would have been interesting
_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Thought about const

Michael Theriot
In reply to this post by Cyril Auburtin
I also thought cst would have been good. My petty issue is that when declaring variables all of my constants have a different indentation.

I define all of my arrow functions with const so I use it fairly often.

On Sun, Aug 28, 2016 at 6:59 AM, Cyril Auburtin <[hidden email]> wrote:
After a year of using `const`, I got used to it, but even with that I often feel losing time using it, with those 2 additional chars. It's really unfortunate because it's by far the most frequently used for variables assignments.

It's also really close to console(.log,...), annoying with auto-completers

Thing are probably frozen at this time, but `cst`, `ref`, `val` would have been interesting

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss



_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Thought about const

kdex

I use `const` by default as well, but I don't think saving two characters is worth giving up readability. Newcomers might even think that "ungrammatical" abbreviations such as `cst` could stand for `cast`, `constructor` or similar terms related to programming.

In terms of hindsight, it could have been great if `let` could have been our `const`, and something like `let mut` or `let mutable` or even `mut` or `mutable` could have been our `let`. Defaulting to values being constant and making them mutable explicitly would be an approach that, for instance, Rust followed.

Anyway, we're stuck with it now, and if typing `const` takes too much time, consider creating a keyboard macro that types in `const` for you. ;)

On 08/28/16 22:49, Michael Theriot wrote:
I also thought cst would have been good. My petty issue is that when declaring variables all of my constants have a different indentation.

I define all of my arrow functions with const so I use it fairly often.

On Sun, Aug 28, 2016 at 6:59 AM, Cyril Auburtin <[hidden email]> wrote:
After a year of using `const`, I got used to it, but even with that I often feel losing time using it, with those 2 additional chars. It's really unfortunate because it's by far the most frequently used for variables assignments.

It's also really close to console(.log,...), annoying with auto-completers

Thing are probably frozen at this time, but `cst`, `ref`, `val` would have been interesting

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss




_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Thought about const

Alexander Jones
One day, there will be a language where changing stuff like this is actually viable, with projectional editing, casting code to whichever vocabulary and grammar is en vogue... :)

On Sunday, 28 August 2016, kdex <[hidden email]> wrote:

I use `const` by default as well, but I don't think saving two characters is worth giving up readability. Newcomers might even think that "ungrammatical" abbreviations such as `cst` could stand for `cast`, `constructor` or similar terms related to programming.

In terms of hindsight, it could have been great if `let` could have been our `const`, and something like `let mut` or `let mutable` or even `mut` or `mutable` could have been our `let`. Defaulting to values being constant and making them mutable explicitly would be an approach that, for instance, Rust followed.

Anyway, we're stuck with it now, and if typing `const` takes too much time, consider creating a keyboard macro that types in `const` for you. ;)

On 08/28/16 22:49, Michael Theriot wrote:
I also thought cst would have been good. My petty issue is that when declaring variables all of my constants have a different indentation.

I define all of my arrow functions with const so I use it fairly often.

On Sun, Aug 28, 2016 at 6:59 AM, Cyril Auburtin <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;cyril.auburtin@gmail.com&#39;);" target="_blank">cyril.auburtin@...> wrote:
After a year of using `const`, I got used to it, but even with that I often feel losing time using it, with those 2 additional chars. It's really unfortunate because it's by far the most frequently used for variables assignments.

It's also really close to console(.log,...), annoying with auto-completers

Thing are probably frozen at this time, but `cst`, `ref`, `val` would have been interesting

_______________________________________________
es-discuss mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;es-discuss@mozilla.org&#39;);" target="_blank">es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss




_______________________________________________
es-discuss mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;es-discuss@mozilla.org&#39;);" target="_blank">es-discuss@...
https://mail.mozilla.org/listinfo/es-discuss


_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss