{"id":1260,"date":"2014-03-04T16:49:43","date_gmt":"2014-03-04T16:49:43","guid":{"rendered":"http:\/\/graham-kendall.com\/blog\/?p=1260"},"modified":"2020-09-22T01:58:21","modified_gmt":"2020-09-22T01:58:21","slug":"time-to-switch-to-java","status":"publish","type":"post","link":"https:\/\/graham-kendall.com\/blog\/time-to-switch-to-java\/","title":{"rendered":"Time to switch to Java for a football prediction project"},"content":{"rendered":"<figure id=\"attachment_1270\" aria-describedby=\"caption-attachment-1270\" style=\"width: 300px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/graham-kendall.com\/blog\/wp-content\/uploads\/2014\/03\/Programming-Books.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-1270 \" alt=\"Time to switch to Java for a football prediction project\" src=\"https:\/\/graham-kendall.com\/blog\/wp-content\/uploads\/2014\/03\/Programming-Books-300x225.jpg\" width=\"300\" height=\"225\" srcset=\"https:\/\/graham-kendall.com\/blog\/wp-content\/uploads\/2014\/03\/Programming-Books-300x225.jpg 300w, https:\/\/graham-kendall.com\/blog\/wp-content\/uploads\/2014\/03\/Programming-Books-400x300.jpg 400w, https:\/\/graham-kendall.com\/blog\/wp-content\/uploads\/2014\/03\/Programming-Books.jpg 640w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1270\" class=\"wp-caption-text\">Programming Books (Clive Darra, Creative Commons)<\/figcaption><\/figure>\n<p>I have decided that it was time to switch to Java for a <a title=\"Link to football category\" href=\"https:\/\/graham-kendall.com\/blog\/category\/football\/\">football prediction project<\/a> that I have been planning for some time.<\/p>\n<p>I want to do the project justice so I thought I would start from the most basic decision. What programming language should I use?<\/p>\n<h1>The Problem with C++<\/h1>\n<p>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.<\/p>\n<p>As a language, I quite like it, but it is all the <em>stuff<\/em> that goes with it that has always been frustrating. And most of that <em>stuff <\/em>is around Visual Studio (VS), MFC (Microsoft Foundation Classes) and Templates. Don&#8217;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.<\/p>\n<p>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 &#8211; 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.<\/p>\n<p>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 &#8211; GUI) programming and so have always stuck with a Command Line Interface (CLI).<\/p>\n<p>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?<\/p>\n<h1>So why Java?<\/h1>\n<p>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 &#8220;Hello World&#8221;.<\/p>\n<p>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.<\/p>\n<h1>More questions that answers<\/h1>\n<p>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.<\/p>\n<p>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).<\/p>\n<p>Wish me luck.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[177,8,110,15,158,46],"tags":[157],"class_list":["post-1260","post","type-post","status-publish","format-standard","hentry","category-archive","category-football","category-forecasting","category-prediction","category-programming","category-sport","tag-prediction_project"],"_links":{"self":[{"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/posts\/1260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/comments?post=1260"}],"version-history":[{"count":11,"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/posts\/1260\/revisions"}],"predecessor-version":[{"id":1272,"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/posts\/1260\/revisions\/1272"}],"wp:attachment":[{"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/media?parent=1260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/categories?post=1260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/graham-kendall.com\/blog\/wp-json\/wp\/v2\/tags?post=1260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}