GK Logo 003 350 x 100
Time to switch to Java for a football prediction project
Programming Books (Clive Darra, Creative Commons)

I have decided that it was time to switch to Java for a football prediction project that I have been planning for some time.

I want to do the project justice so I thought I would start from the most basic decision. What programming language should I use?

The Problem with C++

For the past 20 years, I have been using C++ (before that I was using all sorts of mainframe languages). I can do what I need to do with C++, but I have never been entirely happy with it.

As a language, I quite like it, but it is all the stuff that goes with it that has always been frustrating. And most of that stuff is around Visual Studio (VS), MFC (Microsoft Foundation Classes) and Templates. Don’t get me wrong, this is not a Microsoft bashing exercise. I know of many people who use VS and are very happy with it, develop great applications and know how to use the tools that are available.

But I have never really got my head around it. I run into all sorts of problems with namespaces, linking errors, deciding whether to use MFC (Micosoft Foundation Classes), or not – and then regretting it, whether to use the classes available in VS so that I could port my code to another compiler should I wish to do so; and the list goes on.

The end result is that I have never really developed as a C++ programmer. I can do all the usual stuff (classes, inheritance, operator overloading, polymorphism) but I have never been able to get to grips with Windows (Graphical User Interface – GUI) programming and so have always stuck with a Command Line Interface (CLI).

To be honest, using a CLI has served me well and I have managed to churn out some nice programs. But for my football prediction project, I really want to develop some sort of GUI. The question I asked is, should I have another go at getting to grips with MFC, Windows programming and all that is need to get an application developed in VS to display a Window on the screen, or do I change to something else, in the hope that I will find it a little easier to understand?

So why Java?

After a lot of soul searching, and Googling, I decided that it was time to switch to Java. I have written a couple of programs in Java before, but nothing too much beyond “Hello World”.

But is like C (syntax wise), and like C++ (class wise), it is well supported, many of my academic colleagues use it, it is platform independent and, I hope, that GUI programming is a little easier than VS.

More questions that answers

Of course, making the decision to use Java just raises a whole load more questions. What IDE should I use (I have chosen Eclipse), how big is the learning curve, can I easily access Excel files, can I (should I) use MySQL, what Java tools are available to support developing a a GUI etc.

All these questions will have to wait. For now, I have to learn the basics of Java and get my head around the Eclipse IDE (Intergrated Development Environment).

Wish me luck.

 

6 Responses

  1. Hi Graham,
    some time ago I stumbled across your blog and found your football prediction articles very appealing. As you probably know I’m working on a comparable project and that is why I’m pleased that you let your research in this field revive (I commented some of your recent posts as meister_e).
    And I fully agree with you – choosing the right technique for such a task is a basic prerequisite. Nevertheless for being productive and able to concentrate on the actual goals (which includes heavy data retrieval, preparation and the implemention of prediction strategies) I find it useful to use a technique one is familiar with, not to say being an expert is essential. If so one doesn’t need to struggle too much with technical but “only” with strategic approaches. When I started with my project several years ago it was clear that i would implement it in Java as I had an experience of over 10 years in this field. Having said that I love the world of open source which becomes a great advantage when it comes to using different frameworks such as easy csv processing (excel) or more sophisticated ones (persistence layer, application context management and so on) or even the integration of industrial product frameworks (such as statistics or data mining software). The longer you work on such a system (especially as single developer) and the more it grows you’ll find that it’s not about the language you use but all about architecture, design and the ability to extend functionality anytime.
    What i can say is that when programming in Java (no matter what type of application – be it console, client GUI, server or web app) you’ll be alright using the Eclipse IDE (I’ve been using it for more than a decade now and haven’t yet found a more appropriate environment). But as developing a prediction engine in the field of sports quickly becomes a science my experience says: care about business and not too much about technical details!
    Good luck!

  2. Thanks, really good advice and words of wisdom galore!

    I fully agree with you – I think I’ll be okay with Java, once I get into it, but I am concerned about the overall project getting a bit out of hand!

    Actually, I have just tweeted about a book I am reading (well, listening to).

    Listening to Dreaming in Code. Fascinating book about the problems of software development. http://bit.ly/1hKHfKc

  3. Good luck! I switched from C++ to Java years ago and never looked back. Automatic garbage collection, fewer memory leaks and better defense against programmer errors (a frequent event for me) were prime reasons, along with largely platform-independent compilation. I also switched from Eclipse to NetBeans, but not out of unhappiness with Eclipse.

    I think you’ll like Java.

  4. Thanks Paul – I must admit that garbage collection is a bonus. I was okay with new/delete but I worried constantly about memory leaks, especially when copying objects (and who knows what is going on)!

    I also like the platform independence argument. Not sure I’ll ever use it, not sure whether it woould just work on Mac/Unix, but it might be fun trying.

    I also think that there is a lot more Open Source software, which I would like to explore (see the next comment).

  5. Adrian, just picking up on your comments a little more. One of the attractions is to get access to some Open Source software. For examepl, I want to use Artificial Neural Networks (of more in later posts hopefully). The “best” one I have found (FANN) is actually written in C, but has a Java wrap-around do it will be interesting to see if I can get that running.

    I’d also like to look at GAs (Genetic Algorithms). The “market leader” (GAlib) is actually written in C++, so I amy have shot myself in the foot with that one!