Thursday, August 26, 2010

3rd party software is a gigantic pain

Third party software is a huge pain. We are using the new imaging software and I can build and run just fine but the rest of the office is hosed. This is all licensing based. I totally understand their need to make money. They only license the developer side, you can distribute all you like which is wonderful. So where is the problem?

We only have a couple of developers who will actually code against this third party library. Everyone else is working on other areas such a search, server communication, project support etc. They can't build and run the system without a license. You can't have a person casually contribute to the product.

Right now I am trying to get some code in place to check for a valid license and basically show them a blank area on the screen if they don't have a license. All the other developers will not be able to view any pages of an documents but will be able to do anything else they like with the system.

This will not affect QA as they will get a build from the nightly build box which will have the license allow the build to be distributed. This is not a long term solution, others need to be able to fully run the product to verify their work.

I really like this product, I just hate the pirates have ruined so many aspects of coding that I have to put up with a license system that makes sense for small shops where every touches the same areas of the code but not for larger places where people work in isolated small parts of a bigger system.

Monday, August 23, 2010

Have you ever won anything from a website or web survey?

I get a lot of e-mails to do surveys for various computer sites / web magazines. The promise of a $100 GC or maybe an iPad is always attached. I fill them out from time to time if I think I have any input on the subject at hand but I have never won anything. Some promise 10 or more people will win something. Has anyone ever won something off one of these deals? I would guess they have to be on the up and up but who sees the list of winners?

NewEgg at least will post the winners after a graphics card give away. I just want to win one so I can have a reason to upgrade the rest of my computer. "Sorry honey but I just won a $400 graphic card but I don't have the proper slot on my motherboard to use it, time to upgrade to take advantage of the free thing I got!"

I would also love to win an Android phone. Don't see contests for that. I have a Samsung phone that has a keyboard for text messages but the keys tend to double bounce and it does not auto start a new sentence after you hit SPACE twice like the BlackBerry did. I liked the BlackBerry keyboard, did not have issues with double letters or missed letters. Wife took over that phone. Don't do wireless contracts so I would have to buy an Android outright. They keep changing them around so I keep hesitating as I really want 2.2 OS at a minimum and I want a phone I can upgrade the OS on later. Hate to get locked down. One day I will pull the trigger.

Thursday, August 19, 2010

3rd party gets big quick

We have one 3rd party package right now for our C# project. It is 12.1m is size. The entire Java product is 7.5m in size. Ouch. This means without any support code, just a base library, we are already at almost double the size.

Part of the plan was to have the C# product on the Silverlight side be faster than the Java product. While I have always felt they will be similar in performance especially when most of the speed is related to data coming across the network, I now feel that things can easily be much slower if we have the initial download hit that becomes 4x the size of our Java product.

When I asked some buddies about this they stated they have never seem lean and mean C# libraries. Not sure why the code is not as tight, too much XAML? That should compress nicely but it is rather wordy.

Tuesday, August 17, 2010

How much 3rd party software should you use?

We program in three main languages: C++, Java and C#. The C++ project uses a number of third party controls and you hear a lot of complaints from that team about them. We get fixes from time to time and have to upgrade. Some items are never fixed and we just have to tell clients "That is just the way it is".

