Monday, January 16, 2012

Speculation: Apple Tech in 2012

Before I start with what's happening this year, I'd like to review what happened last year.  However, no one could possibly do a better job reviewing last year's tech stories than The Verge did a few weeks ago.  They covered everything except the death of Dennis Ritchie.  And let's be honest: you have no idea who that is.

On to 2012!

Apple iPad
The iPad 3 should drop in March or April, according to some sources.  Most rumors point to it having a higher resolution, Retina-Display-like screen and a faster processor (the A6) that might be quad-core.  The resolution is likely to double, giving the iPad a 2048 x 1536 resolution that would be better than full HD (1080p), but still not as good as an iPhone at 264 ppi (the iPhone's Retina Display is 330ppi).  However, since iPad is bigger than the iPhone and you hold it farther from your face, the resolution will be nearly as impressive.

The 3rd gen iPad could have some sort of 4G antenna, most likely LTE.  The terrible cameras will be upgraded, but I'm not sure whether the back camera will be as good as the iPhone 4S's back camera. PC World suggests the tablet may be thicker to accommodate new screen technology.  I think this is doubtful since, as they say in the article, "Apple products never get thicker, only thinner."  However, the addition of an LTE antenna has made several Android devices thicker (see: Galaxy Nexus), so if the iPad is a millimeter or so thicker, I'm betting that's the cause.

I haven't seen any tech outlets suggest this, but I'm sure it will have Siri.  It's a cool iPhone feature, the iPad will have the power to handle it (well, they all have the power to handle it, but that's another blog post), and it gives users another incentive to upgrade.

The price, of course, will be the same.  The old iPads will be discounted.  For some reason they're not selling the iPad 1 at the Apple Store (ignoring the Refurbished section), but I could see them selling the iPad 2 at a cheaper price, at least for a few weeks.  The cheapest iPad 1 dropped $100 when the iPad 2 came out.  Seems logical that the iPad 2 could drop $100 soon, too, making the iPad 1 cheaper on eBay, if not cheaper in the Refurb section of the Apple Store.

Tablets are about to get dirt cheap.

Apple iPhone
At some point this year there will be an OS update to iOS 6.  I have a difficult time imagining what it could contain... perhaps widgets?  Facebook integration?  I strongly believe Siri will finally be upgraded out of "beta."  This means support for more languages and an API for developers to hook into.  That could produce some awesome things, allowing apps to use Siri.

The 6th gen iPhone will have LTE.  There's just no way around this one.  The iPhone 4 missed having real 4G, which was acceptable because only the EVO had 4G at that point.  The iPhone 4S missed having real 4G, which was widely regarded as a mistake, given that there were dozens of Android phones using Verizon's LTE, T-Mobile's HSPA+ and Sprint's WiMAX.  Now there is no reason not to include an LTE antenna.  Sure, battery life will take a hit, but iPhones have had a great reputation for battery life (with some occasional lapses), so I'm sure the slightest increase in battery capacity will at least put the iPhone on par with other LTE phones in terms of battery life.  Additionally, since WiMAX is dying (Sprint is switching to LTE), AT&T has started rolling out its LTE network, and the iPhone is still unavailable on T-Mobile, the three national carriers that sell the iPhone will all have a decent-sized LTE network by the end of the year.  Even Windows Phone 7 phones are getting LTE this year.  Apple might as well hang it up if they can't manage to stick LTE in their next iPhone.

I wouldn't be surprised to see the iPhone on T-Mobile.

The chip may be an A6, like in the iPad, but if the A6 is indeed a quad-core processor, I'm not sure it will make it into the iPhone for power and heat reasons.

New design.  Maybe.  Apple put a lot and time and effort into designing the iPhone 4/4S and, honestly, it's still the most gorgeous phone out there.  The Droid RAZR is nice, we all like to look at Sony Experia phones, and the Nokia Lumia phones ain't too hard on the eyes either.  But the iPhone has a cleanliness, weight, and build that cannot be matched.  Why mess that up and chance making an uglier phone?  Mockups of what the 4S was rumored to look like are resurfacing, and I have to say: I'm not a fan.  The tear drop shape is not beautiful as the iPhones currently untapered bar shape, and the lack of any bezel means lots of accidental screen touching when just holding the phone.  Many gadget blog commenters were upset with the lack of a larger screen on the 4S (and these comments/articles were followed by poor explanations of why 3.5" is the "perfect" size), so I could see a slightly larger screen on the next iPhone (definitely nothing like those 4.5+" Android phones, though), but the rest of the phone should stay the same. Or get slightly thinner.  And maybe reduce the bezel at the top and bottom, but not the sides.

