Liste des Groupes | Revenir à cl c |
On 21/11/2024 13:00, David Brown wrote:I use better languages than C, when there are better languages than C for the task. And as you regularly point out, I don't program in "normal" C, but in a subset of C limited by (amongst many other things) a choice of gcc warnings, combined with compiler extensions.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).What is your point? Are you trying to say that your language is better than C because your language doesn't let you make certain mistakes that a few people sometimes make in C? So what? Your language doesn't let people make mistakes because no one else uses it. If they did, I am confident that it would provide plenty of scope for getting things wrong.
So, half the options in your C compilers are to help get around those shortcomings.
You also seem proud that in this example:I don't care what you consider a hack. I appreciate being able to write code that is safe, correct, clear, maintainable and efficient. I don't really understand why that bothers you. Do you find it difficult to write such code in C?
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.If you are not able to use a feature such as "unreachable()" safely and correctly, then I suppose it makes sense not to have such a feature in your language.
Yet the gaslighting here suggested what I chose to do was completely wrong.No, trying to use a long-outdated and underpowered computer and then complaining about the speed is a problem.
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.Presumably, in your analogy, the detours are useful.
Or another option is to think about each journey extremely carefully, and then only do the trip once a week!That sounds a vastly better option, yes.
Les messages affichés proviennent d'usenet.