Showing posts with label questions i ask google. Show all posts
Showing posts with label questions i ask google. Show all posts

Tuesday, September 15, 2015

Questions I ask Google, Episode 2

Are error codes the same as exception handling?


Oh boy, I did not expect the can of worms I opened with this question.

First, no, they aren't the same thing. And apparently, the differences between them is a subject of heated debate.

I was directed to a somewhat illuminating StackOverflow question that shed some light on where a large amount of people stand on the issue. It didn't quite answer my question, but I was able to garner some information from the responses.

An Error Code is a failsafe that is written into a program to report when something has gone wrong. An action to solve the issue must then be taken.

An Exception contains far more information than an Error Code, storing the state of the program as it was when the exception was triggered, and continuing (if possible) via an exception handler.

The debate is far more favored towards using Exceptions over Error Codes, and whenever I saw people who used error codes or "used to use" error codes, they typically were coding in C. Go figure.

I think the most interesting thing I found while looking for more information was this, though. What is that? That is the Wikipedia article describing the maiden flight of the Ariane 5, a rocket that was airborne for 37 seconds before an exception caused a vital part of the flight system to shut off. There are more details in the article, and this link will take you to the Wikipedia page describing, in further detail, what exceptions are and how the IEEE 754 Floating Point hardware standard played such a major part of that crash.

Thursday, September 3, 2015

Questions I ask Google, Episode 1

What is "foo"?


"The terms foobar (/ˈfuːbɑr/), fubar, or foo, bar, baz and qux (alternatively, quux) and sometimes norf and many others are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation. They have been used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept. The words themselves have no meaning in this usage. Foobar is sometimes used alone; foo, bar, and baz are sometimes used, when multiple entities are needed."

Wikipedia page source

Also, in the list of U.S. Government Military Acronyms:

FUBAR – Fucked Up Beyond All Recognition (or Repair)

How amusing!