Stop Error Checking in code

Error codes are the problem, not the solution. You probably don’t realize it, but all that code you add to “handle errors” are just making the problem worse. And no matter how much more time you devote to “error checking,” you will never end up with a system that’s smart enough to keep itself error free.

So why do you keep trying? As it happens, there is a better way: just stop doing the error checking. Purge your system of the concept of “error” in the right way, in fact, and you’ll end up with an implementation that works better in nominal cases and gives you better insight and opportunity to regain control when something unexpected happens. Your code will be simpler, too. To get this right we’ll need to reformulate your thinking a little.

Let’s talk about software errors/exceptions and how you can craft better software by giving them appropriate design considerations. I’ve often found that developers, even experienced developers, don’t put much thought into the error objects that they produce.

1. Be specific :
When an exceptional situation occurs and you wish to throw an exception for that state, what type of error should you throw?

2. Great software error messages :
While that seems helpful, it is not a wise idea. Firstly, it leaks implementation details to any users who might see the error message. Secondly, there’s only so much context you can squeeze into the message.

3. Use error properties :
You can simply add properties to your implementation that states properties that matter to you.

4. Only use exceptions in exceptional cases :
This is more a general rule, but exceptions are supposed to be exceptional. They break control flow making it difficult to understand the repercussions of an exception. That means it can be hard for other developers to understand your code. Further making this worse, exceptions are often treated in special ways by the host runtime. Exceptions should be exceptional.

How did we get the idea that the stork delivered babies?

The suggestion that storks delivered babies came from Scandinavia and was promoted by the writings of Hans Christian Andersen. Storks had a habit of nesting on warm chimneys and would often lift articles from clotheslines then stuff them into these nests, which to children looked like they were stuffing babies down the flue.

The stork is also very nurturing and protective of its young, which helped it become symbolic of good parenthood.

What does it mean to be bilingual?

A bilingual person is able to speak two languages. A person who speaks more than two languages is called “multilingual.” A person does not have to speak two languages with equal fluency to be considered bilingual; usually, a person will be stronger in one language than another. It is common for most of the world’s societies to be multilingual; in the United States, one in five children enters school speaking a language other than English, according to the 2000 Census. Some children who learn English in school speak their native language at home. Bilingualism often allows children to communicate with their grandparents, which can strengthen family bonds across both generations and countries.

Bilingualism teaches an appreciation of the arts and traditions of two cultures. It promotes tolerance and cross-cultural understanding; research indicates that children who are raised with a bicultural identity tend to be more accepting of cultural differences in others.

Does every country have its own flag?

Every country has a national flag, including the United States. Flags date back to around 1000 B.C.E., when the Egyptians used primitive versions of flags—some were even made out of wood or metal—to identify themselves and to signal to others. Ships started using flags at sea to signal to each other and to harbors, often to let them know they had a diseased crew aboard. Flags are still used today to let sailors know what weather conditions await at sea. The military also made use of flags to rally its troops. During the ancient wars, capturing an enemy’s flag was considered an honorable seizure.

Today, the most popular use of flags is to identify and symbolize the world’s countries, which became commonplace in the 1700s. When new lands are discovered—and, for example when Mount Everest and the Moon were conquered—explorers raise their country’s flag as a sign of their being the first to set foot on these unchartered lands.

When did the first spacecraft go up into space?

The Soviet satellite Sputnik 1, which was launched into space on October 4, 1957, was the first spacecraft to go into orbit around Earth. It had no crew members or animals aboard, but instead contained machines that sent information back to Earth via radio.

The former Soviet Union’s (now Russia) launch of Sputnik prompted the United States to get its first satellite, Explorer 1, into orbit quickly, igniting the so-called space race. This was the two countries’ rivalry over being the “first” in many areas of space exploration. Explorer 1’s test run in December 1957 burned on the ground, but the satellite was successfully launched into orbit around Earth on January 31, 1958.

How did March 17 become St. Patrick’s Day?

When the time came to honour the patron saint of Ireland’s birthday, church officials gathered solemnly to choose a day, then realized that most of St. Patrick’s life was a mystery. They finally narrowed his birthdate down to either March 8 or 9, but because they couldn’t agree which was correct, they decided to add the two together and declared March 17 to be St. Patrick’s Day.

Where are the world’s rain forests?

The name “rain forest” comes from the fact that these lush areas of land receive a lot of rain—between 160 and 400 inches per year. They are located near the equator, Which means that their climate is warm. Rain forests cover only a small part of Earth’s surface, about 6 percent, yet they are home to over half the species of plants and animals in the world. For example, the jungles and mangrove swamps of Central America contain many plants and animals found nowhere else, including many types of parrots. The Amazon jungle in South America is the world’s largest tropical rain forest, and is home to one-fifth of the world’s plants and animals.

