Showing posts with label examples. Show all posts
Showing posts with label examples. Show all posts

Friday, October 26, 2018

We Learn by Doing

Thursday I spent the afternoon in a First Aid, CPR, and AED class. My office provided it free of charge to those of us willing to take the time to get trained and certified. This is something I try to do every couple of years but had let my certification lapse. One important thing I took away from the course is the importance of practice.

CPR is one of those skills that everyone should know but nobody should ever want to have to use. I have a close friend who had to use it on a work associate. Things worked out and the person survived. My buddy went to visit him in the hospital and apologized for breaking the guy's ribs. The survivor didn't mind as being alive sure beats being dead.

I have practiced CPR on a purpose built dummy but it is always good to get a refresher. Everyone in my class on Thursday had his or her own practice dummy and we all simulated giving CPR at the same time. While it is not the same as doing it on a real person, it is a lot better than simply talking about the procedure.

So what does this have to do with computers and technology? Lots. I am currently going through a book on Reinforcement Learning (a sub-topic of Machine Learning) and there are a lot of examples in it. Rather than simply reading about the process, it is important to work with a computer at the same time I am going through the book. Practicing what I read is really vital to my understanding of the topic. So if you find yourself trying to learn a new technology, don't just read about it, practice using it and you will learn more in the process.

Friday, June 24, 2011

I Hate Foo Bar

The other day I was reading through a computer coding example and was confused by the words "foo" and "bar." I'm not sure how those two words crept into our vocabulary, but they are fairly ubiquitous and I don't like them. I know they are two words that don't really mean anything and are meant to be placeholders for other information, but I wish authors would stop using them.

If I was to write an example SQL query and wanted to use foo bar, it would look like this:

SELECT foo
FROM bar
WHERE gobblygook = 'more gobblygook';

While it is an example that shows the proper syntax of a SQL query, it is not nearly as easy to understand as the following:

SELECT employee_names
FROM employee_table
WHERE salary > 100000;

I don't have to translate that "foo" could also be something concrete like an employee name or that "bar" represents a table of employees. Simply by using examples that everyone can understand greatly improves readability and makes things much easier to understand.

In this age where everyone can be a published author (like with this blog) and you find yourself creating examples. Don't use "foo" or "bar." Instead, use real words that everyone will understand, even if they are just supposed to be placeholder words. Oh, and don't use "gobblygook" either.