Saturday, September 10, 2011

Our C++ Economy

I stumbled upon a post today and I just have to share it for any computer programmers out there.

But before I do, let me offer my opinion of the C++ programming language. I love it and I do not know what I would have done without it.

C++

C++ is one of the most popular programming languages with application domains including systems software (such as Microsoft Windows), application software, device drivers, embedded software, high-performance server and client applications, and entertainment software such as video games.

C++ is designed to give the programmer choice, even if this makes it possible for the programmer to choose incorrectly.

In the right hands, C++ can be a wonderful tool. It allows one to gather one's thoughts in small manageable pieces and build those pieces into a large complex structured system.

In the wrong hands, C++ will give a person more than enough rope to hang.

So that being said, I'll leave it for you to decide if the following hands were the right hands.

February 20, 2009
I hate C++

I had my Computer exam today and we had 2 1/2 hours to write a monster program and I finished mine in an hour and a half but the stupid thing was giving me errors and I couldn't figure out what the error was because the dumb program was running but it was giving me four zeros as the output and it was so bloody frustrating and I was soo irritated and I went through my code step by step like 400 times but I couldn't find the damn error.

That's just one sentence. Take a breath.

And then I felt like crying cause I was so frustrated and I didn't know what to do.

You need to take a very deep breath now. Trust me on this. You'll need it.

So I considered giving up but my computer teacher said he wouldn't let me go home until I fixed that program because he had very high expectations and everyone else finished and walked off and he delayed the next batch of people coming in because he said I needed to fix the error so I sat there trying to fix the error and then I thought I had found the solution so I changed the code but all that changed was the dumb program gave me five zeros instead of four zeros and my only consolation was that the five zeros were very neatly presented and so again I had to trawl through my code to find my mistake and I thought the dumb compiler was messed up because by that time I had gone through my code a thousand times and I went through it again before asking my teacher if he could grade me on what I'd written but he said no and he made me sit down again and I was so sad.

All that information was packed into just one sentence. Note that the "and" to "." ratio is 10 to 1. Amazing.

I'm really not trying to be mean here or pick on this individual. Ben Bernanke thinks we just need to work smarter. I'm simply questioning whether the average American can work smarter than the average worker if every worker gets a college degree.

26 comments:

Audrey said...

Nice post.
Once you start looking for the impact of accelerating automation, it's everywhere.
A retired stonemason I know used paper house plans to figure out how much stone was needed to put rock on a house - with paper and a calculator.
His successor now uses electronic plans and computer software.
It is faster and more efficient and I don't think he could do it by hand anymore.
The implications (as your Physics of Jobs Lost post shows) horrify me but don't seem to bother anyone else that is involved.

Stagflationary Mark said...

Audrey,

The implications (as your Physics of Jobs Lost post shows) horrify me but don't seem to bother anyone else that is involved.

I think most tend to extrapolate linearly. They point to the loom as proof that automation and technology always help the workers (by always making their jobs easier).

I tend to be a bit more cynical.

The Arthurian said...

Hi Mark

"Ben Bernanke thinks we just need to work smarter."

Ah, but the problem is not dumb workers all over the country. The problem is dumb workers who make dumb economic policy.

Stagflationary Mark said...

Check out Itron.

Stagflationary Mark said...

The Arthurian,

Surely Ben "There is no housing bubble to go bust" Bernanke is smarter than the average worker though. He's got a PhD in economics! ;)

Mr Slippery said...

Game programming (commercially) is an intense job, one that I never wanted to do. I always preferred the leisurely pace of business applications.

I worked with an ex-game programmer in the 90s who had burned out by 30. He has some tales to tell. He only wanted to use C, not C++. I remember the various flavors of C++ in the 90s were quite different. Remember Borland?

I do almost everything these days in Ruby (RoR) and could not be happier. It is so elegant and pretty, no snarl of curly braces and semicolons.

The manufacturing flight path is bad news for America because not everyone can be a programmer. Half of the population is below average, and without manufacturing, they are left with low paying "fried with that" jobs.

fried said...

"The manufacturing flight path is bad news for America because not everyone can be a programmer. Half of the population is below average, and without manufacturing, they are left with low paying "fried with that" jobs."

Yes and yes again. I would like to mention that those "below average folks" built this country, her roads and bridges, fought her wars, raised their kids to do the same, and largely try to play by the rules.
Whether they are intellectually movtivated or not, they can fix my car, they show up to resurrect the wires when the storms blow them down, grow food and drive the trucks to deliver it.
To paraphrase Pogo, they is us.

Stagflationary Mark said...

Mr Slippery,

I was a Mac programmer when I started that gaming career.

Not only did we have to get it to work under one C++ compiler, but it had to run under two (Mac and PC).

On the one hand, it could have been a nightmare.

On the other hand, since it had to work under two compilers the finished code tended to be very stable. Each platform had an extra chance of spotting bugs in the other platform's code.

Stagflationary Mark said...

Here's how my computer gaming career began.

