Friday, 24 of May of 2013

Tag » development

It’s the software, not the hardware !

It is interesting to see all the blogs/articles about NetBooks, Tablet PC’s, etc. and why one will fail or the other will succeed. Windows 7 has been criticized as being unfit for Tablet PC’s. Netbooks are said to be “dead” and obsolete. Tablet PC’s are refered to as “post PC” technology, as if somehow desktop PC’s will disappear.

Let me say that I really like Netbooks and I think they deserve to be around for awhile.

Tablet PC’s look exciting as well.

What is often not discussed is the “real world” use of such devices. In the same way that with transportation vehicles there are many different types, so with computers (and similiar devices) there needs to be many different types. Cars will never replace trucks. They serve totally different purposes. How many times do I wish I had a pickup truckup, when I want to transport something that could never fit into my car. I definitely would not want to drive a pickup truck on a long trip (ie. on vacation) with gas prices so high, expecially when my car gets 37 miles per gallon. If I wanted to pull a very large trailer, a six cylinder pickup truck may not be a good idea and maybe a nice eight cylinder engine truck would be required.

Can you see my point ?

The same applies to computers. Tablets could never replace Netbooks or Laptop PC’s or desktop PC’s. They are simply just a different form factor which may serve a different purpose. Tablet PC’s may cut into NetBook and Laptop sales, but they surely won’t replace them totally. The real issue is “after the fad of such new devices” fades away, what will people ultimately require for specific tasks or situations ? Of course the “fad” of Netbooks is starting to fade away, so sales may not be a brisk, but guess what ? Netbooks are pretty useful devices and they likely will be around for awhile. They are smaller in size, so easier to carry that a full sized Laptop PC. They are a lot less expensive than bigger laptops too. They are more versatile than  Tablet, because they have a built in keyboard, unlike Tablets which have a separate keyboard (if they come with one). While the tablet is very small and light weight, if you have to lug around a separate keyboard, it sort of defeats the purpose.

Also, how a device works and handles user input is critical. Touch screens will never be able to replace real keyboards. There is a big difference between the two. To illustrate this point, let’s look at keyboards for a moment. As a computer programmer, I am very picky about the keyboard I use. The only keyboard I can live with (be happy with) so far, is a real old time IBM keyboard. Nothing I have seen even comes close to these keyboards. These keyboards are 15 to 20 years old and harder and harder to find today, but look at the prices these used (and very old technology) get on Ebay : http://shop.ebay.com/i.html?_from=R40&_trksid=m570.l1313&_nkw=IBM+model+M+keyboard&_sacat=See-All-Categories 

Why would such an old technology be so valuable to many today ? Because it serves a purpose that modern keyboards can’t come close to doing. Most computers come with terrible keyboards and the replacements are not much better. Now laptop keyboards are often quite nice and better than many desktop keyboards, except the angle of the keys in relation to the user are never like a good desktop keyboard, because laptops tend to keep the keyboard very flat in comparison.

Ok, maybe you agree that some PC devices are not easily replaced by others and that each may serve a totally different need. There is one other issue, I didn’t mention yet (which is why different form factors may be here for quite awhile) is the cost of such devices. Now for some people, maybe they can afford to buy a new PC, laptop, etc every couple of years. But for many, money is tight and they have to carefully weigh the expense of a new device. Maybe this is why Windows XP has been around for much longer than many expected (or desired such as Microsoft). Windows XP has been a long time work horse operating system which allowed many to hold onto their PC’s much longer. This is a good thing, since we need to use resources carefully and not waste them. Desktop PC’s have many advantages and one of them is longevity. You see, it is easy to upgrade a desktop PC, with say a new hard drive or memory memory or even a new video card. Laptop PC’s can be upgraded to some degree, but it has problems. For example, there is no room in a laptop for second harddrive, so you have to replace its only hard drive, which means the operating system and all your files have to be moved first to the new drive (more work). A desktop allows you to simply throw in a second harddrive, while you can use its original “as is”. When something major goes wrong with a laptop, it is much more expensive to have it worked on, unlike a desktop which uses very generic parts common to all desktops. Now wait until Tablet PC’s have been around for awhile and they start failing (which they eventually will) and then users find they spent $500 or $700 on something not easily repaired and they have to throw it away and spend another $500 or $700 on a new one. Also how easily will Tablet PC’s be able to be upgraded ? That could hamper things a lot. So give it time to see how things work out with the latest “fad” in computer devices.

