Hello fellow gopherships... ¿How you doing?
Hope just fine!
A week ago I proposed to allow conversion from bool to int, assuming false to 0 and true to be 1.
This was the proposal and I do appreciate a lot the polite responses from Ian.
I pick my pike and dig into... the discussion... trying to understand what was the force or the motivation that refuses the proposal.
I Found two interesting comments:
And what i perceive is that the cons is: It may harm readability.
Well... If that is the case... (because, that is what I understood, and forget me if I'm wrong!) I have some points to put into the table if you allow... please, do not take it hard... I'm trying to make an statement.
1) One line Swapping
a, b := 1, 2 // I never use this.. I always forget if the 1 go to the a and the 2 go to b or vice-versa.. (Like now!)
I do like to write three lines instead of one...
Well... actual web apps require to write in JavaScript, JavaScript uses block scopes.. so I appreciate a LOT this feature of the language, but as long this language has to live with other languages (like JavaScript) I don't feel that this will release me from the burden of knowing how to deal with block scopes variables used in a closure. JavaScript is not an example of well designed language but is the language widely used in web apps.
3) Generics...
Well... With interfaces I already got the genericity I need to model abstractions.. But I do appreciate generics, because they do allow us to write less code at the cost complicating the language grammar. I start to use them... but before that I have no problem on converting an slice of interfaces using a for loop.
4) I "grow" writing these lines on any C program I'm not too old (to reason), but also not too young (to dream). I have 40
#define TRUE 1
#define FALSE 0
That definitively has shaped my mind.
So the statement is:
The points 1,2 and 3 I show... are examples of questionable (at least, for me) things that you directly inject into the language. The point 4 I show how I feel that a bool is, in turn, an int.
The proposal of making bool to int, could co exists. And people can choose to use it or not. You may give it a try... for me (and other folks) well come in handy in situations
like this (context: count the number of Spanish's cards that belongs to the GOLD suit).
If you say me: "Ey victor, we just won't put it because we don't like it" <- I will buy it.
Or
You may convince me... I leave that to you. I will try to stay open (I do recognize myself as person that can be a little stubborn.)
Final words
Is not my language and you have done a wonderful job... I mean.. from the old days in C, passing thought the cosmos of C++, then OOP disembark with Java and C#... and then Golang mixing a lot of learned lessons into a single language!
Actual final words:
Informal Greetings! 🤠🧉