NFC, maybe.

The biggest question to me is what the 6th gen iPhone will be called.  Much to my chagrin, many tech news sites have been calling it the iPhone 5. I think it's mostly because people had high hopes for the 4S and they have poured them into the 6th gen iPhone.  Apple has a lot of options for the name:

  • iPhone 5: This would be a way for Apple to acknowledge the mistake that was the iPhone 4S by pretending their 5th gen phone didn't count.  It also is the dominant name for the next iPhone on tech blogs, so most people would accept it easily.  Additionally, if they wanted to call the 6th gen iPhone an "iPhone 6" then the 4S should have been the "iPhone 5."  And, of course, 5 follows the 4 in the 4S.  Simple.
  • iPhone 6: This is not a great name, but it would follow the 4's convention of naming the phone after the generation of the device.  And naming a 6th gen phone the "iPhone 5" makes no damn sense at all.  It's going to be running iOS 6, probably on an A6 processor.
  • iPhone 4G: This would be a great name.  It emphasizes the LTE antenna and continues with the pattern of naming the phones after the antenna (i.e. the 3G) and the current trend of a 4 in the name.
  • iPhone LTE: This also would be a great name.  By leaving out a number, Apple quells the iPhone 5 vs iPhone 6 argument and starts a new trend, while still emphasizing the new 4G antenna.
  • iPhone HD: If they upgrade the resolution--especially, if they double it again--the next iPhone could have a better than full HD screen.  iPhone HD would be a great name that shows off this feature.
Apple TV
Apple is rumored to be working on a television set.  If so, you can bet it will be basically an LED TV with Apple TV integrated into the set.  It wouldn't make sense for anything else fancy (like blu-ray playback), basically an answer to the poorly-received Google TV.  iTunes/iPhone integration and maybe Siri.  Can't see it being a bit hit, so I'd be surprised if they actually released a TV set.

Oops, outta time. Android 2012 rumors next time.

Monday, January 2, 2012

Code: A Cursory Review of Some Programming Languages

"What's the best programming language?" This is a question I sometimes see at Stack Overflow and other places on the Internet. It's a ridiculous question, of course. There is no one best programming language. Each language has its pros and cons. The question should be "What's the best programming language for what I want to do?" The answer to that question, of course, depends on what you want to do.

In this article, I will review some of the languages I have used and cover their strengths, weaknesses and uses. I must preface this article by admitting that I am still a junior programmer. My opinions may change with more time and further experience.

C++
If I were to recommend one language to learn to any future software engineer, C++ would be it. It's fast, it's powerful, it's compiled, and it's well-known, but most important of all, it's widely used. Many sources put C++ somewhere near the top of the list of the most popular languages, but I personally estimate that it is the most widely used programming language by professional software engineers, with the possible exception of web scripting languages.  It's great for application development and I imagine that most consumer PC software was written in C++ or C. C++ is a superset of C, so it works well with C code and C libraries.

Note: Compilation may or may not be a benefit. To me, compiled languages are preferable because they will work on any computer with the same operating system type. This contrasts with interpreted languages and what I'd call "virtual machine languages" (like Java) that require an interpreter or VM to be installed to use. C++ programs compiled for Windows Vista will work on any Windows 7 computer, regardless of the software installed. Well, there may be issues porting 32-bit programs to 64-bit programs. Also, library dependencies or any other file dependencies could reduce compatibility. Aside from those minor exceptions--which can also affect non-compiled languages--I'd say compiled languages are more portable than non-compiled languages.

There are, however, several drawbacks to using C++. One is that it's not as high level a language as newer languages. Programmers still need to explicitly manage memory. There are several syntax holdovers from C++'s predecessor, C, that I find ineligant.  But the main issue I have with C++ is that it's a huge language that allows you to do things in many ways. To roughly paraphrase a Berkeley computer science professor: "C++ is such a monstrosity of a language that, had it a mother, it would have been killed by its mother at birth." I like to think he was talking about the largeness of the language and how, while it may not be that difficult to learn, it is impossible to master. I don't know if I've met anyone who can claim to know the complete syntax of C++. I am a little embarrassed about how every day I learn something new that I can do in C++.

