1,474 Answered Questions for the topic computer programming
Computer Programming
05/05/19
How do you stop interim solutions from lasting forever?
Say there are two possible solutions to a problem: the first is quick but hacky; the second is preferable but would take longer to implement. You need to solve the problem fast, so you decide to...
more
Computer Programming
05/05/19
Is there a difference between foreach and map?
Ok this is more of a computer science question, than a question based on a particular language, but is there a difference between a map operation and a foreach operation? Or are they simply...
more
Computer Programming
05/01/19
What should NOT be under source control?
It would be nice to have a more or less complete list over what files and/or directories that shouldn't (in most cases) be under source control. What do you think should be excluded?
Computer Programming
04/29/19
What is a magic number, and why is it bad?
What is a magic number?Why should it be avoided?Are there cases where it's appropriate?
Computer Programming
04/28/19
Buffered vs unbuffered IO?
I learned that by default I/O in programs is buffered, i.e they are served from a temporary storage to the requesting program.I understand that buffering improves IO performance (maybe by reducing...
more
Computer Programming
04/28/19
Given an integer, how do I find the next largest power of two using bit-twiddling?
If I have a integer number `n`, how can I find the next number `k > n` such that `k = 2^i`, with some `i` element of `N` by bitwise shifting or logic.Example: If I have `n = 123`, how can I find...
more
Computer Programming
04/28/19
What is stability in sorting algorithms and why is it important?
I'm very curious, why stability is or is not important in sorting algorithms?
Computer Programming
04/28/19
What does the word "literal" mean?
What does the word "literal" mean when used in context such as literal strings and literal values? What is the difference between a literal value and a value?
Computer Programming
04/27/19
What are "first class" objects?
When are objects or something else said to be "first class" in a given programming language, and why? In what do they differ from languages where they are not?
Computer Programming
04/27/19
How do you plan an application's architecture before writing any code?
One thing I struggle with is planning an application's architecture before writing any code.I don't mean gathering requirements to narrow in on what the application needs to do, but rather...
more
Computer Programming
04/27/19
What is meant by "thread-safe" code?
Does it mean that two threads can't change the underlying data simultaneously? Or does it mean that the given code segment will run with predictable results when more than one thread are running it?
Computer Programming
04/27/19
What is a predicate?
Being a hobbyist coder, I'm lacking some fundamental knowledge. For the last couple days I've been reading some stuff and the word "predicate" keeps reappearing. I'd very much appreciate an...
more
Computer Programming
04/20/19
Why is quicksort better than mergesort?
I was asked this question during an interview. They're both O(nlogn) and yet most people use Quicksort instead of Mergesort. Why is that?
Computer Programming
04/20/19
What is "loose coupling?"
I can't seem to grok the concept of "loose coupling." I suppose it doesn't help that the word "loose" usually has a negative connotation, so I always forget that loose coupling is a *good*...
more
Computer Programming
04/19/19
Difference between parameter and argument?
Is there a difference between a "parameter" and an "argument", or are they simply synonyms?
Computer Programming
04/15/19
Fast rectangle to rectangle intersection?
What's a fast way to test if 2 rectangles are intersecting?
Computer Programming
04/12/19
Enums and Constants. Which to use when?
I was doing some reading on enums and find them very similar to declaring constants. How would I know when to use a constant rather than an enum or vice versa. What are some of the advantages of...
more
Computer Programming
04/12/19
Hash Code and Checksum - what's the difference?
My understanding is that a hash code and checksum are similar things - a numeric value, computed for a block of data, that is *relatively* unique.i.e. The probability of two blocks of data yielding...
more
Computer Programming
04/12/19
What is the difference between the terms "arguments" and "parameters"?
I often find myself confused with how the terms 'arguments' and 'parameters' are used. They seem to be used interchangeably in the programming world.What's the correct convention for their use?
Computer Programming
04/11/19
Skip List vs. Binary Search Tree?
I recently came across the data structure known as a [_skip list_](http://en.wikipedia.org/wiki/Skip_list). It seems to have very similar behavior to a binary search tree. Why would you ever want...
more
Computer Programming
04/10/19
The "backspace" escape character '\\b': unexpected behavior?
So I'm finally reading through https://en.wikipedia.org/wiki/The_C_Programming_Language, and I learned something within the first few pages, that there is a backspace escape character, `\\b`.So I...
more
Computer Programming
04/07/19
Why is syntax important in programming?
Computer Programming
04/03/19
What Makes a Good Unit Test?
I'm sure most of you are writing lots of automated tests and that you also have run into some common pitfalls when unit testing. My question is do you follow any rules of conduct for writing tests...
more
Computer Programming
04/03/19
Conventions for exceptions or error codes?
Yesterday I was having a heated debate with a coworker on what would be the preferred error reporting method. Mainly we were discussing the usage of exceptions or error codes for reporting errors...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.