From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [10.7.7.5] (unknown [182.253.183.247]) by gnuweeb.org (Postfix) with ESMTPSA id 71BD981101; Fri, 21 Oct 2022 14:21:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666362080; bh=mjTZUKdXqjLdDRNgSfgv4wPF/enyJ2uCrZDj3gdNGjw=; h=Date:To:Cc:References:From:Subject:In-Reply-To:From; b=RSrmKmMglw7RLI9/IKm0Q7FXa8gys3V99GdoUnS1iVvV0JnSRnpPsf5AbZy9kAsIY I1MYwNQ+N5NrtkBEtycdDj2FpG39lzTzBmroxEoQYOhTOqDORMEBiMfLUHUoZCF/+e Z8XmJUrNjK+UTaMK4mNF/awJTeaHzkyBLWL9yqWkI35jpV9NOE1j5z4OYS9XPbA9rm doxvkqeYPruPzLQ3U386PkVzCJgITMgMiFQHOk0PkS9lJpOPcyC1W02YXvoZFM5wGP JO+G1HRWBPQ9jrTb/MexGy6CKxHAgypPaaOQcGCZmgpp/7oK9LGzxPAuWCiwVKbeI0 GQd6LqNMOfuBg== Message-ID: <90fb2819-443d-2665-e42b-b069e7dbbaff@gnuweeb.org> Date: Fri, 21 Oct 2022 21:21:17 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US To: Muhammad Rizki Cc: Alviro Iskandar Setiawan , GNU/Weeb Mailing List References: <20221021134520.701-1-kiizuha@gnuweeb.org> <20221021134520.701-9-kiizuha@gnuweeb.org> <6fb1d238-de6a-325c-8d17-6801ae24c717@gnuweeb.org> <982b723b-5c22-cfe2-6fcf-d0584b8c142d@gnuweeb.org> From: Ammar Faizi Subject: Re: [PATCH v3 8/9] enum: Add Platform enumeration In-Reply-To: <982b723b-5c22-cfe2-6fcf-d0584b8c142d@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: On 10/21/22 9:04 PM, Muhammad Rizki wrote: > You want so? But, I really like to use enum library here like everybody does. "Like everybody does" is not a real reason. Please convince me with the advantages of doing your way. For example, see how I argue below: I prefer to use a constant enum because: 1) It reduces the function call and you don't have to import an extra library. It's simpler to use and to write, it doesn't have to call a function to define the value. 2) Better for debugging, you can see the value of each enum member by reading the source code. This is good for debugging because at some point you can have a @var_x where it was assigned with a value from that enum. When you try to print(var_x), it's just a number. How do you know what number it refers to if you don't know the value of each enum from reading the source code? Say, if you have: TELEGRAM = 1 DISCORD = 2 And then somewhere else you have: var_x = TELEGRAM And somewhere else you use that var_x, you know that var_x value must be within the enum range, and you want to see the value, so you do: print(var_x) It shows 1, you know it's TELEGRAM because you write 1 in the source code. Auto enum throws away that information. If using auto generated enum can give us something better at all, what is that? Tell me. -- Ammar Faizi