Hard Core Challenge
Then I figure if I am record all these operations, wouldn't my recorder itself be using up a bunch of resources during that second? So in essence, I might be records the operations of my recorder itself. Sounds like the movie Inception.
I do like a good challenge. Let's see if I can even get a good start on this task. I have already emailed a C programming hacker to see what he thinks about the challenge. He is a Knuth fan, so that might help with the cause.
Data Wrappers
Now I found all the information I needed to pass across DLLs. These natrually became paramters to the interface function. This is a C language interface. So I made sure the types were known to C. All good right? Well I looked around and found the other DLL entry points wrapped all the paramters up into a structure.
I guess this is some kind of object oriented C. But what is the benefit? You pass a pointer to a structure. Then the code that gets called needs to dig into that structure to extract the paramters. I don't think we are gaining much here. Sometimes you have to ask yourself why?
Tool Upgrade
Here are the tools we changed during this pass. Moved up to the Oracle 11g client. Upgraded to Microsoft Visual Studio 2008. Jumped up to Installshield version 18. Also grabbed a recent copy of the Objective Toolkit. Ouch. Everything is changing.
The first pain was that the new Installshield was so much newer than our ancient copy, we had to write the install scripts from scratch. That was a quick weekend hack that just did not work. I spent a lot of time reverse engineering the pieces of the install that were missing from our rewrite.
Next we had some pain from Visual Studio. Installing the runtimes was not as simple as dropping some DLLs in our application directory. Turns out we either need to run the Microsoft installer, or use the support supplied from Installshield. Growing pains really hurt.
The third party tool upgrade required some work. There was some disturbia initially when the developers could not quickly figure out how to build the third party components. We had to do some due diligence to figure out how to build the darn thing. Once that was solved, we quickly figured out how to use the components and deploy the minimal set of third party runtimes.
I am just happy that I only spent about a month or so dealing with all the upgrade problems. Another developer took over and spent an additional month or two working through the problems.
Hard Coded
I got called to an emergency meeting this week. The configuration data in our production system was not correct. There were some missing values. That called all the data into question. There were a bunch of questions about some values of suspect nature.I waited for a while. The guilty parties did not speak up. So I piped up that development did not have time to be thorough with some late development. I knew because I got called in at the last minute to help the developer figure out what the module was doing.
So the developer hard coded all values this time around. It appears he also left a remnant of the configuration data in the database. However this data was unused. Therefore the values in the config table did not matter. A manager was upset that he was not in the loop about these decisions.
Finally the developer who did the dirty work did pipe up. He said that all his decisions were peer reviewed by managers. Everything was written out and reviewed. I guess that really means the manager approved something he did not comprehend. Next time pay attention man.
I was tasked with putting together a plan to get us out of this mess. First step was to get the needed production configuration values out there and verified. Next we will need the developer to spend the time to use config parameters to drive the module. We will need a lot of such parameters. Then we will need to document all this stuff.
I like to be conservative. So I propsed we implement this is the next major release. And when we do roll this thing out, I will grab all the managers and explain the ramifications of everything we are doing. Luckily it is easier to explain that we are doing things the right way finally.
Information Hiding
We have a lot of stored procedures in our system. They are pretty much bunbled together in packages. Since our database is Oracle, the packages had a specification and a body. The spec is the view of exported procedures to the outside world. While the body contains the implementation along with internal helper functions.This is a pretty good setup. You only see procedures you can use in the spec. Details are hidden away in the body. You would think this is some good design. Well most of our job consists of identifying and correcting bugs in the software. This is difficult when the bug is in a stored procedure housed in a package. Many bugs only show up in production. That version of the code is secured very tightly.
Often times we need to run the code and output some debug statements. Usually we will extract the portion of code that is in question into a stand alone script. This is easy if the code extracted does not reference other private functions in the body. But if it does, you got a lot more work to do during extraction.
I often find myself making a lot more visible in the spec than I immediately need. This is because I anticipate the need to make a call to some of the helper functions from the outside for testing or debugging purposes. However that defeats the whole purpose of information hiding in the first place. It is almost a catch 22.
Artificial Intelligence on the Sports Scene
There is a startup called Statsheet that is doing sports coverage for Division I basketball teams. The surprising thing is that the updates are all done by Artificial Intelligence. However the come out looking like they are written by a human being.The project is around 6 months old. A program takes box score data and turns it into text that is looks just like a human wrote it. I tell you some samples I saw were amazing.
Great. Just when the reporting industry is about to go out of business, RoboReporter comes and put the nails on the coffin. There is a benefit. Even no name basketball teams are going to get great coverage. At least mom will be happy when she reads the report on Junior's basketball win.
Learning how to Code
How do you learn to be a good coder? Well you can get somebody else's code and hack it. That's how I started learning. You can also dive into someone else's unit tests to figure out what they are doing.It is best to inspect a small project's code. That way you will not get overwhelmed or lost. Check out code from dudes who are gurus at software. You should also look at the source for any libs you use. Trace down what happens when you make API calls.
Reading other people's code is an easy way to learn what to do when you code yourself. However the very best way to learn coding is to just do it. There are many apps waiting to be written. What are you waiting for?
MultiCore Design
Virtualization let's you scale applications on multiple processors. This allows multiple nodes to run in parallel, giving you a performance gain. You might have 10 times as many instances of your application running. This is easy to set up, but might not be optimal speed wise. It works best if there are a small number of dependencies in your application.
The problem with this technique is that hardware is no longer getting exponential increases in power and capacity. Therefore you would be better off designing your applications for the multicore processors out there. Normally this means using a threading model which might be complicated. You can cheat a little by using a thread pool with a bunch of worker threads.
There is not usually a need to entirely rewrite your applications to make them support multicore. You got to put some synchronization. And you must make sure race conditions and deadlocks do not occur in your code. Model driven development can help with this task. Refactor your apps for multicore usage, and you will see a big gain in performance.
Software Engineering Method and Theory
There are a bunch of industry veteran trying to discern the universal truths of software development. They have formed the Software Engineering Method and Theory group. It is called SEMAT for short. Some industry luminaries like Ivan Jacobson, Bertrand Meyer, and Larry Constantine are involved.
This group wants to investigate the core theories and best practices in the development world. They state that this group is not about any specific product of standard. They are attempting to uncover the universal set of practices that occur in software development.
SEMAT has broken out six working groups. These include terminology, kernel language, universals, core theory, requirements, and assessment. The group reiterates that it is no looking to create a new development methodology. Instead they are defining software development patterns and practices.
There are some who have their doubts about this effort. Universities lag the industry in practice. It make take many years for the work of this group to bear fruit. This is a theoretical exercise. There may not be any impact to real world development. Something like this was tried before with the Agile Manifesto.
Self Repairing Code
Researched at MIT and the University of Washington are working on software code that repairs itself. You heard that right. This technology is called ClearView. It requires no human intervention.The new technology knows and understands the normal behavior for software. When it detects some problems, it comes up with multiple options for the fix, and chooses the best one.
This is supposed to be a good way to combat hacking. I guess you could think of it as some type of intelligent system. Self healing code makes for a good headline. However I can't imagine this working for anything but the most simplest of bug fixes. There are plenty more categories where you need an old fashioned maintenance programmer.
How Does printf Work?
The truth of the matter is that it depends on the implementation of your compiler. Hostile Fork guy checked out the GNU C compiler. Turns out printf calls vfprintf with stdout as a parameter. vfprintf calls some macros. They do a putc to a buffered output.
In the end, the calls map down to the write function. And lo and beyond, this becomes a syscall. Next homework step is to trace how Microsoft Visual Studio handles printf.
Framework or Custom Code
I read an interesting discussion on Slashdot. A developer had some simple requirements for an app. Then he entered a long phase of scope creep. The original implementation utilized the Spring framework as well as Hibernate. However the new requirements needed more than the frameworks chosen could provide. This scenario generated a lot of talk on Slashdot.
The original developer in retrospect thought he should have used JDBC to implement the requirements. Then any new reqs could be implemented with custom code. Senior developers agreed. You got to know when to use a framework, and when not to. In general, you should skip the framework if you are developing for a long lasting project.
Some believe Spring to be an evil framework in general. They say that removing Spring saves development time in the long run. Others say that frameworks in general are not bad, but Spring is no good. All of these frameworks are decisions made during the design phase. You got to get your design correct.
There is a benefit to using framework. You save time. There can be a lot of wasted time if you try to code your own framework, or code everything by hand. You could choose a compromise. Skip the Spring framework, and use JDBC with Hibernate.
You also cannot rely on the framework for everything. It does not come out of the box supporting all of your specific requirements. We use some high level frameworks in our system for general programming purposes. When necessary, we step back and roll our own code when need be. We also make use of some third party tools to take care of mundane tasks. It is a delicate balance which requires some experience to make.
Remote Pairing
I have done pair programming in the past. Sometimes we get a lot of benefit from it. However this is not an XP technique that is used often by programmers. In my own project, it is hard because the team is spread out all over the place geographically. Is it possible to conduct pair programming remotely?One columnist tried it out. He found that tools were not mature enough to handle this. His system froze a lot. In the end, they just tried a virtual connection. It is better to do pair programming in person.
Pair programming in general helps eliminate distractions you would encounter if you were on your own. However it may impede progress. Most devs feel that they can accomplish more on their own. But the real question is whether pair programming improves code quality. I don’t think the verdict is in yet on that decision.
Agile Development
Here are some notes on the agile movement overtaking development teams around the world. The goal is to have short quick releases, and more of them. It includes Test Driven Development (TDD). Quality is engineered into the product from the start.It is best to use one project management tools for all your needs. This encompasses requirements gathering, source code control, bug tracking, and even testing.
You can make a part of your development process an agile one. There is often a lot of politics involved when moving to an agile technique. You should know that not all development projects are best suited for agile. Some work better using the waterfall method.
Here is one agile technique that I love. You strive to automate most if not all of the status reporting. This sounds like nirvana for team leads that normally spend a lot of time collecting and compiling team status reports.
Hiring Engineers
A company in Texas was trying to hire a C++ programmer. They were getting absolutely no candidates. So they asked a development forum for help in determining what they were doing wrong. Let’s see what actual developers told them.Actually we can start with the ad this company placed. They were looking for a video software engineer. They require solid video experience. And they want with app or driver experience. There are some other details like full life cycle, high reliability, and multi threading. But you get the idea.
Most of the comments from developers was to list the salary being offered. Even if it was just $85k, the amount might get you some bites. You can get a lot of interest if you list the pay rate as $160k per year. One guy came out and said “everything has a price”.
Next you can reword your job listing copy. Change the job title, as a video engineer is rare. Or you could just list the bare minimum of requirements and weed out the candidates that come in.
Another tactic is to relax the requirements for the job to open the net wider. You could accept non-local candidates. You could also allow working remotely. Perhaps you could also consider C# or Java programmers who could pick up C++.
There might be a root problem preventing candidates from coming in. Good C++ developers are working on Wall Street or doing game development. C++ developers usually stay at their companies for a long time. It is rare to be able to catch them between jobs. Depending on how you look at it, C++ is either dying or becoming a niche market.
I personally love C++ development. For the last 10 years I have been coding mainly in C++. Although I am not tied to it, I prefer coding in C++. Unfortunately I am too far away from this particular job opportunity.
Model Driven Theory Wrap Up
Some time ago I read a whole book about Model Driven Software Development. This seemed like a hot topic. However I found the subject a bit boring. There were some key points I picked up from the book. I share them here today.Define your model using UML. Then you should automatically generate between 60 and 80 percent of your code. Keep the this auto gen code separate from developer produced code.
Here are the four meta levels for Model Driven Design: M0 is the instance, M1 is the model, M2 is the meta model, and M3 is the meta meta model. Look at that for a second? How can you not LOL at meta meta model?
How do you know whether you have a good architecture? First it meets all of the requirements. It allows future growth of the system. It is clear and succinct. Finally you have good supporting documentation. Hopefully the next theoretical book I read will be more interesting. I tried reading some of the classic more recently. They were even more boring. I could not finish them.
Technical Debt Solutions
Schedule pressure often results in developers hacking to get the job done quickly. Unfortunately these hacks become the production code and do not get fixed. Over time this can make a legacy product difficult to work with. We call this Technical Debt. The best fix to this problem is to not resort to hacking. But tight schedules are a part of life. And bad code gets put into production. Once the damage is done, we need to regroup. Otherwise legacy systems will become impossible to maintain.Here is a small process that can be used to address Technical Debt. Identify where you have the debt. Construct a business case to justify working this issue. Fix the debt. Rinse, lather, and repeat. The process sounds simple. But it might be hard to sell the business case. You should therefore try to choose the debt where you will get the biggest bang for your buck. It is also best to get team consensus before moving forward with a plan to remove the debt.
There should be a main point of contact for your technical debt reduction program. Here are some other tips to sell the idea. Produce tangible examples of how the debt affects the business. Make use of analogies to communicate the effects. It is easy to get into debt with software systems. Just like credit cards, it will take a big effort to get out of debt.
Development Estimates
Another common fallacy in estimates is that developers spend the whole day coding. You will be lucky if they get to spend 50% of their time in development. Productivity also depends on the task complexity. Expect to get around a thousand lines of high level code a year per developer.
Here is another tragedy. Sometimes when a developer just tries to get their part done, it is to the detriment of the overall project. Want to hear more depressing news? The first system built is hardly ever a usable one. Next time I will continue with ideas about design and development.
The Power of Documentation
It is best if your user manuals are accurate. Choose this over exciting text. It is difficult to be exact. The spoken English language does not lend itself to written clarity. Know this. When there is some discrepancy between the system and the documentation, it is easy to fix the documentation.If an implementer has a problem understanding the design, they should get on the phone and call up the architect. I know I get calls all the time on stuff I design. This is natural. It is better to do this than to guess and get it wrong. By then it will be too late or too costly to resolve.
A rare combination of skills is the technical guru who can also do project management. However if you can find one, it is best if they manage a small team of about 5 developers. This team will have great productivity and success.
Next time I will share a lot of pitfalls with scheduling estimates.
Model Driven Software Development
I read a book from 2003 on Model Driven software development. Let's first define what we mean by model. A model is an abstraction. It is cheaper than a real system. The problem is that models are not kept up to date with the code.MDSD stands for Model Driven Software Development. It is also known as MDD. Right now models are just treated as documentation. However in MDD, models are at the same level as code.
A related topic is MDA, which stands for Model Driven Architecture. This is where you focus on UML to do design. UML produces nice looking documentation. Some problems that plague software development are productivity and risk management. MDSD intends to address these shortcomings.
Next time I will start with the hot topic of Domain Specific Languages (DSLs).


