Categories
Software development

Compuware: first look

Reading Time: < 1 minute

(Update 06-11-09) Upon second look, sold the stock.

Compuware Logo pic by Wikipedia

Got some Compuware (Nasdaq: CPWR) shares last week in my SogoTrade account (for speculation purpose). I used their DevPartner products (integrated with Visual Studio, sold to MicroFocus lately, see news below) for memory debugging and performance tuning. Very impressed by their products from my experience. It can catch some unexpected memory error (sometimes introduced inadvertently due to time constraints in development).

Categories
Software development

Increamental Development

Reading Time: < 1 minute

Friday afternoon, 4 PM, finanlly I made things working: I mean the program compiled and ran at the first time. So what did I do? I found there are some minor problems here and there, and I decided to correct them. Off I went to make those “important” changes. By 5 PM I completed the changes and now the code stopped compiling and to make things worse, I promised to my boss to give him/her a demo on Monday morning! Why would I put myself into this kind of situtation? Or don’t we all have those kinds of situation in our development life?

Categories
Fun Software development

Write Software not Novel

Reading Time: 2 minutes

When I was taking my first C++ class at graduate school, the professor has a favorite word “you guys should write a program that works, because if it does not work, you are writing a novel not a program”. Although I did wrote “novels” in one of his program assignments, I remembered his words since then, certainly this include my professional life. Writing software that works is not easy, but it’s a goal every developer should strive for.

Assume we are just writing a very simple C++ program (remember the “hello world”), bacially there are two kinds of obstacles or errors we will face. The first is the compile error. Today I fought all day for this kind of error. Most of times compile errors are easy to solve, because the compiler will give you some hints: such as forgetting the semicolumn; variable name does not match (typos); other simple things etc. But sometimes things can get really tricky. I remember one day my coworker came over for help. I went to his cube and we tried to figure out why things do not compile. I looked at the error message from compiler, which is pretty much useless.  So we had to guess and tried different approaches without success. About one hour later, I suddenly found out there is an extra “^H” at the beginning of a header file. Binggo. That solved the problem.

This afternoon I had similar problem, I had to compile some code written by my coworker, which has not been compiled before. This is kind of thing we programmers don’t like to do: deal with other people’s devil. I was puzzled by the compile error for about 3 hours: it was  complaining the std::vector not defined properly. Finally I found out my coworker put some header file inside the class (and another namespace), which is a bit unusal and it caused the conflict of vector. I will talk about the other type of error later on. Hint: compile error is relatively straightforward compared to the other error 🙁

Categories
Software development

Dumb C++ Mistakes

Reading Time: < 1 minute

It seems like I don’t have anything to do with C++ because I have not touched C++ much in this blog. I am a software engineer by trade; programming and debugging is a large part of what I do during the day. I was a little frustrated last two days by a memory problem shown only on UNIX. The program ran fine on Windows, except one or two instances slightly weird results which I tend to ignore. But I could not pass the UNIX test and obviously something is wrong. By looking at the trace back I can tell it’s a memory problem. Memory problem is kind of problem everyone hates. Because it’s usually hard to find the root cause. Dev Partner made the process a little easier because it will show all potential memory overrun and leaks. To my surprise, I made a mistake like the following (very basic C++ mistakes):

char *temp_str = new char[length]; 