Ok, we have discussed some of the issues with hardware. Obviously some form factors in PC’s will be around longer than some may suggest, but the real key to making these devices useful is the software written for them. I really doubt software can be “everything to everyone on every device”. That just does not make sense. Tablet PC’s and NetBooks and Laptops, eahc have their strengths and weaknesses. Software needs to take advantage of those strengths and play down the weaknesses. This means software written for a desktop, simply may not run well (or be a nice experience) for users with a Tablet (or even a NetBook) PC. Screen (video) sizes alone can make a big difference. I doubt a 10 inch netbook or tablet screen will ever compare to my 20 inch desktop screen. I notice a difference even when I use my wifes desktop PC, which has an 18 1/2 inch screen with 1366 x 768 resolution, compared to my desktops 20 inch 1600 x 1080 resolution.  Some programmers can’t live with out multiple monitors side by side.

Realizing that different form factors are here to stay, we need to start developing more software specific to a task and specific to a device type. So the real issue, is not the hardware, but the software.

Did you notice the recent Windows 8 demo video (on the web) ? The user experience seemed nice for the new User Interface, but when the Microsoft employee pulled up and existing Microsoft application designed for a desktop PC, she had problems working with it using the touch interface and she quickly closed the application done, before anyone noticed. Touch screens are nice, but don’t expect “power users” who do a lot of work on the desktop to be able to stay productive on a tablet PC. There will have to be a new generation of software specifically designed for tablet PC’s for them to be trully productive. There will have to be different versions of software too, one for say Tablet’s and Netbooks and another for desktops.

The success of any of the next generation devices has more to do with software than with hardware. If hardware needs to use less powerful chips to save on power, then new software which is optimized for such hardware needs to be written. Developers for Windows have been spoiled for many years now, because desktop PC hardware has been so much more powerful than required, so Windows developers could write poor software (ie. bloated, slow) and it still appeared fine to end users, because the fast hardware compensated. Well its time to wake up from our sleep and realize that the new form factors (and cheaper prices) for Tablet PC’s, Netbooks, etc. requires developers to write better, more efficient and faster sofware optimized for the specific hardware limitations. Software is the key now and developers can’t be lazy any more. Some of the new form factors (in PC’s) will live or die depending upon the software which is written for them.

As a last note, finally (because of Netbooks and Tablet PC’s) PowerBasic programmers have a real advantage. For years it was easy for some to say, computers are so powerful that the size of an application or its speed doesn’t really matter any more. Well guess what ? It does matter and PC form factors will prosper or die based on the software developed for them. So programmers, “wake and and smell the Roses” and start writing software which matches the new computers and their unique form factors.


Comments Off

EZGUI – why ?

Note:  My EZGUI software is not the EZGUI for use with Unity! My EZGUI has been around a lot longer and is for developing Windows applications.

Ok, I am biased !

I am the developer of EZGUI (for use with PowerBasic), so of course I am biased toward it.

So the question, why use EZGUI ?

I originally wrote EZGUI as an inhouse library so I didn’t have to mess with the Windows API all the time. It was written for me. No matter what anyone says, it takes a long time to learn the Windows API to the point where one is proficient with it. It really isn’t that complex once you get used to it, but the documentation is terrible and you really need to read a good book written by an expert if you want to make sense of the API. The other thing I don’t like about the Windows API is that it is very easy to make errors when coding which will literally crash your application (aka. GPF). Actually there are lot of easy errors one can make with the API, which can cause serious problems for your application and make it unstable.

Just think for a moment about all the great software out there written by the “big” software companies, which at times will crash or GPF in certain situations. If the big guys have trouble writing software which is crash proof, what about the small independent programmers like myself. So why did I start writing a library ? One, to make things easier to do. Second, the library code would be tested to the point where bugs would be much less common. You see, I like to write code which is not only bug free, but also which takes the initiative to prevent me from making more errors.

You see, the EZGUI 5.0 main runtime DLL is about 700 KB in size, which is quite small for what it contains, but did you realize that it would even be much, much smaller if I took out all the parameter checking code in it ? Most EZGUI routines test the parameters you pass to make sure that you are doing what you are suppose to. For example, with the API you can send a message to the wrong control class and it doesn’t know the difference. You are simply sending wrong values to Windows and what it does with it, you don’t want to know. With EZGUI, it actually tests the control to see what class it is, before acting upon it, so you don’t attempt to do something with the wrong control type.

EZGUI also test the values of the parameters to see whether they are within the range allowed. While a library like EZGUI can’t prevent all possible errors, it does decrease them significantly. If a parameter is bad, EZGUI may simply use the default values and in the worse case scenario, EZGUI will simply do nothing at all (ignore your command call), which at least doesn’t try to make Windows do something bad.

Another problem with the Windows API, I don’t like is how it handles memory and resources. Windows often requires you to create something (ie. a font) and then make sure you later delete or free it. EZGUI doesn’t need to do this. It tracks all such resources it uses and it will free them when your application terminates, if you forget to do it. EZGUI also is very efficient in how it uses resources and shares them as much as possible.

The other thing about Windows is that some tasks are just simply too complex for the average programmer to figure out and you have to write lots of code to accomplish the task. One good example is autoscrolling, when dragging items in a Listview or treeview control. Its hard enough to figure out how to impliment drag and drop in these controls, but the operating system has no built in autoscrolling for these controls. EZGUI, though provides such a feature, which can be implimented with just a couple lines of code. There are hundreds of lines of API code in the routines that do this in EZGUI. It requires a number of tricks, such as subclassing the control on the fly, handling drawing drag icons and sending messages back to the control itself when the cursor is in the position to require autoscrolling. It is very complex code to say the least.

By building an advanced library of routines, I can write Windows applications in half the time (or less) than it would take otherwise.

The other thing about EZGUI is that it is now in its fifth generate (version 5.0). In version 1.0 I spent most of the time learning the basics of the Windows API, so I could write a core engine. But in each new version, I was able to start digging into more and more complex stuff.  While EZGUI 1.0 had a few advanced features, like my Layer engine, later versions really pushed the limits of Windows application design.

In EZGUI 2.0 I ported over my Turtle Graphics engine into a custom control. I started digging into some of the common controls like the Listview and trackbars. I added richedit 1.0 support. I added some new drag and drop features, such my drag handle control and improved the subclassing engine. You see, the Visual Designers that come with each version of EZGUI are themselves EZGUI applications. Any hard to write features they require, were added to the EZGUI runtime engine, so no API calls have to be made by the designers.

Now with EZGUI 3.0 I added the Treeview, datetime and animation controls, plus a number of my own custom controls such as the Canvas, Shape/Hotspot and MCI control. The Canvas control is where I started to dig deeper into the GDI and graphics. I also started digging deeper into DIB sections, which are very powerful. I also added ownerdraw support and 3D colored buttons. EZGUI 3.0 is where Graphics started to become a big deal in the runtime engine.

EZGUI 4.0 though is where things really started to take shape. The Canvas control has the Sprite engine added to it. The sprite engine is a proprietary 2D animation engine, which is very fast, powerful and works on Windows 95 to Windows 7. The drag and drop engine had many new changes and the visual designer for the first time, really came into its own. The Smart Parser really made a big difference in the designer. I continued to add more graphic features and more ownerdraw features. I added a thread engine, critical sections and improved subclassing. I added new custom controls such as the Files Listbox and Properties Listbox controls. I added a game loop engine and high precision timers. The command grew significantly in this version.

By version 4.0, EZGUI was pushing the limits of Windows application design, so I wondered if I would be able to come up with anything new in the next version. I was no longer doing the simple stuff anymore. EZGUI 4.0 has features in it, which you will not find in any other visual design tool for use with PowerBasic. EZGUI’s graphic engine was always steps ahead of the PowerBasic DDT Graphic command set. I was even dabbling with stuff you only see in advanced graphic engine tools. EZGUI’s sprite engine is amazingly fast and without any hardware support. I did a benchmark of GDImage with 500 animated sprites and EZGUI 4.0′s sprite engine (which is also in my EZSprite product) and EZGUI’s sprite engine was significantly faster running 500 sprites. Only when GDImage resorted to hadrware support, did it run faster.

Now it is important to note, that one rule I have is “avoid the bleeding edge” when it comes to hardware, as much as possible. The reason is that I want my tools to be able to be used to create software which will run even on legacy PC’s. This saves money for my customers, since they don’t need the latest hardware. They can keep old legacy computers in use far longer than most others can.

Now when I started working on EZGUI 5.0, the question was “what’s left to do ?”

I was already pushing the limits for Windows application design, while still providing legacy PC support. EZGUI 5.0 brought big changes to my software. The Designer was significantly improved. The runtime now supported themes, multi-monitors, 3D OpenGL based animation, more advanced Graphics commands (like alphablending, image rotation, etc.) with even 22 built in image filters. I added new features to allow component design and custom control design. A new superclass engine was added. The list goes on !

The point is, that by the fifth generation of EZGUI, I am pushing the bounds of software development when using Powerbasic and most who browse this web site can’t even fully comprehend the power which is in EZGUI 5.0. The knowledge and experience about the Windows API that has gone into EZGUI 5.0 is far more than most realize. Now of course EZGUI has a real learning curve now, since it is a huge command set of its own, but the benefits are worth it.


Comments Off