Tag Info

New answers tagged

0

we should prefer "condition is not satisfied" or "condition is not met" unless we really wish to emphasize that an evaluation produced false. Such phrasing is proper and necessary when we are talking abstractly about the "requirements" or "business rules". It's simply natural to talk like this, especially for domain experts talking amongst themselves ...


1

"The condition is true" and "the condition is false" are colloquialisms--informal, imprecise statements that are nonetheless widely understood and "close enough for government work"--i.e. practical even if not precise. In your example, if (foo - bar), you are not actually dealing with formal bool or Boolean data types. In most languages, you're dealing with ...


2

There is no perfect answer. The best compromise I've found: if ( condition ) { ... } else { // Otherwise ... } This might make a little better sense in fuller context: // Comment about what this next section does if ( condition ) { // Comment about the then clause ... } else { // Comment about the else clause ... } For ...


4

Your piece of code can easily be rewritten into: if(not condition1) { MethodA() return } //perform some logic if(condition2) { //perform some logic if(condition3) { //Perform logic return } } MethodA(param) Then, a part of the code can be extracted into a method: int Hello() { if(condition1) { ...



Top 50 recent answers are included