for(int ii = 0; ii < length*2; ii++){     // do something with temp_str[ii] } It is a typical memory overrun problem because I only allocate "length" number of char, but I was trying to use "length*2" number of char. It's like use twice the credit limit? But I am still very puzzlled that my program ran on Windows (without Dev Parter) before the fix. No wonder we see "Windows crash" from time to time :-) Seriously, in software development we want the problems being uncovered the earlier, the better. Because we don't want our customer run our program and crash.

Categories
Career Software development

Working with gurus

Reading Time: 2 minutes

From time to time I had the oppertunity to work with gurus, I mean, the expert, or the genius in the field. I think I enjoyed my time spent with them from time to time. Although I had to admit those days were not easy 🙁

In the second year of my graduate school, I took a course from a very well known professor (known for his toughness). He will assign homework as he lectures. Because at that time my English and course knowledge were not very good, I had to pay close attention to his lecture so that I won’t misunderstand the homework. His homework is not easy, to say the least. First I had to spend time to figure out the questions being asked. I think I went to his office almost every time. Besides understanding his problem, the solution is not straightforward either. I remembered sometime I had to work on the solutions until his class begins (which is the deadline for the homework). The most scary part is his test: stuffed with questions with long answers, lots of math. I remember I got a 30s score in the first test, partly due to my misunderstanding of the question: I started working on it before fully understand the question because of time constraint. To my surprise, one of my classmate, who got my help for almost every assignment, got a better score. But I worked hard. At the end of semester I did got “A” for that class. I think my attitude (not my score) impressed the professor.

In the same semester I also had an oppertunity to work with another guru for research. This was the beginning of my graduate research. We had a few short deadlines to meet. I worked hard during that time, sometimes sleep in the office, to make the computation results available before each group meeting, during which the guru will take a quick look, determines what makes sense, what does not, and giving a few encouraging words. I admired both his technical and business skills.

Nowadays in my work place I also meet gurus from time to time, sometimes even work with them. It is always a pleasure to work with gurus, because they know the stuff and can explain difficult things in simple terms. They are also inspirational most times.

Categories
China Software development

English problem

Reading Time: < 1 minute

I saw the following from Joel on Software . I had some hard time trying to understand it. Is he looking to be a distributor of foreign software company? Or he is interested in doing outsourcing work for foreign companies?

I am thinking, this English problem (if typical among Chinese software industry), does present oppertunities.

===========================
Title “anyone can give me dealership?”

I have an own software inc. in Beijing, China.

but my fire is small and not have self-software.

my friends tell me that I can find a foreign software fire and dealership.

who can tell me how to do it?

my email is blah blah blah

note: in my information’s homepage is not my fire’s. it’s only a sharesoft of mine.
=========================

Categories
Software development Windows

Left hand mouse and UNIX

Reading Time: < 1 minute

I started to use left hand for mouse last week because my right hand did not feel well: being a programmer, I had too many mouse clicks for my job. One of my coworker hurt his right hand permanently so I decided to be more careful. Initially I felt it a bit awkward but I am doing OK now (this is the second week).

The real job is much tough. I had to do lots of work on UNIX. Don’t get me wrong. I am a fan of UNIX and I think I have decent skills on UNIX. It’s just in the past few years I almost used Windows exclusively. Now I felt a bit wield coming back. As I read “Joel on Software” recently I agree with Joel said: Windows is designed for everyday user; UNIX is for the programmer. The mind set of two systems are so different and I need to adjust. Different compilers on different UNIX systems, different debuggers, and different problems: compile error, run time error(bad results or crash). I think that may be one of the reasons that UNIX is losing market share in applications (in addition to higher hardware cost compared to Intel). I don’t know how the new generation programmers are taught in school. Are they using MS Visual Studio IDE for C++ class or gcc/gdb on Linux? The latter is much harder to use and debug; it’s all command line. Years ago I heard there is this thing called “KDevelop” Linux C++ IDE but I have not used it. Personally I do believe it’s important for programmers to know both IDE and command line, because IDE is not always available.

Categories
Business Software development

Open source millionaires

Reading Time: 2 minutes

There is a little piece of news in the software industry caught my attention this week. Red Hat, one of the biggest open source solution provider decided to buy JBoss, a not so well known open source middleware (application server) softare developer, for USD 350 million. I read an article on Business week about JBoss’s CEO Marc Fleury and “how he got here” last week. Because I did not find the BW article, I put a similar article on eWeek here, this one is interview. Quote Marc’s word “I have said many times that I want to create a new generation of open-source millionaires.” I think his word is true to a great extent because his company is mainly owned by founders and employees.

Categories
Software development

C++ Training

Reading Time: < 1 minute

I attended C++ training course at my work place last week. This is good for me because I did not feel well last week ( I got cold and headache): I can stay away from real coding during all these madness.

Seriously, I did not find the C++ course to be any easier than the work. The fun starts with “Pair programming” and “Test driven development (TDD)”. We had many excercises during the class. Basically we need to work in pairs and make sure our little program pass the test. I happened to work with my two coworkers doing the exercises, which I mentioned in my previous post here and here. Although they have been doing development using C (procedural language) most of their career, I was impressed by their helpful insights working on the exercises . Smart developers can learn things quickly and apply the existing knowledge to new things. I think that’s one reason our products are leading the industry and market most of the time.

Besides C++ language features, I found the testing driven development to be useful. Actually I had to fix two problems in my real code. I created those problems when I added new features to the code. The cause of problem one was that I did not run all the test cases. Problem two was not covered by the test cases at all: somebody outside my team found the problem and reported it, to my embarrassment. I did fix the problem (I think) shortly after.

But the most important of all, is I know how to prevent those kinds of incidents in the future.

Categories
Software development

Don’t step on my toe

Reading Time: 2 minutes

I have been a nice guy most of time, in my work and outside of work. But I have done something pretty bad this week. I am talking about programming. I made two mistakes.

First I checked in code to the source control system and forgot to put in some compile flags. Without these flags my teamates will have compile errors. Bad bad bad. In C/C++ programming world, the first thing we learn is to make sure the code compiles. I remember my C++ instructor at Rolla once said “if a program does not compile or run as designed, it’s not a program, it’s a novel”. In this case although I did compile it successfuly in my own project, I forgot the impact of my changes to the team (group). Note other peoeple in the team are using same piece of the code. The good thing the mistake itself does not cause any serious consequence and it was easy to fix.