Sujet : Re: else ladders practice
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 22. Nov 2024, 12:05:02
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhpogu$14mb6$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla Thunderbird
On 21/11/2024 13:00, David Brown wrote:
On 20/11/2024 21:17, Bart wrote:
Your development process sounds bad in so many ways it is hard to know where to start. I think perhaps the foundation is that you taught yourself a bit of programming in the 1970's,
I did a CS degree actually. I also spent a year programming, working for the ARC and SRC (UK research councils).
But since you are being so condescending, I think /your/ problem is in having to use C. I briefly mentioned that a 'better language' can help.
While I don't claim that my language is particularly safe, mine is somewhat safer than C in its type system, and far less error prone in its syntax and its overall design (for example, a function's details are always defined in exactly one place, so less maintenance and fewer things to get wrong).
So, half the options in your C compilers are to help get around those shortcomings.
You also seem proud that in this example:
int F(int n) {
if (n==1) return 10;
if (n==2) return 20;
}
You can use 'unreachable()', a new C feature, to silence compiler messages about running into the end of the function, something I considered a complete hack.
My language requires a valid return value from the last statement. In that it's similar to the Rust example I posted 9 hours ago.
Yet the gaslighting here suggested what I chose to do was completely wrong.
And presumably you also advise doing so on a bargain basement single-core computer from at least 15 years ago?
Another example of you acknowledging that compilation speed can be a problem. So a brute force approach to speed is what counts for you.
If you found that it took several hours to drive 20 miles from A to B, your answer would be to buy a car that goes at 300mph, rather than doing endless detours along the way.
Or another option is to think about each journey extremely carefully, and then only do the trip once a week!