lidnariq wrote:Your argument seems to boil down to the tautological argument that because C is not machine code, C is not machine code...
The problem here was more my own original misconception about the language when I first learned C. Some tricks make a piece of code looking shorter or more optimized, but it has nothing to do with actual optimisation, as you pointed out.
You're getting a bit ridiculous here. "Painful language"? I use C++ in my own hobby stuff because I like the way it works and what it can do.
If you enjoy using the language, by all means this is fine. You should just understand it might be painful to other people. Other people don't have to use your favourite language (or even worse, your employer's favourite as it seem to be the case here), they should just make up their own opinion on the matter.
(I can't optimize because I can't specify when to use the zero flag with ! vs ==0)
You are modifying what I tried to say. I said it looked like an optimisation, but wasn't a real optimisation. I didn't say this disallowed to optimize.
Of course in C++ they added mechanisms that provide bounds checking for arrays, so that problem is already solved if you're not obstinate about it.
C++ actually can do this efficiently and effectively though.
So you are doubling my point that C is lacking, because it cannot do those things, C++ (which is a different language) can but this is another story.
Anyway, I honestly find this nitpicky attack on C really strange. What are you comparing against? Is there a language that you use all the time that you really don't have any qualms like? Everything here you've picked on was either trivial or wrong. If you named any language I could say a thousand similar things about it. What's the point? They've all got some problems, but well used languages have plenty of good ways to cope with those problems (i.e. practice effective coding styles, and learn the ropes).
The point was just to say it's fine to program in something else than C or C++, that's all. I do not think there is any other language that is perfect. I just think that neither C nor C++ are perfect, not even close to it. That was my point. I don't need to have another language that is "perfect" to make such a point.
use whatever the hell language works for you. if you latch on to C, use C. If you latch on to Python, use Python. doesn't matter what you use so long as you're using it. really, the bottleneck is not the language but willpower and the motivation to learn of the person using it.
My point exactly.
In a lot of other high level languages you don't even have options about whether something is passed by value or reference.
In my personal opinion, I think a good language should never allow a subroutine to modify any of it's argument. Problem solved, arguments are passed by either value or reference, it doesn't make any difference. If you need the value to be changed, you should be required to do an explicit copy. This makes things clearer at high level thinking AND it allows for maximum optimisation of code generation.
The problem with C is that it will only inline or optimize routine if you add "static" keyword which actually means local. This was introduced only recently, and wasn't present in the original C language where they didn't allow any call optimisation, so originally C programs
had to push all their calling arguments on the data stack in all cases.
I love Bregalad too, but he doesn't share as much these days so I can't love him as much (Share more Bregalad!)
Thanks man ! What do you want me to share more exactly ?! I don't really understand.
rainwarrior wrote:pubby wrote:it did stop their argument
No it didn't. Bregalad just
hasn't visited this site since his last post, so there hasn't been a reply.
OH pardon me for continuing the argument. I see now that I ruined the chance to stop it. Anyway it was not really an argument, I was just claiming that it makes sense to want to avoid C for whathever reason, and it went a bit off track from here.