The forest covers the basin of the Amazon, the world’s second longest river. Central Africa has the world’s second largest rain forest. To the southeast, the large island of Madagascar is home to many unique animals. The rain forests of Asia stretch from India and Burma in the west to Malaysia and the islands of Java and Borneo in the east. Bangladesh has the largest area of mangrove forests in the world. Australia, too, has rain forests: undergrowth in this county’s tropical forests is dense and lush.

Are Machines making human a dumb?

Imagine being surrounded by technologies, and hardly being aware of them. For instance, a person walks into a room and without doing anything, the entire atmosphere is fine-tuned to his or her current mood or expectations. Measurements are taken, personal data is sensed and recorded, and the room adjusts to integrate with the person’s countenance. All this occurs without turning a switch or adjusting an appliance simply walk into the room. We’re beginning to move in this direction, with recent advances in medical technology, with personal fitness devices, and with smart home systems.

Behind the scenes, as the individual enters the room, the unseen technology helps advance the person’s security, health, comfort, and even creativity by providing a seamless set of adjustments and changes to everything from room temperature to computer access to food preparation. What’s not seen are the computers running super-high-speed algorithms, computations, and calculations processing commands and actions to create a seamless life existence for everyday needs.

Here’s a real-world scenario: The person walks in the room. The sensors identify the person, as well as the mood of the person using facial features and expressions, body temperature, and movements, including gait and posture. Additionally, the smart room can monitor an individual’s current health conditions, such as blood pressure, heart rate, breathing, and chemical composition. This is all done in real time.

Next, a robot comes out bringing you water and vitamin supplements from sensing those that are physically lacking. While sitting in a couch overlooking a virtually-generated ocean with the sound of crashing waves, the user decides to catch up on what is happening in the world and accesses the latest news by making a quick sweeping gesture in the air. The room instantaneously turns off the ocean scene and pulls up a news program. It all happens without the user needing to be fully aware of the entire process.

Such a scenario isn’t just limited to the confines of a person’s living quarters. It can apply to a city, a park, a museum, or a business. Imagine a society that’s so intelligent that the machines and computers are constantly collecting data, and learning from our actions and behaviors to make sound judgements and decisions. This human centric vision is just that, centered on the individual with technology serving to enhance, nurture, and protect, making life continually easier, healthier, and more productive. Importantly, people will retain and use the power to preprogram myriad commands and conditions suitable for their daily lifestyles and activities.

Are these innovative technologies are “dumbing” ground for your kids future?

How many bones are there in the human body?

Babies are born with about 300 to 350 bones, but many of these fuse together between birth and maturity to produce an average adult total of 206. Bone counts vary according to the method used to count them, because a structure may be treated as either multiple bones or as a single bone with multiple parts. There are four major types of bones: long bones, short bones, flat bones, and irregular bones. The name of each type of bone reflects the shape of the bone. The shape of the bone also tells about its mechanical function. Bones that do not fall into any of these categories are sesamoid bones and accessory bones.

How does a cellular phone work?

Cellular, or cell, phones first became available to consumers in the early 1980s, but the technology that made them small and truly portable evolved gradually over the next 10 years or so. By the beginning of the twenty-first century, millions and millions of people in countries all over the world were using cell phones on a daily basis. And it isn’t just adults who enjoy the benefits of completely mobile phone capabilities: in the United States alone, more than 20 percent of teenagers have a cell phone. That translates to at least one in five American teens. The cellular system divides each city into many small cells (a large city can have hundreds). Each cell has its own tower (which contains an antenna as well as transmitters and receivers that send and receive signals). Each tower can handle numerous callers at a given time, and their small size and weaker signal (compared to the radio antennae) means that their signals don’t interfere with those of nearby towers. When you call someone using a cellular phone, your phone is sending and receiving signals via radio waves, invisible bands of energy that work like light rays. In other words, your cell phone is a fancy, high-tech radio. After you dial a friend’s number, your phone must find the closest tower by searching for the strongest signal. Once that signal is located, your phone transmits certain information—like your cell phone number and serial number—that help your service provider make sure you are one of their customers.

Then the mobile telephone switching office (MTSO) finds an available channel where your conversation can take place. The MTSO then completes the connection (all of this happening in a few short seconds) and you are chatting with your friend, without wires or cords to hold you down. If you are sitting in the back seat of the car while talking, and your mom is driving you from one end of town to the other, your call will be switched automatically from one cell tower to the next without any pause in your conversation.