public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>,
	Christoph Heiss <c.heiss@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager v2] fix #4758: ui: lxc wizard: allow multiple ssh keys
Date: Mon, 17 Jul 2023 13:54:30 +0200	[thread overview]
Message-ID: <a8b974af-2cd7-d030-81f3-389ffee3605e@proxmox.com> (raw)
In-Reply-To: <bfdf5cab-5d1c-ee32-bd10-e5552dbb7af2@proxmox.com>

Am 17/07/2023 um 11:03 schrieb Dominik Csapak:
> On 7/13/23 12:09, Christoph Heiss wrote:
>> also: s/let/const/
>>
> 
> hmm... we don't really have a style recommendation which to prefer.
> maybe we should improve our style guideline to have some more hints when to use const
> and when to use let?
> (even if it's just 'use const whenever possible')

Meh, I don't think `const` gives us much in a dynamic language like JS, where
one then even has to ensure that one didn't write to a const marked value (which
was only marked as such for above reason), let vs. var on the other hand gives
us clear wins and avoids bugs, so using let as default, and const if it really is
a constant seems more sensible to me.

I adapted our JS style guide a bit, should be clearer (I don't want to "forbid"
const, but using let is preferred):

https://pve.proxmox.com/wiki/Javascript_Style_Guide#Variables 

> 
> is there a strong reason here to use const vs let?
> (is there in the general case, besides the immutable nature of the variable?)

IMO no, especially as the content a variable for an object or array points
to stays modifiable, so it might be even confusing.




      reply	other threads:[~2023-07-17 11:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 14:51 Dominik Csapak
2023-07-13 10:09 ` Christoph Heiss
2023-07-17  9:03   ` Dominik Csapak
2023-07-17 11:54     ` Thomas Lamprecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8b974af-2cd7-d030-81f3-389ffee3605e@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=c.heiss@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal