Mar 1 2009

Program Design

So in school, we are learning some fundamentals on object oriented design in Java such as inheritance and polymorphism. The thing that we haven’t done is the actual concept of object oriented design. So things like how to structure classes and methods for optimal code efficiency and use. This is such a fundamental concept to teach in school to allow programmers just coming out of school to produce optimized and efficient code.

It’s no matter in today’s society we deal with so many programs that crash and don’t work properly. If fundamental programming techniques such as design are not being taught, then when students graduate it is to be expected that they continue the programming practices that they picked up in college/university.

This being said, when you come out of college/university, you’re most likely to have a “code monkey” position, where you’re actually coding the enterprise applications. So it’s almost expected, knowing this that programs you use everyday crash on such a regular basis.

Cheers


Feb 17 2009

Creating a Basic Window in Qt

This is a basic piece of code to get you started with the QT Jambi API. Ensure that you have the QT libraries installed before you try and run this code. IF you don’t have this then it won’t run properly and will throw an error. This displays a basic window. Nothing added to it just a basic QT Jambi Window.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import com.trolltech.qt.gui.*;
 
public class basicWindow
{
 private final int WINDOW_WIDTH = 500;
 private final int WINDOW_HEIGHT = 400;
 private QFrame frame;
 
 public basicWindow()
 {
  //create the frame
  frame = new QFrame();
 
  //create the size of the window
  frame.resize(WINDOW_WIDTH, WINDOW_HEIGHT);
 
  //create the layout for the window
  QGridLayout gridLayout = new QGridLayout();
 
  //add the layout to the main frame
  frame.setLayout(gridLayout);
  frame.show(); 
 }
 
 public static void main(String[] args)
 {
  //Used to initialize the window
  QApplication.initialize(args);
 
  //creates a new instance of the basicWindow
  new basicWindow();
 
  //runs the window as an application
  QApplication.exec();
 }
}

Cheers


Feb 17 2009

Swing vs QT Jambi

So I figured I should touch on this as I’ve been frustrated with this for a while at school. First of all I would like to say how frustrating I think java swing is…. I mean you change one thing in the layout and the entire GUI changes for some reason or another that I cannot explain…. So that is my first topic…

Java GridLayout Vs. QGridLayout

QGridLayout is coded in a way that I found extremely easy to use and manipulate. If you change one thing it doesn’t change the rest of the GUI and it keeps everything where you want it to be. You have the ability to set how big you want something to be. Then, based on the size of all the components in your display it displays the GUI in an appropriate manner. Overall the QGridLayout wins this battle.

Java Gui Components Vs. QT Components

The methods that swing uses to handle components causes an extreme amount of code that is not useful when creating a GUI. For instance, when creating a group of radio buttons, you must first create the buttons, then add the buttons to whichever group then add each individual button to a panel or something to make them appear in the GUI. This is crazy in my opinion and there is no reason that you cannot add a ButtonGroup to a panel. In QT you can add whatever component you like to a GUI. This radio button example is just that, one example and there are far too many to display here.

This is just some short thoughts on QT vs Swing, however If you try it out yourself then I’m sure you will find out which is better for yourself. Bye For Now,

Cheers


Dec 7 2008

Software vs. Bridges

First of all I would like to welcome you to Mark’s blog on technology. The first topic I’d like to talk about is from a book called Dreaming in code. The book says, ” Why can’t we build software like we build bridges?” We all know that bridges are usually pretty safe, sturdy, secure. All in all they rarely fail us.

I have to say, why can’t we build software like that? How many hours of man time and corporate money are wasted each year on software that is not functioning perfectly? Could the time that is spent on ill-conceived software be re-routed to perfecting it? Computers understand the code that humans put into it. So I ask… Is it possible to have a piece of software in today’s market that’s perfect? I’m talking no flaws, no errors, just perfection?

With the software changing the way it is today, I can’t answer that question. Having been coding for only about 6 months, I really am not best suited to answer that. Who can answer that question? As consumers why should we have to accept that software does not function the way we want it to? Is there not a single company out there that can make this type of software? I’m asking these questions because I think that there are companies(not naming any) that can change how the world is run. I’m not talking politically or religiously, I’m talking digitally. Almost our entire world runs on digital equipment… I mean almost everything you can think of. So why is the world putting up with digital equipment being almost “faulty”. Going back to the bridge analogy from the book dreaming in code. Imagine if bridges were built like software is built today? People would not stand for things like that to happen…

So why do we accept it with software?

Cheers