On the Java side we did our best to get 3rd party usage to a minimum. We use one for viewing images, so many formats to deal with it was just easier. We do run into bugs with them from time to time especially with threading issues. We used more controls at one point in time but I pretty much rewrote them from scratch so we have full control over how they paint and interact. I have written the following controls in Java for our product: Spinning hotdogs progress indicator, masked entry field, Checkbox list, font chooser dialog, color picker combobox, date selection combobox, Gradient panel, Link Label, Sizable toolbar (shows >> when buttons don't fit), Status view port (show status message when the table held is empty), Find panel (like those used in browsers), extended combobox with images and indenting support, spinbar, custom property grid with multiple level support.

That is a hodgepodge of stuff you probably would not find in a single collection of controls from another vendor which means you would have multiple JAR files and licences to deal with. Of course that list has grown over time and I have gotten pretty quick at writing controls. I have written them since the Win 3.0 days when it was one per DLL in C. Still they can be a bear to maintain and that is why there are companies out there that specialize in them instead of depending on one guy at their company to do the work in their spare project time. Since the C++ team already has a tool set any time the Java team needs one I just have to whip it up as part of my assigned task.

Now we are working on C# and we have to decide if we write our own or license some libraries. I really want to write our own as we have been bitten so many times in the past by 3rd party glitches but when you talk C# we have two areas: WPF and Silverlight. That could end up being a nightmare. It takes time to write them and it could mean we get a library to start and then write just the ones we use out of the library at a later time. Plus we are new to the language which slows you down even more. To make a lot of quick progress and get to demo stage we will probably have to go 3rd party. I hope it does not burn us too hard.

Thursday, August 12, 2010

Why don't developers care about warnings or code consistency?

Maybe I am just one of those oddball anal developers but I don't care for warnings in my code and I want all the code to be consistent. Consistent code makes it so much easier for another developer to start on a project. As we add more developers at work, and it could be that a number of them are straight out of college, we are getting a very lax attitude on programming.

When I first started here there were over 8,000 warnings in the code base I was assigned to work on. Over time I got that down to zero then turned on even more warnings in Eclipse until I was happy with how clean the code was and we have kept it at zero. New full time developers on the project have been told zero warnings are the normal and since there were zero warnings on the day they started what could they argue?

We have a standard set of warnings which is even easier to do now that Eclipse 3.6 is out and you can export that part of the workspace. I have a webpage with full screen shots of our warnings on the internal Wiki page. Takes a little time to set up but once you do you just keep in lock step with everyone else. If you start a project with no warnings then any warnings that appear are very obvious and usually very easy to fix. I did the hard work and cleaned them up, at least others could play nice and keep it that way. When there were piles of warnings they were easy to ignore, now there are not but people still seem to be able to ignore them.

The second piece of annoyance for the day is people who write new code and don't follow any of the patterns of the existing code. When we write a boolean to the server it is written as a string either "1" or "0". All of our code is i18n friendly but of course those two strings are not kept in a string table. We have a method to write a boolean value called sendBool(bool value) that writes the "1" or "0" as needed. So the developer does not use the helper method that is used by all the other messages but instead puts in the string with an if statement and does not flag the strings with  //$NON-NLS-1$ and thus the warnings.

Even after I sent a note about configuring Eclipse for the warnings and a code review stating you need to use the utility method all they did was use the comment to kill the warning. My code review was totally ignored. I know this is not the right thing to do but I just fixed the code myself. I still think there are other issues with the code that need to be raised so I will have to find a nice way to bring those up.

This has been repeating over and over as they add "casual" developers to the project. People that are not on the project full time but are "helping out" by changing a server message and the associated Java code. At this point they are not helping and for every one added to a project I go through the same steps over again even though I have sent out various development team wide emails on the issue. Easy to get ignored if your are not the architect or a manager I guess.

What is the stance on warnings in the code where you work?

Monday, August 9, 2010

Faking data from log files

Our C# server team is behind schedule. Without server data it is rather hard to get a whole lot of front end work in place. I was putting in little fake files and opening them and reading strings to simulate the server call. As I was just about to do that again I thought about how stupid it was to open the log file, tear out a snippet of data and copy it to temp file again and again. Why not just read directly from the log file?

With our system you can turn on logging. It logs out each request with parameters and response from the server in plain ASCII text. You don't get binary data for pages and thumbnails but that is such a small part of the server calls I am dealing with now I can get around it. I wrote our log parser that helps you diagnose the log file for problems so I had code to steal.

I wrote a Server Log Data provider that allows you to send a message to the server by rolling through the log file looking for the same message tag with the same parameter list and it will return you the data from the file. Works really slick and is allowing me to get various singleton caches in place with some real data.

You have to use our main clients and perform all the steps, such as opening an image and selecting annotations, that you want written to the log file. You can then replay that by making same server calls, in any order, into your C# code.

I say replay but it is not really a replay of the log file like some testing tools use. Did not want that as I have not set up the code to handle all the messages as of yet. Plus this is a request / response type system so just shoving data at the application does not make much sense.

I have even found some redundant data issues caused by our server. I am adding key = value pairs to a C# Dictionary collection. You can't add duplicates. The collections we use in Java and C++ just replace the value and don't really care if you use a duplicate key. C# throws an exception. This issue has been reported to the server team. If they fix the issue it will save bandwidth so this tool is already starting to pay for itself.