This may sound like a benefit, that C++ is a flexible, powerful language with many ways to solve a problem. It is not a benefit. It means that reading other people's code can be a nightmare. If the program's author has a unique style, you are constantly trying to see if their coding decisions are even valid C++ code, or why they made the style choices they did.

I hate C++, even though I have a great working knowledge of it. Like a gift of bad whiskey, I tolerate it because I have to and it gets the job done.

C
C is the predecessor to C++. It's also compiled, fast, and pretty powerful. It's often used for drivers and in embedded software. I've been told that there is no reason to write anything in assembly code since an optimized C compiler will do a better job creating a concise, fast program than a human programmer. I like C because it's a small, concise language, yet it can be used to program anything.

The main drawback C is that it's such a low-level language, it has a learning curve (especially when doing complex things with pointers). Similarly, C is a pretty unsafe language that assumes the programmer knows what he or she is doing. A C compiler will never complain when a programmer assigns structs to char pointers, nor when he attempts to access unallocated blocks of memory, making it easy to accidentally cause runtime exceptions.  Almost anything is valid C code.  A computer science professor once opined: "C would compile a phonebook."

Java
Java used to be my favorite language until recently.  It's compiled to an intermediate language, which means you need a Java virtual machine to run Java programs, but Java has reach near-ubiquity on PCs, so most PCs can run Java programs.  The Java VM has had several major updates in the last few years, so the only cause of any compatibility issues is most likely an out-of-date VM.

Java is a nice high-level language.  It's garbage-collected, so memory management is mostly a non-issue and, unlike C and C++, it's quite object-oriented, so it's arguably easier to learn.  The creators of Java obviously learned from the pitfalls of programming in C and C++, and it shows with String handling, the lack of pointers, and its object-oriented-ness.  It's often billed as good language for web applications, but I think it pales in comparison to web scripting languages like Javascript and PHP.  Instead, I'd recommend Java for regular application programming.

GUI programming is relatively painless in Java, and is definitely a pleasant change from MFC.  Java is probably the best language to use if you want to do a cross-platform GUI program, since the GUI libraries are the same for Windows, Linux and OS X.

Java does have a few flaws.  One of the main ones to me is that you can't generate a simple executable that will run on machines without a Java VM--that is, without some special 3rd party compiler.  The other main one is that Java programs are slow when starting up, just-in-time compilation notwithstanding.  These are both issues inherent in virtual machine languages.  C and C++ gurus that love the simplicity and power of pointers may detest their absence.  Also, while Java is pretty powerful, I don't think it's as powerful as C and C++.  Which is why several major programs written in Java (like Eclipse) also have parts written in other languages.

C#
C# is now my favorite language.  It seems to be Microsoft's version of Java.  It's high-level, compiled to a intermediate language (CIL), object-oriented, and garbage-collected.  With out and ref, you get the functionality of pointers.  And while I haven't researched this extensively, C# programs seem to start up faster than Java programs.

The only drawbacks I can see with C# are the facts that it doesn't compile to native code (which may result in some slowness and incompatibility) and that it's Microsoft-proprietary.  Microsoft created the language, but there are no Microsoft C# compilers for non-Windows operating systems.  There is only the Mono project, which I haven't checked out and I doubt has 100% compatibility with C# programs written for MS Visual Studio.

ML and Scheme
I bundled these two together because they are both (usually) interpreted languages that can be used in a read-eval-print loop (REPL) and both are languages I used in college and haven't seen elsewhere.  Also, both can be described as functional languages, especially ML.  As functional languages with REPL interpreters, they are excellent for writing mathematic algorithms and short, quick programs where the programmer can get immediate output.  This contrasts with compiled and imperative-procedural languages where short programs take longer to write and require more steps to compile and run.  But because they are functional, they may be harder to learn for someone who is used to C-based languages.  This could be the reason that they are less widely used.

Ruby
I haven't used this enough to form an informed opinion of it, but I do think Ruby the only language that can claim to be truly object-oriented.  Even the numbers are objects.  Ruby has innovative aspects to its syntax--like blocks and iterators--that make it an intuitive and flexible language that is a pleasure to code in.  However, Ruby is fairly slow, so, like ML and Scheme, I think it's best suited to scripting and small programs.