Thursday, February 4, 2010

My Blackberry Experience

Over last weekend I bought myself the Blackberry Curve 8520 smartphone, I always wanted to have a Blackberry since I heard its very good especially with email taken that I spend a lot of time on emails.

I didn't got the device on a contract but as a prepaid package, so I bought it cash together with a Vodacom prepaid SIM card.

With Vodacom you can signup for the Blackberry Internet Service by using your airtime, R59 for 30 days (subtracted from your airtime) gives you unlimited Internet access e.g. browsing, Facebook, Twitter and push email. Note that Skype (VOIP) or any form of streaming will cost you extra since that isn't part of the unlimited Internet package.

For push email you just register your email addresses on the Vodacom portal and get pure push email (I will blog about push email in the future).

For Facebook a little blue envelope will appear if someone sent you a message etc.

The Blackberry Curve uses GPRS/EDGE and Wifi unfortunately no 3G support but for me that is fine since I'm mostly in a office where there is Wifi and yes I'm one of those that don't use my phone while driving.

For me the most to get used to was the little keyboard, I came from my Samsung Omnia i900 and iPod Touch that got touch screens and all of a sudden need to get used to the little keyboard.

If your a developer, please fill in my poll: Do u want C#/VB.Net for Blackberry?

Wednesday, January 27, 2010

Apple's Unveils The iPad

At a special event last night 20:00 South Africa time, Apple's CEO Steve Jobs unveiled the new iPad. I couldn't watch it online since unfortunately Apple didn't broadcast it but I did listen to an audio feed together with some photos from Engadget, Live Gizmodo all from my iPod Touch (on Wifi) while in bed with a stomach bug.

The iPad got multi-touch, very big screen, fast processor, comes in Wifi only, Wifi/3G models etc. For all the details you can read the references below - I'm not going to repeat here. For me it got some advantages / disadvantages:

Advantages:
  • Bigger then the iPhone/iPod Touch so browser is nicer
  • Comes in Wifi/3G models.. if you don't want to wait for the 3G model you can buy the Wifi only model and use a tool like MyFi that broadcast a Wifi signal from 3G (3G -> Wifi).
  • Very fast processor, most of the reviews are happy about how fast it is.
  • iWork: Office like package (try to compare it with MS Office) for word processing, spreadsheets etc. USD $9.99 from the AppStore.
  • AppStore: Buy all existing applications developed for the iPhone from the AppStore and run it on the iPad without modifications.
  • New SDK: New SDK for development of iPad applications
  • Games: Very good graphics, I love playing games on my iPod Touch / wife's iPhone.
  • Keyboard: A physical keyboard that you can connect to the iPad if your not keen on using the on screen keyboard (like me: I dislike typing on the iPhone/iPod Touch).
  • iBooks: New online store where you can buy e-books and read them the iPad.
  • Price: At USD $499.00 (about R3,773.09 base upon the current exchange rate) for the Wifi only model the pricing is very good.
Disadvantages:
  • Its not a PC, you still would require a Mac OS device to write applications for the iPad.
  • No multi-windows, only one application can run at a time... Just like the iPhone / iPod Touch.
  • Base upon new iPhone OS so got the same disadvantages
  • No GPRS - Not everywhere in South Africa there is Wifi or 3G.
  • No webcam build-in or microphone... doesn't see how applications like Skype/Fring will work if you want to do VOIP.
  • Wait: We're going to wait months before its available in South Africa.
So for me: I will not buy one, its got all the same stuff that the iPhone got already and you can phone with the iPhone (and use Skype/Fring), it got 3G and GPRS. I would like to see iBooks and the keyboard for the iPhone but that is something that I can live without.

References:

Tuesday, January 12, 2010

Happy New Year 2010 & My QBASIC Story

Happy New Year 2010 (that is Twenty-Ten :-)

I hope this year is full of joy, fun in your live. I'm having a full year with alot of work and my Java Certification exam in June 2010.

I reguarly visit reddit to see what is new in the programming world... I notice that there is a QBASIC interpreter written in JavaScript available online. By default it runs the Nibbles game (an old classic snake game).

