- Fizz Buzz - 2 Updates
- "Jonathan Blow: "C++ is a weird mess"" - 4 Updates
- InputApp and TabTIP are _always_ killed. - 3 Updates
- Users needed - 1 Update
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 25 11:04AM ["Followup-To:" header set to comp.lang.c++.] On Thu, 2018-07-19, Adam Wysocki wrote: ... > * \retval true Dividend is divisible by divisor > * \retval false Value is not divisible by divisor > */ I really like it when people document what their functions do so I don't have to guess or reverse-engineer the implementation, but I can't help noticing the redundancy. Step 1: /** * \brief Check if value is divisible by another value * * \retval Whether dividend is divisible by divisor */ And since "check if ..." together with returning a bool makes it obvious what the return value means, step 2: /** * \brief Check if value is divisible by another value */ Step 3 is noticing that you chose good names and "bool isDivisible(dividend, divisor)" is pretty much the same text, so: /** */ There wasn't anything missing in the documentation, as far as I can tell. Except possibly "Undefined if divisor is 0", but if you know what integer division is and how it's normally done in C or C++, you already know what would happen. > { > return !(dividend % divisor); > } I guess my message is: save the documentation for when it's needed. /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
legalize+jeeves@mail.xmission.com (Richard): Jul 25 08:57PM [Please do not mail me a copy of your followup] Jorgen Grahn <grahn+nntp@snipabacken.se> spake the secret code >I guess my message is: save the documentation for when it's needed. This is why "Comments" are one of the code smells listed in "Refactoring" by Martin Fowler. -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Terminals Wiki <http://terminals-wiki.org> The Computer Graphics Museum <http://computergraphicsmuseum.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
Lynn McGuire <lynnmcguire5@gmail.com>: Jul 24 07:08PM -0500 On 7/24/2018 7:35 AM, Thiago Adams wrote: > Other languages, like C#, that don't have free functions > had to create a mechanism to archive similar functionality > called extension methods. Actually, the multiple inheritance is to "inject" our standard object data storage so that the user's choices on this modeless dialog can be saved for their future usage. Lynn |
boltar@cylonHQ.com: Jul 25 08:27AM On Tue, 24 Jul 2018 21:33:31 +0000 (UTC) >Oh, you wanted more? >People use private inheritance for composition of implementation, for >example. And again in English? >"ATL Internals" for a really good design stufy of templates and >composition of implementation through inheritance. It is worth >reading even if you don't plan on ever writing COM objects on Windows. I don't plan on ever writing anything for Windows. |
BGB <cr88192@hotmail.com>: Jul 25 04:37AM -0500 On 7/10/2018 5:41 AM, Bart wrote: > That example uses a 34KLoc example program, and takes some 2.5 seconds > source to executable (I think the version using a C compiler back-end is > somewhat faster). I just ran across this thread. But, yeah, I am not personally expecting that much from Jai, and my own language design preferences are quite different (and to me, his design seems a bit misguided; like something which could "crash and burn" and/or quickly transform into an unusable mess). I have my own custom C compiler (*) which can compile Quake and Doom in about 5 seconds. I "could" try to make it faster, but it is mostly sufficient. A decent chunk of this time seems to be mostly IO (reading in header files and similar). I "could" possibly shave a little time off by effectively bundling the C library headers and similar into a VFS (probably compressed with an LZ4 like scheme). Note that doing a C++ compiler would be a whole different level of pain vs just supporting C. *: Mostly for custom CPU designs, for native development I mostly use MSVC or GCC. Mine "basically works" but is also sort of buggy/crap. I am mostly using Doom and Quake as test cases for my CPU/ISA design (as a stand-in for "doing actual work"). > even that front end, and the compilers are not themselves optimised > other. But I would still hesitate to call that super-fast; I think I'd > reserve that for 1Mlps and above. I've only occasionally breached that.) A lot depends on how much is done by the compiler. If one does ASTs, 3AC/SSA, and uses multiple passes for things like register allocation and branch-distance-optimization, ... then it is bound to be a little slower. Avoiding textual header inclusion can also help a bit (preprocessing and parsing header declarations being a significant time waster). Though, a goal is to keep it down to maybe a few seconds or so, as too much more than this starts to eat into flow. Though, as is, I suspect I spend more time with things like "interactive testing" than compiling... However, on the other hand, when build times are an hour or more, this is unworkable (as-is, LLVM/Clang takes ~ 1 hour to rebuild on my PC), seriously dethroning Doom 3 which rebuilds in about 15 minutes. > using SSD too as is mentioned at one point; mine just has a regular > HDD), rather than the usual Linux. To hear people on these groups tell > it, Windows is hopeless for software development. I am using Windows, with an SSD for 'C:\', but pretty much everything else is on HDD's. Putting Windows on an SSD makes nearly everything else go faster, as well as having a big page-file. My PC has 32GB of RAM and 112 GB of swap/pagefile space. This may seem like a lot, but every so often I run into a situation which needs a large amount of memory. >> Let's see how this Jai turns out ... > The language snippets I saw didn't really grab me. I can't get a sense > of its 'shape' or identity. I think we need to see more complete programs. Yeah, I haven't seen much personally to instill much confidence. But, for the most part, the languages I am using most right now are mostly C, ASM, and Verilog. C++ is probably in 4th place (following Verilog), but still ranking above "most other" languages. I had considered some ideas for doing a language to address the sorts of things I am doing, or basically something that could be "C competitive" for some of my use cases. Roughly what it started looking like: Syntax is partway between C and early versions of Java; Language structure is more like C#; Typesystem design is intermediate between C, Java, and C#. Unlike Java or C#, there would be no GC. Pointers would exist, but are confined to 'unsafe' locations. However, array-references may be used similar to pointers. But, would be type-safe and bounds-checked (at a cost). There would be no generics or similar. But, there would be a type-inferred 'auto' type. There would be overloading and namespaces/packages. These are "sufficiently useful". Object model was considered to be "similar" to the one in Java: With more explicit constraints and semantics for object lifetime. For most objects, there will be rules to make lifetime explicit. For the "general case", there is new/delete. Methods are 'final' by default. The 'virtual' keyword is needed to allow overloading. Likewise, single inheritance with interfaces. Structs would also exist, with similar semantics to C and C#. Had also defined "string" as a semi-opaque immutable type (in contrast, say, to Java defining them as being object instances). ... To some degree, it would be similar to my prior "BGBScript2" language, but with minor syntax and semantics changes (for example, BS2 used "virtual by default" semantics for object methods, ...). However, other than this, there wouldn't be a whole lot of "features". (A design goal would be to try to limit adding too many unnecessary features). This idea is partly held back by inertia though, namely in that for much of what I am doing, C is sufficient. Similarly, it would have the usual "not being C" drawbacks, and it is unclear if there is really all that much of a point. Similarly, things like bounds-checked array references are cause for concern, as accessing them could require additional metadata and bounds-checks, which don't come free (and are harder to infer-away than null-checks). This would mean "safe" would come at a performance premium, and "fast" would effectively devolve to "just use pointers". So, yeah, debatable at best, and a few people had complained before about how conservative my past design ideas were... (like, they want fancy/new/different rather than "something that looks like C mixed with Java"...). |
legalize+jeeves@mail.xmission.com (Richard): Jul 25 08:56PM [Please do not mail me a copy of your followup] BGB <cr88192@hotmail.com> spake the secret code >I have my own custom C compiler (*) which can compile Quake and Doom in >about 5 seconds. Are your customizations around making the compilation process faster? If so, what exactly are you doing to get the speedup? Is this something that could be contributed to clang? -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Terminals Wiki <http://terminals-wiki.org> The Computer Graphics Museum <http://computergraphicsmuseum.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
Jeff-Relf.Me @.: Jul 25 05:48AM -0700 |
"Colonel Edmund J. Burke" <burkesbabes@bigass-babes.com>: Jul 25 06:59AM -0700 On 7/10/2018 1:56 PM, assworm babbled: > wait until you see what a real computer can do And living up in the Arctic Circle, one is always a step ahead of the mainstream electronics crowd. LOL IDIOT! |
"Colonel Edmund J. Burke" <burkesbabes@bigass-babes.com>: Jul 25 07:00AM -0700 Quit poasting this horseshit, you anus! |
woodbrian77@gmail.com: Jul 24 10:33PM -0700 I've been going "from strength to strength" (Psalms 84:7) as far as making improvements to my software: https://github.com/Ebenezer-group/onwards . In order to keep the winning streak going, I'd like to find some external users to help in terms of providing valuable feedback. So, I'll spend 16 hours/week for six months on a project that uses the C++ Middleware Writer. There's also a reward for providing a successful reference. More info here: http://webEbenezer.net/about.html . Brian Ebenezer Enterprises http://webEbenezer.net. |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment