Dieting is not rocket science

Seriously. It is not that difficult. You eat less and exercise more. Let me say it again: You eat less and exercise more. That is it. No need for fancy and expensive methods. You do not need a personal trainer to lose weight. You do not need to understand everything about nutrition to lose weight. It might help, but is not required.

There is huge amounts of money in dieting. A lot of Top 50 books at amazon.com are about losing weight. All the home exercise machine infomercials fool people paying a lot of money for stuff that is not actually needed.

You do not need to know how much calories are in the food you eat. If you are putting on weight, you know that you eat too many calories. If you are losing weight, you consume more that you eat. Common sense also helps a lot. If the food is covered with fat, it probably contains a lot of calories. Buy a scale and eat same type of food the same amount every day for a week. You should know after the week, if you are eating too much.

However, people might know what they need to do to lose weight, but they are incapable of doing that and they try to find easier ways of losing weight without the hard work.

It is all about mental toughness. If you want to lose weight and decide to lose weight, just do it. After Christmas I decided that I will lose weight, because of all the chocolate, Christmas food, hamburgers, etc. January 1st I weighed 85 kg, two months later I weighed 79 kg.

All I did to lose weight was stop eating chocolate, French fries and dinner at Mickey D. I still eat four times a day, including a lot protein on every meal so that my muscles do not completely vaporise. I also do 20 minutes on the treadmill when I am at the gym. That’s it. No fancy tricks, no books, no personal trainers, no pills, nothing special. I even eat pizza for lunch once a week.

However, first part of losing the weight is dieting and the second part is keeping your weight down. If you go back to your old habits of putting on weight, the benefits of the diet will disappear pretty soon. To make the weight loss permanent, you should change something in your life for good. For example, switch to diet Coke, stop eating candy, or anything that will make you eat less calories or consume more.

  • Share/Bookmark

Why code lines still should not exceed 79 characters

I hate long code lines. I hate them with passion.

You might think that in the modern era of programming everybody has a big ass monitor with loads of horizontal space for the editor. Unfortunately you are wrong. What is the point of having a big monitor if you have to make the editor cover the whole screen? I have two 24-inch monitors, but I have one of them rotated 90 degrees, which makes the resolution 1200×1920. 1200 pixels is enough for a pretty wide editor window, but I always have two editor windows open side by side, which makes the editor windows 600×1920 pixels and that is about 2x79x120 in visible characters.

I am also old school and use terminal windows, which, as you can guess, are about 80 characters wide. It helps a lot if the code, does not wrap inside the terminal window when using version control commands from the terminal.

OK, so far the reasons have been pretty much about the environment and a lot of people have environments that support long lines easily. However, something that is universally bad about long lines is the way they affect the readability of code. Long lines make the code harder to read. If you have to turn your head when reading code, digesting the code will be much harder.

Code is read more often than it is written, so writing elegant code should be the goal of every single programmer. It is much easier to get a complete picture of the code, when the lines do not run forever. There is also a reason why books are shaped the way they are. Who would like to read a book that has lines over 150 characters long?

People post questions to stackoverflow.com and sometimes include source code related to their questions, which is really useful. However, the code window is only 79 characters wide and there will be a horizontal scroll bar, when the code does not fit in the window. That is really annoying. Trying to figure out what is happening in the code when you cannot see full lines of the code is really hard. I am not blaming stackoverflow.com, but I am blaming the programmers, who post sample code that have long lines.

Sometimes code needs to be printed. Not that often, but there are good reasons to do that. If code looks like crap on screen, it will look even worse on paper especially with those long lines wrapped in the printed version.

Every time I see long lines, my respect for the author of the code drops a little. I do not think there are any excuses for writing long lines. Every programming language I have used supports splitting code to multiple lines. Some languages do it better than others, but the language is not the problem.

The problem might be the editors that most people use to write code. Usually when I see long lines, the code has been written in either Visual Studio, Eclipse or Xcode. People that use those IDEs have their environment full-screen, which makes the editor window quite wide. The template code that IDE will generate is usually terrible and people just copy ‘n paste that crap. Editors also indent lines differently when you split them, or do not have automatic indentation support for lines that where split. This might cause the writer of the code to avoid splitting, because it will require pressing the tab 6 times to get to the correct indentation point. Configure your editor to do this for you. (Or even better, use a real editor)

  • Share/Bookmark

What's with the DWORDs

If don’t know what a DWORD is, good. This is quite geeky so don’t read any further, unless you want to know what wrong with DWORDs.

If you have ever taken a look at windows.h, you know what I am talking about. For some reason Microsoft decided that they need to define every single type themselves, because the original types did not shout enough. VOID is clearly a lot better than void, but what the hell is the reasoning behind LPCSTR? It looks like vomit. I don’t want that my code looks like shouting vomit. What the hell is wrong with ‘const char *’?

The big problem is not that Microsoft re-invented types with this stupid system, but it is a big problem that some so-called professional programmers actually use those wonderful types in code that should be cross-platform. When they realize that their code needs to work on something else than their beloved Windows, they make nice typedefs for linux and others. Only problem here is that everybody has their own idea what DWORD should be defined. This is where the fun starts. There are situations where you might need to include to different headers files, but both of those header files define DWORD differently. Nice.

  • Share/Bookmark

Master of Speed Lite

Test your quickness and memory skills with this awesome game.

In speed mode you need to keep up with the flashing buttons as they flash faster and faster.

In memory mode you need to remember the sequence the buttons flashed. As the game goes on you need to remember longer and longer sequences.

This game is a modified and improved version of the classic game that was featured in Finnish TV show, Speden Spelit.

The Lite version has limited gameplay. Buy the full version to get unlimited gameplay.

Price: Free

View in App Store

  • Share/Bookmark

Master of Speed

Test your quickness and memory skills with this awesome game.

In speed mode you need to keep up with the flashing buttons as they flash faster and faster.

In memory mode you need to remember the sequence the buttons flashed. As the game goes on you need to remember longer and longer sequences.

This game is a modified and improved version of the classic game that was featured in Finnish TV show, Speden Spelit.

Price: 0.79€/$0.99

View in App Store

  • Share/Bookmark

Office Space Out

Don’t feel like working? Feel like spacing out? Want to surf the web or sleep without interruptions at the office?

Use “Office Space Out” to play keyboard typing sounds and fool you boss into thinking you are the hardest working person in the company.

Two different types of keyboard sounds to choose from.

Price: Free

View in App Store

  • Share/Bookmark