Why use other number bases when programming
My coworkers and I have been bending our minds to figuring out why anyone would go out of their way to program numbers in a base other than base 10.
Can you use Pi as a crude random number generator?
I recently saw this question over at math.SE. It got me thinking. Could Pi be used as a crude random number generator? I mean the results are well known(how long has pi been computed to now?) but, Pi does seem to be quite random when taken 1 digit at a time.
Should comments say WHY the program is doing what it is doing? (opinion on a dictum by the inventor of Forth) [duplicate]
Use comments sparingly! (I bet that’s welcome.) Remember that program
you looked through – the one with all the comments? How helpful were
all those comments? How soon did you quit reading them? Programs are
self-documenting, even assembler programs, with a modicum of help from
mnemonics. It does no good to say:
When modeling a virtual circuit board, what is the best design pattern to check for cycles?
To make it simple assume you have only AND and OR gates. Each has two inputs and one output. The output of two inputs can be used as an input for the next gate For example:
Looking for terminology for the relation of a subject and a predicate [closed]
Closed 10 years ago.
What does it mean that “language A is written in language B”?
I often hear the term that language A is written in language B. For example, PHP has been written C, C# is written in C++.
Is there an excuse for short variable names?
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. This has become a large frustration with the codebase I’m currently working in; many of our variable names are short and undescriptive. I’m the only developer left on the […]
What should be allowed inside getters and setters?
I got into an interesting internet argument about getter and setter methods and encapsulation. Someone said that all they should do is an assignment (setters) or a variable access (getters) to keep them “pure” and ensure encapsulation.
Looking for a real-world example illustrating that composition can be superior to inheritance [closed]
Closed 9 years ago.
Is code that terminates on a random condition guaranteed to terminate?
If I had a code which terminated based on if a random number generator returned a result (as follows), would it be 100% certain that the code would terminate if it was allowed to run forever.