QBasic was the first programming language that I used at the age of 14.. (I'm 28 now) when I was young, inexperience and programming was fun (yes it currently is still fun!) - writing my own dictionary, book library, help me with homework (especially maths) that is where my love for programming started that later became my career (another story how that started).

My dad bought me a old 386 SX, 40 MHz, 2MB RAM, 1.2 GB hard drive that ran MS DOS 6.22 with MS Windows 3.1. I learnt BASIC since it was the only books avialable in the schools library, taught you the old GW-BASIC in a cartoon style... GW-BASIC had line numbers etc where with QBasic it was the first version that didn't hand line numbers, had a proper IDE (no syntax highlighting or code completion yet), proper debugging in the form of breakpoints etc. In the language there was GOTO and GOSUB but mostly for back-ward compatibility with GW-BASIC where you get proper SUBs and FUNCTIONs in QBasic.

Later on I moved over to Library Basic so that I can compile my applications and not give my source away (yes even at that age I was very protective of my source code!)

Saturday, December 12, 2009

Weekly Source Code: C# DateTime Developer Pitfall

Base upon my previous blog post that every language has some pitfalls I had a production issue and saw one of the pitfalls that C# have with the DateTime class which is part of the .Net framework.

I renamed this title since its more a pitfall of the developer not understanding the proper use of the DateTime class. The all point is that your telling the constructor to create a date, you don't tell it to work with increments.

In the next code you want to get the 1ste date of the following month:

DateTime currentDate = new DateTime(2009, 11, 05);
DateTime nextDate = new DateTime(currentDate.Year, currentDate.AddMonths(1).Month, 1);
Console.WriteLine("nextDate: " + nextDate.ToString("dd/MM/yyyy"));

So the answer is 01/12/2009 which is correct but what if you do the following:

DateTime currentDate = new DateTime(2009, 12, 05);
DateTime nextDate = new DateTime(currentDate.Year, currentDate.AddMonths(1).Month, 1);
Console.WriteLine("nextDate: " + nextDate.ToString("dd/MM/yyyy"));

Code is exactly the same, I just change the month to December since you want to get the day for the 1ste of Jan 2010 but the end result is: 01/01/2009. Ouch!!

Yes the DateTime object doesn't increment the year (2009 -> 2010).

To fix:

DateTime currentDate = new DateTime(2009, 12, 05);
DateTime nextDate = new DateTime(currentDate.Year, currentDate.Month, 1);
nextDate = nextDate.AddMonths(1);
Console.WriteLine("nextDate: " + nextDate.ToString("dd/MM/yyyy"));

You see that you can't increment in a DateTime.

Friday, December 4, 2009

For The Love Of C++

Alot of programmers that use more modern programming langauges (C#, VB.Net, Java, Python, Delphi etc) dish C++ by saying what bad language it is, how its the worse thing ever created etc.. But they don't know it (have you ever code any C++? have you ever even see any C++ code?) Don't dish something that you don't know...

Languages like C#/Java is very abstract, they hide things from a programmer like memory management that get managed by a garbage collector etc Where in C++ memory management get done by yourself via pointers (yes pointers are very difficult!) C++ have pitfalls, very bad once aswell yes but they can be privented by putting rules in place, use 3rd party libraries like Boost that support smart pointers for memory management (for this artical am not going to explain what smart pointers are) have code reviews etc. A programmer can write crap in any language, in C++ its just more easy for this you need serious programmers that take there job seriously that are willing to learn the C++ pitfalls and how to deal with them, are willing to read books like Effective C++.

C++ is powerful it teach you how to come close to understanding how the machine works, you learn new things / new ways of doing things all the time... its fun! Think abit beyond... The OS that you use (MS Window/Linux), your mouse driver, your Webcam, your iPod, your iPhone, your IM program like Skype etc are all written in C++ or some dialect of it (like Objective C)... the C# / VB.Net etc geeks can also stop moaning since do you guys know? the compiler for your language is written in C / C++.

So why does C++ have so many pitfalls?

To start, every language has some form of pitfalls... am studying for my Java Programmer Sun Certification and let me tell you, even Java got alot of pitfalls. C# aswell! So don't think C++ is the only language that you can write crap in, you can write crap in any language and any language can make you scream from frustration when you struggle with some weird issue that is actually a language pitfall.

C++ have alot of pitfalls, full books are written for them like Effective C++ (btw you also get Effective Java) get see the reason why we need to go back into history... (time Machine please!)

C++ was called "C for Classes" where Bjarne Stroustrup want to add object oriented programming (OOP) features to the powerful C programming language from his experience coding in Smalltalk, Simula etc. (interesting artical here) it was criptic way of adding classes but it worked and soon the name was given "C++" along with more languages features added over time... like meta programming, generics in the form of templates, run-time libaries like STL etc To keep C++ standard a standard committee formed, standards are there for a reason since it protect us my dear fellow programmers from one compiler vendor adding some language feature that isn't part of a standard meaning that when you ever wanted to move your code over to that compiler you will have issues - might not be at compile time but at run-time damaging your customer.

When adding a new langauge feature you add more complexity ontop of more complexity and you must keep backward compatiability! Why backward compatiability? Example: Python 3x isn't compatiable with Python 2x so how many developers ported there code over? Answer: Almost none, reason being that a programmer just don't have the time or resources to do a port, you can't tell the your boss/management to wait for a year for you to rewrite all the software (that can be millions lines of code) since business must go on... new products release, new customers, new features in the application etc. In the ISP world its a good example. So for C++ every new feature needs to be compatiable in different context together with other language features... its a difficult process, committee's fight about things for years... the new C++ 0x standard has been going on for over a decade now. So "0x" since you don't know when it will be release, it can be in 2020! that is why C++ has some many pitfalls and is so complex because of 30 years of history... languages like C# will go the same route or are already going the same route. The C++ standard committee just can't do what the Python guys did by "cleaning up C++" since millions of lines of code all over the world will break.

So to end this story... this the truth ladies + gentelman, don't dish something that you don't know the history about or ever even used before.


Wednesday, November 11, 2009

About SCJP Sun Certified Programmer For Java Exam

Questions from colleagues and readers of my blog, here is more information about the SCJP exam.

The SCJP exam is a theoretical exam with very tricky questions, it test your knowledge of the Java programming language which is the foundation of all future certifications like Java Developer, J2ME etc.

To study for the exam I suggest buying the SCJP Sun Certified Programmer For Java 6 Study Guide (R409.00) book and spend about a year studying, do mock exams etc until your sure you can pass the exam - its very difficult!

For help you can visit JavaRanch
Which is a website started by the authors of the SCJP book.

Phone Prometric Testing Centre on 0800 99 11 20 two weeks in advance, before writing the exams to book. Pricing can be checked with them.


Friday, November 6, 2009

Increase Visual Studio.Net 2008 Memory

For work I use Visual Studio.Net 2008 along with a lot of plugins like SQLPrompt etc also Team Foundation Server (TFS). Lately I've been getting out of memory exceptions when I try to checkin my code, after some searching I found that Visual Studio.Net only use max 2GB of RAM memory where my laptop has over 4GB of memory.

I found an article that explain how to hack Visual Studio.Net to increase its memory usage.

After trying it out it seams that its working! Hope someone else will find it helpful.