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.
Search
"Brainfuck" is the name of a programming language; using the full name of the language is perfectly fine. We don't need to bowlderize proper names. As for your other example - foul language in cod...
Summary (TL;DR) Using strcpy directly on non-sanitized user input is bad, otherwise it's fine. strncpy is a dangerous function that should be avoided. Its presence in your source is a muc...
I am interested in knowing how the recent Codidactyl game and its code were created and obfuscated. See the non-announcement. From other posts, it appears that luap42 and Monica Cellio may have wo...
I have a post where I mention a script named dead.sh Ok... now I have two posts like that. But that is not a website. It is a filename, and not one reachable through an URL. How can I inhibit aut...
Method 1: <span> (or other HTML tag) It appears that Markdown isn't detected within HTML tags, so you can wrap the URL-like in a span or other tag and it won't turn into a link. <span>...
First of all, I've added a print in your code to show the dates: if days % 7 == 0 and current_day == 1: print(f'{current_year}-{current_month:>02}-{current_day:>02}') sundays += 1 ...
Use a stack while just scanning your string once from left to right. No need for multiple (performance-wise) expensive string replacements. If implemented right, the stack will only ever contain at...
I just started to see greetings in posts like: "Hello", "Thank you", "Morning" and other types of greetings. Should this greetings be removed from posts or we just keep them? Sometimes I think th...
Caveat When making a decision of such lasting impact, you should conduct your own evaluation according to the criteria that matter to you. This post does not attempt to replace such an evaluation,...
First of all, I realize that this is mostly a library you've implemented while learning programming, for the sake of learning, which is great. So I would rather not put a "wet blanket" over your at...
The warnings just say that you can't pass a string literal with type char[] to a function taking a struct Book* parameter. The function should be declared as: void init_Book_types (const char* tit...
When we launched this community, we did not yet have the ability to set different reputation grants for different categories. We've had this for a while but we failed to follow up before now, sorr...
Regarding undefined behavior/uninitialized variables of automatic storage duration First of all there's some misconceptions here. if (x == 0) is UB only because x was declared as a local variable...
Functions in C have external linkage by default. In other words, the storage class specifier extern is applied to functions by default, with the effect that they are visible to all translation unit...
No. Software Development is about writing software. Yes, you can stretch almost anything that is an input to software to be "writing software". But arguably the closest analogue in actual Software ...
Note: I asked this question on TopAnswers a couple weeks ago, but didn't get any response, so I figured I'd ask it here. I am currently learning C++. I have a parent class (Vehicle) and two subc...
Is it valid to partly allocate an object, as long as you only use the allocated part of it? #include <stdio.h> #include <stdlib.h> struct s { int i[100]; }; int main(void) {...
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 ...
This isn't specific to git merge. The standard Git behaviour is that any content- or history-changing command operates on the current branch. For example, you cannot git commit to a branch other th...
Statements and expressions are two syntactic categories that are used by many programming languages. Since they are syntactic, they depend on the programming language's syntax. In a real sense, a s...
As a relative newcomer to Rust, I'm trying to understand the behaviour of lifetimes, but I am confused by the following code: let s: &str = "first"; let mut r: &str = s; println!("First ...
The Python Global Interpreter Lock (GIL) is a mutex in the primary Python implementation (CPython) that is acquired whenever Python (byte)code is executing. This means within a single (OS) process ...
tl;dr, the lifetime of "second" is static The heart of your confusion is this: Since we are taking a long-lived reference r to a string slice inner which is destroyed at the end of its scope, ...
As other answers have said, we have some of these, they're helpful, and they can be hard to write. On Codidact there's another option, should the community want to enable it: articles. An article...
For what it's worth, I have some 20 years of experience designing embedded C systems, with large and small code bases both. Code design is some of the hardest things to do, since books about object...