HackerTrans
TopNewTrendsCommentsPastAskShowJobs

neutrono

no profile record

comments

neutrono
·2 anni fa·discuss
It should have been called _Overload or something similar, since it's not really a generic.
neutrono
·3 anni fa·discuss
How to kill your company in one week?
neutrono
·3 anni fa·discuss
In C23 you can use the attribute

    [[nodiscard]]
on functions to mark that the result from function shouldn't be discarded. I think there is also a

    [[reproducible]]
attribute for saying a function doesn't do side effects.
neutrono
·3 anni fa·discuss
I think he means that the C API is stack based?
neutrono
·3 anni fa·discuss
What is nano lacking in power?
neutrono
·3 anni fa·discuss
One can always use Home and End in that case.
neutrono
·3 anni fa·discuss
Well, IIRC even in the K&R book, a book which many C programmers admire for it's excellent documentation and prose, and rightly so, there is a specific section mentioning that C's declaration syntax has been castigated.

Next, even if C is not a "high level language", which depend on your definition of "high level language", the perks of a proper module system for low level coding cannot go unmentioned.

- Rust, a language that lives in a somewhat similar abstraction and power space as C, has a module system.

- C++, a language that lives closer to C in features, also now, in C++23 I believe, has a module system, and before that, had namespaces.

On implicit conversions, I think having implicit conversions are hard to get right, and I think that C has them is not a feature, but rather a bug. Languages that have taken some inspirations from C, has chosen usually to do away with implicit conversions, or at the very least, limit their use.

And the array -> pointer in functions, I percieve to be a big mistake, not at the time, perhaps it was not known better ways, but as the years roll by, I think it's a misfeature given the countless exploits that have taken place due to a read past the bounds of an array.

I think C is a good language, but these misfeatures burdens the language in an undue way, and I think a better way to design a language is to be more explicit. Something like Rust's

    unsafe { /* Here be dragons */ }
is better design, in my opinion. I think if you want implicit conversions, there should be an explicit way to declare that you want things to be implicit.

That's just my 2¢
neutrono
·3 anni fa·discuss
The declaration syntax and the lack of a proper module/namespacing system is also a mistake, but perhaps not as big as the way arrays decays into pointers. Implicit conversions I suppose could also be classified as a mistake.
neutrono
·3 anni fa·discuss
Citizens have a huge amount of power within the government, being able to vote in elections and pursue ballot initiatives. How is that not a democracy?
neutrono
·3 anni fa·discuss
Only one I could think of is posix_spawn[0], although it has different constraints than fork()/exec()...

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/p...
neutrono
·3 anni fa·discuss
Ada 2012 has expression functions

    declare
        function f (i: Integer) returns Integer is ( i * 2 );
         x : Integer;
    begin
        x := f(21);
    end;