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.

Search

Advanced Search Options

To further refine your search, you can use additional qualifiers such as score:>0.5. For example, the search score:>=0.5 created:<1y grammar would return only posts mentioning "grammar" that have a score >= 0.5 and were created less than a year ago.

Further help with searching is available in the help center.

Quick hints: tag:tagname, user:xxx, "exact phrase", post_type:xxx, created:<N{d,w,mo,y}, score:>=0.5

Filters
2.6k posts
 
80%
+6 −0
Q&A Are generic enums completely abstract?

When using Result or Option to get a value, the value is wrapped in a Ok or Some. For example, with pattern matching to get a Result: let var: Json = match serde_json::from_str(&my_string) { ...

1 answer  ·  posted 4y ago by jla‭  ·  last activity 4y ago by Derek Elkins‭

Question rust enum
80%
+6 −0
Q&A Are generic enums completely abstract?

Your question is a bit ambiguous. Usually when one talks about something being "completely abstract", one means the details of the representation are opaque. This is the sense of "abstract" in "abs...

posted 4y ago by Derek Elkins‭

Answer
80%
+6 −0
Meta Should we have a Code Review Section / category?

Proposal, based on the feedback here so far: because code-review questions have special rules, create a category. This allows (and we would need proposed text from the community for): Category d...

posted 4y ago by Monica Cellio‭

Answer
80%
+6 −0
Q&A How is this code "dividing" by a string?

As already said by another answer, you're not "dividing a string by another string". I'd just like to complement by providing more details about how this works. If you try to divide a string by ...

posted 7mo ago by hkotsubo‭  ·  edited 7mo ago by hkotsubo‭

Answer
80%
+6 −0
Q&A How is this code "dividing" by a string?

You very likely have a pathlib Path (or PurePath) object there. pathlib overrides the division operator to perform platform-aware path appends. >>> import pathlib >>> pathlib.Pa...

posted 7mo ago by r~~‭  ·  edited 7mo ago by r~~‭

Answer
80%
+6 −0
Q&A Turn all changes after latest origin/main into a branch

First you want to make your new branch at HEAD (current main). Then you want to point main back to origin/main. # Create new branch git branch new_branch_name # Point main back at origin git ...

posted 4mo ago by Michael‭

Answer
80%
+6 −0
Q&A In javascript is there really a good reason to never check for boolean true || false such as if(var){}else{}?

if(typeof(var) !== 'undefined' || typeof(var) !== null || var !== ''){}else{} is a wild thing to write for anything other than a variable that takes either undefined, null, or a string as possib...

posted 7mo ago by r~~‭

Answer
80%
+6 −0
Meta Don't close questions for lack of detail/confusion

As a newcomer here, I'd like to suggest two additional issues that weigh in favor of closing unworkable questions. First, a site that wants to grow its community needs to moderate its content. If...

posted 7mo ago by John C‭

Answer
80%
+6 −0
Meta Where should I ask git questions?

(Speaking personally, not for the team.) People using git are usually using it in a software context, and Software Development's scope is intentionally broad, so they definitely fit here. This is...

posted 5mo ago by Monica Cellio‭

Answer
80%
+6 −0
Q&A After git fetch, how to fast forward my branch?

tl;dr [1] git merge origin/branch_name Or rebase instead of merge Long answer When your local repository has one or more remotes configured, there are special branches that the documentation ...

posted 5mo ago by hkotsubo‭  ·  edited 1d ago by hkotsubo‭

Answer
80%
+6 −0
Q&A Why is the new auto keyword from C++11 or C23 dangerous?

The auto feature was indeed mainly meant to solve long cumbersome template container declarations in C++. But when introduced to C23 - where there are no templates let alone template containers - i...

posted 5mo ago by Lundin‭  ·  edited 5mo ago by Lundin‭

Answer
80%
+6 −0
Q&A Are these two function pointer declarations equivalent?

Normally, whenever a function designator (a function's name) is used in an expression, it decays to a function pointer to that function. typeof is one of those exceptions to the "decay" rules of C...

posted 6mo ago by Lundin‭

Answer
80%
+6 −0
Q&A After git fetch, how to fast forward my branch?

I did git fetch to quickly get latest commits. I did this instead of git pull so I could deal with merge conflicts offline. But my repository is still stuck on the old commit, and now git pull fail...

2 answers  ·  posted 5mo ago by matthewsnyder‭  ·  last activity 1d ago by hkotsubo‭

Question git
80%
+6 −0
Q&A Prevent anonymously subclassing

There is no keyword or compile-time construct to prevent this, but it can be accomplished through the use of a runtime exception: class Parent { public Parent() { if (getClass(...

posted 5mo ago by Andreas witnessed the end of the world today‭  ·  edited 5mo ago by Andreas witnessed the end of the world today‭

Answer
80%
+6 −0
Q&A Use cases for raising a 'NotImplementedError' in Python

What are some legitimate use cases for raising a NotImplementedError exception in Python? How can it help express a code author's intentions to aid code maintenance and/or further development of co...

3 answers  ·  posted 6mo ago by pfabri‭  ·  last activity 5mo ago by pfabri‭

Question python exception
80%
+6 −0
Q&A Behavior of Pointer Arithmetic on the Stack

Not only does the C language not guarantee it, it also will fail on actual compilers, as soon as you enable optimisation (which you'll generally want to do because you want your code run fast, afte...

posted 3y ago by celtschk‭

Answer
80%
+6 −0
Q&A Why does fopen return NULL?

The simple explanation would be that you simply don't have write access to the path, which is one possibility. Another weird phenomenon that may happen is that you are running a very old C...

posted 3y ago by Lundin‭

Answer
80%
+6 −0
Q&A How to delete contents of a specific field, if it matches a pattern and there is nothing else in the field

You're matching the regex pattern of /-/, so it just matches every individual hyphen, regardless of where. You want to match the entire entry if it's only hyphens, or /^-+$/. ^ – Beginning of line...

posted 2y ago by Ullallulloo‭

Answer
80%
+6 −0
Q&A TypeScript is unable to infer the correct type for a mapped tuple

I was playing around with mapped tuples and came across an interesting case where TypeScript cannot infer the types used: interface Foo<A, B> { (a: A, b: B): any } function test<...

0 answers  ·  posted 2y ago by Moshi‭  ·  edited 7mo ago by Moshi‭

80%
+6 −0
Q&A How to delete contents of a specific field, if it matches a pattern and there is nothing else in the field

The awk gsub function takes as its first argument a regular expression indicating the substring to be replaced, and replaces a matching substring with the value of the second argument, which is the...

posted 2y ago by Canina‭

Answer
80%
+6 −0
Q&A When using the compare function in Array.prototype.sort, how to avoid an element to be processed more than once?

When using the Array.prototype.sort method, we can pass a compare function as argument. Then, this function can be used to process array's elements, so the comparison is made using some custom crit...

2 answers  ·  posted 3y ago by hkotsubo‭  ·  last activity 1y ago by matthewsnyder‭

80%
+6 −0
Q&A Are static pointers implicitly initialized to NULL?

Yes, it is guaranteed to evaluate to true. All variables with static storage duration are set to zero in case of arithmetic types or set to null in case they are pointers. The relevant part is C17 ...

posted 3y ago by Lundin‭

Answer
80%
+6 −0
Q&A How to properly use malloc?

TL;DR You should use int *p = malloc(n * sizeof *p); for two reasons The cast (int*) is not necessary, which means it's clutter. Using sizeof *p instead of sizeof(int) removes code duplica...

posted 3y ago by klutt‭  ·  edited 3y ago by klutt‭

Answer
80%
+6 −0
Q&A Are static pointers implicitly initialized to NULL?

Consider this code: #include <stdio.h> int main(void) { static void *ptr; if(ptr == NULL) puts("It's NULL!"); } I wonder if this is guaranteed to print "It's NULL!" I know ...

1 answer  ·  posted 3y ago by klutt‭  ·  last activity 3y ago by Lundin‭

80%
+6 −0
Q&A Change font-family with JavaScript

To do that, you could change the selector from body to *, as the other answer said. By selecting only body, it won't change child elements that has defined a more specific rule, and that's why you ...

posted 3y ago by hkotsubo‭  ·  edited 3y ago by hkotsubo‭

Answer