Earlier quoted context omitted.
The ideas for advancing D come thick and fast. C and C++ will never merge with D, because we have different philosophies of what makes for a great programming language. For example, D will never have a preprocessor. Or over my dead body :-/
C++ is trying to eliminate the use of preprocessor. they can't get rid of it but you shouldn't use it.
Obvious things C should do
261–270 of 310 posts
Re: Obvious things C should do
#262Earlier quoted context omitted.
The ideas for advancing D come thick and fast. C and C++ will never merge with D, because we have different philosophies of what makes for a great programming language. For example, D will never have a preprocessor. Or over my dead body :-/
Thanks a lot for your answer, I have another one, what languages or topics do you follow for inspiration regarding concepts ?
Re: Obvious things C should do
#263Earlier quoted context omitted.
That's an interesting assertion, but not one that matches the experience I've had. It is one of those things that sounds "obviously true", but in practice I've found that it doesn't really live up to the promise. As a concrete example of this, having a plain text header file as documentation tends to mean that when people are reading it, if they spot a mistake or see that something isn't documented that should be doc…
I know people look at me like I’m a heathen and a scoundrel, but I think a lot of software teams spend too much time trying to make things consistent. Where’s the ROI? There is none. GitHub readmes? Bring on the weird quirks, art, rants about other software, and so on. I’ll take it all. Don’t get me started on linters. Yes, there’s lots of things that should actually be consistent in a codebase (like indentation). Bu…
> Oh, my JavaScript has a mix of semicolons and non semicolons? Who cares?
i had to refactor and port a javascript codebase that contained a mix of all of javascripts syntactic sugar, no comments anywhere in the codebase, and i was unable to ask the original devs any questions. the high amount of syntactic sugar gave me "javascript diabetes" - it was fun figuring out all the randomness, but it delayed the project and has made it extremely difficult to onboard new folks to the team after i completed the port.
painting is a creative discipline, and the mona lisa has stood the test of time because davinci used a painting style and materials that set the painting up for long term use.
a codebase without standards is akin to drawing the mona lisa on a sidewalk with sidewalk chalk.
Re: Obvious things C should do
#264Earlier quoted context omitted.
I know people look at me like I’m a heathen and a scoundrel, but I think a lot of software teams spend too much time trying to make things consistent. Where’s the ROI? There is none. GitHub readmes? Bring on the weird quirks, art, rants about other software, and so on. I’ll take it all. Don’t get me started on linters. Yes, there’s lots of things that should actually be consistent in a codebase (like indentation). Bu…
I don't like complaining linters. I do like auto fixing linters I can leave running in the background.
any advice on how to implement an auto linter in an old codebase? i hate losing the git blame info.
Re: Obvious things C should do
#265Earlier quoted context omitted.
Yup. D is the source for a number of recent features in other languages. The reason I embarked on D is because C and C++ were too reluctant to move forward.
>The reason I embarked on D is because C and C++ were too reluctant to move forward. I just want to take this opportunity to say thank you. While D may not taken up from the rest of the world. It has surely lived on in C, C++ and many other languages. Still wish more people would use Das C.
For example, C++ pivoted to using ranges instead of iterators, and even C# changed their iterators to be like D's ranges (or so I've been told).
Re: Obvious things C should do
#266Earlier quoted context omitted.
Yup. D is the source for a number of recent features in other languages. The reason I embarked on D is because C and C++ were too reluctant to move forward.
I'm curious, is there any features, from any language, that you wish you had implemented, or want to copy, in D?
Re: Obvious things C should do
#267Earlier quoted context omitted.
D had compile time execution of functions in 2007. Order-independent top level declarations. Underscores embedded in integer literals. (I stole this idea from Ada, which had been forgotten. Soon after D popularized it, it became standard in other languages.) Continue or break to labeled loop. Fixed sizes for ints, longs, etc. Of course, I don't know if there's a straight line here, and Zig is welcome to use any featu…
> Underscores embedded in integer literals. Perl had this years before D even existed [1]. Given its earlier age and higher reach, it's likely that Perl did more to popularize the idea as well. > Continue or break to labeled loop. Also a feature that Perl had years before D's existence [2]. These two are the ones I immediately recognized because of my familiarity with Perl, but given the trend, I'm doubtful of the ot…
I accept that Metaware and Perl did this before D. But I still claim that adoption of it in other languages came shortly after I popularized it in D, as I included it in many presentations about it.
Re: Obvious things C should do
#268Earlier quoted context omitted.
D had compile time execution of functions in 2007. Order-independent top level declarations. Underscores embedded in integer literals. (I stole this idea from Ada, which had been forgotten. Soon after D popularized it, it became standard in other languages.) Continue or break to labeled loop. Fixed sizes for ints, longs, etc. Of course, I don't know if there's a straight line here, and Zig is welcome to use any featu…
Metaware High-C version 1.2 (Nov 1985) had underscores in floating point and integer literals. Possibly it had that even earlier. Possibly also taken from Ada, as other text in that section of the manual reference Ada. See A.3 pg 169 (and 58+) of 235 in: https://bitsavers.org/pdf/metaware/High_C_Language_Reference...
Re: Obvious things C should do
#269Earlier quoted context omitted.
I know that in other languages, one obstacle for "just compile the C files" is that the target language might not have pointers and thus have difficulty representing things such as return-by-pointer. I suppose in D this was less of an issue because D has pointers?
I'm not sure what you mean.
(The issue with return-by-pointer is that in C it's common to use the return value for an error code and use pointer arguments to pass data back to the caller. These are awkward to map to a target language that doesn't have pointers)
Re: Obvious things C should do
#270Earlier quoted context omitted.
It is difficult to imagine that compile-time interpretation of tests is faster than compiling and running them for anything more complex. And for trivial stuff it should not matter. Not being able to do I/O is a limitation not a feature.
Linkers are slow and clunky. Yes, there is a crossover point where executable tests are faster.