Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Activity for Lundin‭

Type On... Excerpt Status Date
Comment Post #279081 @Martin Bonner As for Rasp Pi, it is a PC toy, not an embedded system. Using it for mission-critical embedded systems is probably criminal. Kind of the same situation as using some "lets play doctor" kit for kids in real medical surgery.
(more)
over 4 years ago
Comment Post #279081 @Martin Bonner MISRA-C covers array out of bounds access, see [Does MISRA check if array index out of bounds?](https://stackoverflow.com/questions/64800766/does-misra-check-if-array-index-out-of-bounds). A buffer overrun is a broader meaning though, it happens on the top application layer, such as sa...
(more)
over 4 years ago
Comment Post #278907 As for safety standards, the good ones focus on "what should we do when this error occurs" rather than "error must not happen". Of course you should prevent errors from happening, but you also need to have a plan of what to do when they happen anyway. This is where defensive programming saves the day...
(more)
over 4 years ago
Comment Post #278907 @Canina Yeah well, mainly "anecdotal" was a just a poor wording, "empirical evidence" is another thing entirely. That is, "I heard it from a guy on the internet" vs "I made field population studies of x cases".
(more)
over 4 years ago
Answer A: What is do { } while(0) in macros and should we use it?
The sole purpose of the `do { } while(0)` is to write macros that accommodates to all manner of diverse coding styles. It is quite common not to use braces after `if` statements, so this is a common coding style: if(bad) HCF(0xDEADBEEF); else printf("good"); If we only us...
(more)
over 4 years ago
Question What is do { } while(0) in macros and should we use it?
Background I can see the need to use `{ }` when implementing a function-like macro such as this one: #define HCF(code) fprintf(stderr, "halt and catch fire"); exit(code); Because if we use the following calling code bool bad = false; if(bad) HCF(0xDEADBEEF); print...
(more)
over 4 years ago
Edit Post #279291 Post edited:
over 4 years ago
Comment Post #279291 Disclaimer: I'm not a C++ guru and various subtle crap changed from C++11 and beyond. I _think_ I got the C++11 standard right and also that this part holds true for any version >= C++11.
(more)
over 4 years ago
Edit Post #279291 Initial revision over 4 years ago
Answer A: Static and thread_local initialization order
TL;DR The initialization of the variables `a` and `b` in your question are indeterminately sequenced in relation to each other. The initialization order is not guaranteed between them. The initialization rules of C++ are quite complex, especially past C++11. The relevant part would be C++11...
(more)
over 4 years ago
Edit Post #279081 Post edited:
over 4 years ago
Edit Post #279081 Initial revision over 4 years ago
Answer A: Is MISRA-C useful outside safety-critical and embedded programming?
It is true that MISRA-C has a heavy focus on embedded system, though it has become somewhat more generic over time. The MISRA guidelines have been changed and improved several times over the years (in 1998, 2004 and 2012 + numerous TC and addendum/amendments). They are now definitely general enough t...
(more)
over 4 years ago
Edit Post #279077 Initial revision over 4 years ago
Question Is MISRA-C useful outside safety-critical and embedded programming?
When discussing best or safest C programming practices with various C gurus on the Internet, the "MISRA-C guidelines for the use of C language in critical systems" often pops up as a source. This standard was invented by the automotive industry and is pretty much mandatory in all automotive firmw...
(more)
over 4 years ago
Edit Post #278983 Post edited:
Don't use company name tags.
over 4 years ago
Edit Post #279031 Initial revision over 4 years ago
Answer A: Do we really need the [tools] tag?
No, it's not helpful, it's far too broad and doesn't make sense to use in combination with any other tag either. It can't be used for searching or categorizing questions either.
(more)
over 4 years ago
Comment Post #279013 Is STL a thing in C++ still though? Has it not been swallowed up by the "standard library" just like everything else? Why do we need a tag for it to begin with?
(more)
over 4 years ago
Comment Post #278985 I wonder what's the rationale behind any of it. What if I have a question about the MySQL dbms specifically, which is not related to SQL language at all? Does this mean that the site will force me to add the extra unrelated SQL tag?
(more)
over 4 years ago
Comment Post #278978 This might be of interest: https://stackoverflow.com/questions/8295131/best-practices-for-sql-varchar-column-length
(more)
over 4 years ago
Comment Post #278303 @laserkittens Those are borderline on-topic. An excel formula is (arguably) a very limited form of programming. If you think they should be off-topic, you could propose it [here](https://software.codidact.com/questions/278648). However, it has been suggested to either migrate them to either a "Power ...
(more)
over 4 years ago
Edit Post #278932 Post edited:
over 4 years ago
Comment Post #278952 On SE, unusued tags deleted themselves fairly quick, I think within 24 hours?
(more)
over 4 years ago
Comment Post #278924 Besides, lets say you drop templates and overload int + float functions only. You will most likely need to write the implementation of those functions differently, because these types are compared & promoted differently.
(more)
over 4 years ago
Comment Post #278924 @dmckee DRY is probably the most overrated and dangerous design principle out there, though. Often it causes more problems than it solves, due to overly complex and obscure code. Maintaining a template metaprogramming hell will almost certainly cause more bugs than maintaining 2 functions with code r...
(more)
over 4 years ago
Comment Post #278924 Yet another option is to [KISS](https://en.wikipedia.org/wiki/KISS_principle) and not use templates at all, but to provide & overload functions for the supported types only. Because restricting the type-generic interface to only support certain types kind of goes against common sense.
(more)
over 4 years ago
Edit Post #278932 Initial revision over 4 years ago
Answer A: Growing software.codidact
We can't go and shamelessly promote Codidact in SO comments etc just for the sake of it - that's regarded as spamming and might get you banned, plus it will give Codidact a nasty rep. Similarly, SE and many other sites frown upon using "signatures" in your posts. What you can do - and what I've be...
(more)
over 4 years ago
Comment Post #278907 "Aviation safety is built, pretty much completely, on that kind of "anecdotal evidence"" Well, not really. Rather a group of experts getting together and agreeing on how things should be done. If you can quote for example DO-178, then that's a well-respected standard and canonical source.
(more)
over 4 years ago
Edit Post #278899 Question closed over 4 years ago
Comment Post #278899 Questions about the _use_ of software for other purposes than programming is clearly off-topic. Whether we have somewhere to direct such questions or not doesn't matter. This is not about scripting but about how to use a command line zip program.
(more)
over 4 years ago
Comment Post #278895 If you enforce a style that always uses braces you can check it with static analysis tools though. Unlike using the wrong variable and similar application level bugs.
(more)
over 4 years ago
Edit Post #278896 Post edited:
over 4 years ago
Edit Post #278896 Post edited:
over 4 years ago
Comment Post #278896 But in the end experienced C programmers have already been through missing semicolon, missing brace hell. It's an initiation rite that everyone learning C must go through. After you have coded for some 5+ years you can spot and fix these kind of bugs even if you wake up in the middle of the night wit...
(more)
over 4 years ago
Edit Post #278896 Initial revision over 4 years ago
Answer A: Is omitting braces for single statements bad practice?
Not using braces is considered bad practice by widely recognized industry coding standards (MISRA-C:2012 rule, 15.6, CERT C EXP19-C and others). Once upon a time I liked to skip out braces too, but every C (or other language) programmer using that style will ultimately write missing brace/indentio...
(more)
over 4 years ago
Comment Post #278893 So the phantom answer was caused by ‭luap42 is a ghost 👻? Makes sense, [status-haunted] :)
(more)
over 4 years ago
Edit Post #278869 Initial revision over 4 years ago
Answer A: Counting number of assignments that a `fscanf` format strings implies
Consider using look-up tables to increase execution speed (at the cost of some 200 bytes .rodata use). For example this: static const char specifiers[] = "diouxaefgcspAEFGX"; could be replaced with static const bool specifiers[UCHARMAX] = { ['d'] = true, ['i'] = true, ...
(more)
over 4 years ago
Edit Post #278868 Post edited:
over 4 years ago
Edit Post #278868 Post edited:
over 4 years ago
Edit Post #278868 Initial revision over 4 years ago
Question The size of the code format window is much too small.
When posting a lot of code on the site, the "code format window" is much too small: 1 I'm talking about this thing 2 3 4 5 6 7 8 9 10 11 12 13 14 15 The scroll bar appears after only 13 lines for me, so I can only view ...
(more)
over 4 years ago
Comment Post #278832 @Peter Taylor‭ Combining several tags to form a meaning rarely ends well. I think making one tag per program will work better in the long run.
(more)
over 4 years ago
Comment Post #278841 Command line is not programming. Everyone else but conservative programmers have stopped using command line, but that doesn't make it programming still. Once upon a time, regular users used command line, in the days of UNIX and DOS.
(more)
over 4 years ago
Comment Post #278847 Threaded comments would be awesome!
(more)
over 4 years ago
Comment Post #278830 Anyway, I think such recommendation lists may work out well if they are extensively curated and there are rules for them. I tried to make a push for quality [here](https://meta.stackoverflow.com/a/379637/584518) but nobody was interested in that. From what I hear the C++ book list is of decent qualit...
(more)
over 4 years ago
Comment Post #278830 I've been fighting a losing battle to get that one as well as the ["list of random books that exist and some might even be about programming"](https://stackoverflow.com/questions/1711/what-is-the-single-most-influential-book-every-programmer-should-read) deleted. SE community managers went in and ban...
(more)
over 4 years ago