When I started there was a product that was almost complete and my job was to complete it. Talk about daunting! The first thing I did was start it up on all the computers and let it run overnight (just idling, not really playing). I was asked why I was doing it and I said I wanted to know the state of the code. Were there any glaring memory leaks? The Mac was so unforgiving. When memory runs out (or gets fragmented), things die. So how did the program do? ALL of the computers had crashed when I came in the next day.

That said, I would rate the programmer before me as above average. He made one critical mistake as a Mac programmer though. The Mac's memory management was based on handles (pointers to pointers). The programmer did not realize that memory can move if the operating system wishes it.

Handle -> Pointer -> Memory

He was storing the pointer not realizing that it could be changed. This made the entire game extremely unstable, and randomly so. It would crash in a different spot nearly every time. Sigh.

Here's why he was still an above average programmer. His code was clean and relatively easy to follow. He used a consistent naming structure for his pointers so they were fairly easy to track down and fix when I saw the problem. Whew!

His only other major problem was a lack of understanding of graphics programming on the Mac. I found that out within the first week as well. The following comment in the graphics code was left for me and it is something I will never forget.

"If I had the right font, I'd draw a pentagram here."

LOL! He meant it too!

At that time, I too was not much of a graphics programmer. I just didn't have much experience with it at that time. It was sort of terrifying, not so much because I felt I could not learn. It was because I was under a lot of time pressure.

I was not hired to be the lead programmer but for all practical purposes I was. They never did hire a lead above me.

They tried once. We went out to lunch with a prospective lead programmer. Both the designer and myself were rather unimpressed. I was asked what I thought and I told them that I would pass. They passed. Much to my surprise, they never tried again. I just kept working and about 2 products later they officially made me the lead.

So here's a great rule if you want to advance. Fire your future boss. It can be a bit tricky to do, but I guess it is possible, lol.

And to be perfectly honest, I didn't really want to advance at that time. I didn't think I was ready to take on that much responsibility. I would have been more than happy not being the lead, especially that first week!

Stagflationary Mark said...

The moral of the story...

There aren't going to be enough jobs for tens of millions of average programmers.

If working smart means that we'll all become computer programmers, then we are all going to be extremely disappointed.

tj and the bear said...

It is faster and more efficient and I don't think he could do it by hand anymore.

The implications (as your Physics of Jobs Lost post shows) horrify me but don't seem to bother anyone else that is involved.


Me too. When the (first) Great Depression hit people had basic skills, whereas a majority these days couldn't thread a needle. The government hadn't yet made everyone dependent upon them, too. WASS.

Stagflationary Mark said...

tj and the bear,

We've lost basic skills but we gained basic cable! What could possibly go wrong? ;)

Audrey said...

Who needs a shirt when you have Spongebob Squarepants and China?

Stagflationary Mark said...

Audrey,

SpongeBob Square Pants in China!

Anonymous said...

I think you've got this one wrong. C++ is great for genius programmers. It sucks for more average people.

But we can't all be genius programmers, and average people can create value when working with computers, if given the right toolkit. So there's an opportunity to create better tools.

The problem with our economy isn't that we have fewer manufacturing jobs, it's that too many geniuses are wasting their lives trading inherently worthless paper financial products, instead of coming up with new ways to put our deep labor pool back to work making life better for us all in the real world. The labor pool wants to work but the innovative capitalists are either AWOL or blocked by monopolists from being able to do anything.

Stagflationary Mark said...

Anonymous,

C++ is great for genius programmers. It sucks for more average people.

Agreed.

But we can't all be genius programmers, and average people can create value when working with computers, if given the right toolkit. So there's an opportunity to create better tools.

Perhaps you are right, but as a lead engineer in the computer game industry I will say this. I'd take one genius programmer over 10 mediocre ones (and if I had my way I'd pay him/her accordingly). Perhaps I'm a bit of an idealist, but writing software is a bit like writing a book to me.

Put another way, if I was a publisher I'd be looking for one William Shakespeare over a group of mediocre authors (attempting to work together to make a masterpiece).

The problem with our economy isn't that we have fewer manufacturing jobs, it's that too many geniuses are wasting their lives trading inherently worthless paper financial products, instead of coming up with new ways to put our deep labor pool back to work making life better for us all in the real world.

I do agree wholeheartedly that the brightest have seemingly flocked to where the money was. If the money was made gambling in the Wall Street casino, then that's where they went. And as you point out, what good did that really do any of us? What a complete waste of resources. Just how many more MBAs does this country really need?

When I was entering college a relative of mine asked me what I planned to study. I said computer science. He wanted to know why I would want to do that. Programmers are a dime a dozen.

Isn't that telling? I had a love of computer games though. I did not heed his advice. If I had it all to do over again, I still would have been a computer programmer.

I think that's a key here. I don't think the average worker has a love of computer programming. In a perfect world (far from the one we have), workers should love their work. Good luck on that one. Sigh.

Stagflationary Mark said...

My girlfriend has an English Literature degree. There wasn't a lot of workplace demand for a degree like that. Go figure.

