1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
natta225 [31]
2 years ago
12

How do i describe a strategy for avoiding nested conditionals.

Computers and Technology
1 answer:
Rzqust [24]2 years ago
6 0

Answer:

The target code is in the middle here and has a nice path up to it, however connecting the dots for the else conditions isn’t quite as clear. While this code might be understandable in the heat of writing, if you decided later that userOwnsCat() needed to be true for a user to log in, and you wanted a specific error condition for it…things get messy, quickly. Essentially, this code is not maintainable.

There’s no issue with the logic in this nested example – it’s just badly organised. The very same logic can be written in such a way that it only ever goes one level deep, and there’s not much to it either.

You might be interested in
Tablets, smartphones, and video game consoles usually have which of the following types of operating systems? distributed multiu
vovikov84 [41]
Embedded.
<span>
Real-time is for thing like your thermostat (Nest) etc.
Distributed is for huge number crunching supercomputers.
Multi-user would mean more than one person was using the device at the same time with a different device.</span>
6 0
3 years ago
Read 2 more answers
Additional rows and columns are inserted into a table by using the _____ tab
Sindrei [870]
Insert tab
up at the top
have a nice day
6 0
3 years ago
Read 2 more answers
Can someone please answer this? It isn't Insert
enyata [817]

Answer:

The answer for this question is b Add to

3 0
2 years ago
Intellectual property does not include which of the following? A. the recipe for a brand of soft drink B. the lyrics and melody
jeka94
The answer you seek would be C. I just took this test C. was the correct answer
4 0
3 years ago
Read 2 more answers
A storage location in the computer's memory that can hold a piece of data is called
TiliK225 [7]
This is a named storage location in the computer's memory<span>. Byte code .</span>
7 0
3 years ago
Other questions:
  • Which of the following is not a basic networking hardware component? Network interface card
    12·1 answer
  • Refer to the exhibit. A web designer calls to report that the web server web-s1.cisco is not reachable through a web browser. Th
    15·1 answer
  • There was a thunderstorm in your area and the power is out. The traffic lights are not functioning. Explain what you should do w
    8·2 answers
  • 20<br>Calculate the kinette energy of a body the speed<br>that will be a mass tragm​
    10·1 answer
  • What is the best operating system
    12·1 answer
  • Which of the following is NOT a good way to treat an EPA or OSHA inspector?
    15·2 answers
  • To print a budget:________.
    9·1 answer
  • Please help. 10 points
    5·2 answers
  • Do you think communities or countries can survive without the internet?why or why not?​
    11·1 answer
  • Guidewords for the word “serpent” may be
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!