Questions tagged [programming-logic]

According to Wikipedia, Logic (from the Ancient Greek: λογική, logike)[1] has two meanings: first, it describes the use of valid reasoning in some activity; second, it names the normative study of reasoning or a branch thereof.[2][3] In the latter sense, it features most prominently in the subjects of philosophy, mathematics, and computer science.

According to Wikipedia, Logic (from the Ancient Greek: λογική, logike)1 has two meanings: first, it describes the use of valid reasoning in some activity; second, it names the normative study of reasoning or a branch thereof.[2][3] In the latter sense, it features most prominently in the subjects of philosophy, mathematics, and computer science.

59 questions
36
votes
14 answers

How to define "or" logically

Recently, I came across a problem that required me to define the logical "OR" operator programmatically, but without using the operator itself. What I came up with is this: OR(arg1, arg2) if arg1 = True and arg2 = True return True else if…
logicNoob
  • 511
10
votes
3 answers

What is the best practice around De Morgan's Law

We all know De Morgan's Laws !(a && b) === (!a || !b) !(a || b) === (!a && !b) Is there a community consensus around which one of these representations is easier to reason about (and therefore) produces more maintainable code? If there is not, what…
Abraham P
  • 269
1
vote
1 answer

Efficient ordering of objects online

I have a list with objects stored in a database. These objects are shown in a list and the user can drag and drop them to order them in a specific way. I want that specific order to be stored. How can I do this in an efficient manner? I've thought…
Mathijs
  • 123
-2
votes
3 answers

What's a good way to extract what's needed programatically from business logic?

I'm new to programming and I've discovered something that causes me confusion and frustration: Translating business logic into actual code. I'm trying to develop a set of questions I can ask myself that will help me get to the level of detail I'm…
JM1
  • 109