[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #26184 [Applications/Tor Browser]: Think about using `const` as much as possible in Torbutton code



#26184: Think about using `const` as much as possible in Torbutton code
--------------------------------------+--------------------------
 Reporter:  gk                        |          Owner:  tbb-team
     Type:  task                      |         Status:  new
 Priority:  Medium                    |      Milestone:
Component:  Applications/Tor Browser  |        Version:
 Severity:  Normal                    |     Resolution:
 Keywords:  tbb-torbutton             |  Actual Points:
Parent ID:                            |         Points:
 Reviewer:                            |        Sponsor:
--------------------------------------+--------------------------

Comment (by igt0):

 Hi I also like this article https://mathiasbynens.be/notes/es6-const
 (TL;DR const doesn't allow rebinding [it is not about immutability]).

 I agree with mcs about in the end the **technical** advantages are small,
 however for new contributors it reduces the cognitive load, because they
 know that variable will not change in that scope.

 E.g Every time I see a let in the beginning of the file, I assume that
 variable can change and it can be undefined or null!

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26184#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs