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.
Posts by Olin Lathrop
As with most everything in engineering, how much call arguments to a subroutine should be validated is a tradeoff. There is no single universal right answer. Note that checking for null pointers ...
To start off, here is the complete HTML of a simple example table: <html lang="en-US"> <head> <title>Title</title> <style> table { width: 20em; ...
You want to scale from one linear range to another. That can always be done with y = mx + b where X is the input value and Y the output value. M is the scale factor, and B the offset. You ...
There is basically only one reason not to use static functions in C, as opposed to functions with global scope. That's if you want to access the function from outside the module. Otherwise, if th...
I'm able to access a, since b is below a on the stack. No, it's not! You have no guarantee in what order the compiler allocates temporary variables on the stack, and even whether it does so at al...
Object and Class aren't necessarily the same thing. Back in the 1980's when object oriented programming started to be talked about by practicing software engineers writing real production code, th...
This is a good question. It depends on how much this site is about getting language X to do Y versus the higher level concepts of software design and computer science that should largely transcend...
Now that we've had a few of these answers, I really don't like them. It seems there are three separate problems with the ChatGPT answers we have seen: Quote-only. Just like we don't allow link-o...
Just mass-importing from elsewhere is generally bad. Look at the mess this has made of the Outdoors and Scientific Speculation sites, for example. Bringing over your own content is a bit different...
Some additional advantages of interpreted languages: Interpreted programs are basically scripts run by the interpreter. The interpreter can be embedded into other applications that want to provid...
I'm not familiar with Latex, but it seems the PDFs are generated from the Latex files. It then seems the real problem is that you are trying to keep source and objects derived from that source in ...
Now, (x != 42) which is false yields 0 OK so far. so I have expected to get in console "-42" No. As you say, the expression evolves: (x == 42) * -1 + (x != 42) * x (1) * -1 + (0) * x...
MEMCMP simply compares the memory bits between two locations. This has nothing to do with whatever those bits might mean. Your first example, on the other hand, compares the contents of variable ...
To clarify why what you show can't work, it's because you are mixing build-time and run-time constructs. All the #xxx commands are to the C pre-processor. They are used to modify the source code ...
Most general purpose computing operating systems can't be counted on for accurate timing as short at 1 to 2 ms. Any test case should run for a few seconds at least. Those runs should then be repe...
The sole purpose of tags should be to help classify posts into what they are roughly about. Being able to easily get the broad topic of posts is obviously useful in searches, but may also be usefu...
Personally, I don't like the first form (initCanDriver) at all. The routine name is supposed to present some information as to where/how the routine fits into the larger software world. Informati...
Downvote them for now. If it becomes a common problem, then create a close reason of no-research, and close them. Such questions should not be "answered" in comments. First, comments aren't for ...
I see that Klutt has explained why integers should be used, but there is more that the programmer must keep in mind. Consider the number of bits the integer needs. For US currency, you'd use cent...
A namespace is a category of names within which they must all be unique. This also means that names do not need to be unique between namespaces. For example, states of the USA is a different name...
Poorly asked questions should be closed. Why they are poorly asked (with confusing being only one instance of that) should have no bearing on closure. Whether a question has answers or not should...
Shouldn't operator precedence guarantee that b() is executed before a()? No. Operator precedence says what to do with values in an expression once you have its input values. Order of evaluation ...
The general mechanism you describe has been in use since there were cross-compilers and libraries that were meant to provide the same application interface on different platforms. Your specific ex...
It seems I'm missing something since the answer should really be obvious. Nonetheless, I'll answer what you appear to be asking to get the obvious case out of the way. The method has already "f...
Here's the problem: Wednesday I make the changes, git commit --amend them Just do a normal commit. You are trying to re-write, or cover up, history. That's generally bad. The record should ref...