She fell into human resources as a career. For a variety of reasons, she didn't enjoy it all that much.

I do not think she would make a good computer programmer. However, she doesn't need to be.

She's starting over again with the intent of becoming a nurse. She's a 4.0 student so far and I think it is going to be something she really loves to do.

She's going to need to love it. I expect intense competition as more and more people join her for economic reasons. I suspect many people have and will enter that field simply because they can't find job opportunities elsewhere.

Those that love the work should survive though. Those who do it just for the money probably won't. I'm picturing that Quincy moment.

Quincy, M.E. TV Show

(Jack Klugman as Quincy speaks to a group of police cadets next to a corpse on an autopsy table.)

"Gentlemen you are about to enter the most fascinating field of medical science. The world of forensic medicine."

(Quincy then pulls back the sheet exposing the corpse, and one after another, the police cadets faint or run out of the room.)


For what it is worth, I certainly do not think I have what it takes to be a doctor or a nurse.

Anonymous said...

fried,

"...those "below average folks" built this country, her roads and bridges, fought her wars, raised their kids to do the same, and largely try to play by the rules.

Whether they are intellectually movtivated or not, they can fix my car, they show up to resurrect the wires when the storms blow them down, grow food and drive the trucks to deliver it."


Thank you,

Stagflationary Mark said...

Anonymous (& fried),

For what it is worth, I value the work that main street offers far more than the work that Wall Street offers.

fried already knows this based on previous posts no doubt, but I realize that people just wandering in might not.

Stagflationary Mark said...

I think my main point here is that Bernanke thinks we all just need to work smarter. That will somehow rescue our economy.

I don't see how we are going to need 140+ million PhDs in the distant future. What are they all going to do for work? What are they all going to do to pay off their college debt?

These are the things that keep me up at night.

In the past, one could have a fairly good job without a college degree (and the debt that often goes with it).

fried said...

fried already knows this based on previous posts no doubt, but I realize that people just wandering in might not.

Indeed I do, but having the value of being "smart" pounded into me from childhood, it is only as an adult that I have truly learned to value the efforts of people in all sorts of jobs that collectively make life possible.

Anonymous said...

Fried, I hear you. I happen to have a Ph.D. and I am perpetually frustrated to see my fellow scientists treating their "support staff" like dirt. The people who make the labs go are gifted in ways that the Ph.D.s can't even see, and yet when the equipment all comes together and works flawlessly, the Ph.D. takes credit like it was nothing. I was raised differently - my father ran a small business, built a solid team and took care of them. The core team is still working together 30 years and multiple "owners" later.

Mark, you wrote "Put another way, if I was a publisher I'd be looking for one William Shakespeare over a group of mediocre authors (attempting to work together to make a masterpiece)."

I agree, for gaming that is essential. But a lot of computer-based work in an R&D environment is far more mundane, and won't attract geniuses no matter what. Yet it needs to be done, and the people involved lose tremendous amounts of productivity today because their tools remain inadequate to efficiently address the problems they face. Put it back into the writing metaphor -- I wouldn't want to live without Romeo and Juliet, but I'd also like to have well-written textbooks and technical manuals!

Stagflationary Mark said...

Anonymous,

To back your point...

Several teams once lost man-months of work due to a server crash. All it would have taken was one person doing a daily "mundane" backup task to prevent it. My team was spared since we did not rely on centralized servers, but we would not have been spared if the building burned.

In my opinion, well-written textbooks and technical manuals require their own level of genius. I do not take them for granted. Generally speaking, I found Apple's tech manuals a godsend in the early days. They made my life SO much easier.

Stagflationary Mark said...

fried,

I know this sounds kind of funny, but one reason I am willing to hoard toilet paper is because I'd really dislike digging ditches for a living to pay for it. That's seriously hard work.

I think people take too much for granted. I try to value all the little things. Times are not guaranteed to stay good (especially if the last decade is any indicator).

Mr Slippery said...

I'm a little late, but there is so much good programmer stuff here, it deserves another comment.

Mark, great stories about Mac and game programming. Ha, pointers are one reason I didn't like C++, too much room for error. How do you like my array of handles to arrays of pointers to jump tables? I've seen too many people try to be too clever and leave a mess for me to sort. I am not a genius programmer, but above average I think. I've met genius programmers and seen their code. I can't match it. What I can do is write reliable, easily maintained code and I am good at gluing together pieces of genius code ;) I am good in a hive of programmers, just not the queen bee.

I'd take one genius programmer over 10 mediocre ones

Completely agree.

Here is a bonus thought (conceit) on economics, finance, and programmers. Programmers might be able to understand economics better than MBAs because they can grasp complex, abstract systems better. An economy is a complex, abstract system.

Stagflationary Mark said...

Mr Slippery,

What I can do is write reliable, easily maintained code...

I learned object oriented programming in Object Pascal.

I wrote C++ much like an Object Pascal programmer would. I don't try to get cute.

In the wrong hands, the power to maximize cuteness is amazing though.

Obfuscated C++

Merry @#$%in' Christmas! ;)