Live data from Hacker News

Ask HN: learning web programming vs. tablet programming

news.ycombinator.com

21–26 of 26 posts

Re: Ask HN: learning web programming vs. tablet programming

#22
post #9

Go for the tablet using ONLY native Objective C. Don't use PhoneGap. It will be a good learning experience, you will be able to instantly test the code, and there are no two ways about it. Few hacks or tricky stuff. It's a pretty straightforward platform. Also, you can easily earn money with this, and the money is purely passive. No server administration, etc. You can finish it, put it in the store and run off for th…

Also, you learn about memory management and device constraints. Didn't know that a tablet platform will have device constrain with so much processing power at hand. Will someone enlighten me about the amount of low level stuff (memory management and thinking about rams and disk space and the likes) goes into writing software for iPad or even an android and iPhone.

> Didn't know that a tablet platform will have device constrain with so much processing power at hand.

These devices (Android/iOS devices) are fairly limited in power when compared to your average laptop or desktop.

For the iPhone and iPad, there's not much low-level stuff you'll normally worry about. Memory management is pretty easy to understand. In most cases, if you follow a few rules of thumb, you'll be okay.

Re: Ask HN: learning web programming vs. tablet programming

#23
Learn C, then decide.

1. If you like programming logic puzzles then you will enjoy programming in C. In C, everything is a number, memory address, or byte array. So every "while" loop you write is a new logic puzzle! But seriously, the things that people tend to gripe about (pointers, segfaults, etc.) won't affect you if you are good at logical reasoning and learn your way around a debugger.

2. Learning C will teach you what's going on "under the hood" and make all other programming seem easy. For some reason people like to say the JavaScript or Ruby are great "beginner's languages," but I disagree. I think you should learn to drive stick shift first and then graduate to automatic. Too many people learn automatic and then think stick shift is unnecessary. Then when their friend with a convertible gets drunk at a party, nobody can drive home, and everyone has to sleep on the floor. If you know C, you will be the hero of the party, and if something deep inside the system breaks or there's a seemingly insoluble performance problem, you'll be the guy everyone turns to.

3. I see a number of growth fronts for C programming.

A. Tablet programming. If you're not just writing Babe Alarm Clock apps and want to get the most out of limited hardware, you will want to know C. You might only write 5% of the app in C, but for critical logic paths, it can make the difference between an app that feels like a prototype and one that feels like a magic show.

B. Desktop programming. The Mac App Store will completely change the economics of desktop software development. You'll be able to get a program in people's hands (and money in your bank account) with minimal expenditures on sales or marketing. This opens up a lot of potential for innovation and the creation of new vertical markets that people didn't think existed. Microsoft will probably follow suit with an App Store before long. For desktop programming on Mac or Windows, you will want to know C because:

-- As with tablet programming, sometimes you need to write a critical logic path in C to get the responsiveness that users expect.

-- The number of open-source libraries out there is large and continues to grow. In most cases, knowing C lets you take advantage of them, even if only to write a binding for some other language. In many cases you will be able to write a great program just by slapping a pretty face onto an LGPL library or two.

-- GPU programming (OpenCL, DirectCompute, CUDA) looks to be an area of large potential growth, and as I understand it the APIs look a lot like C. For certain kinds of computations the GPU has 50X the throughput of the CPU. That's like going from a 66 MHz Compaq with a Turbo button to whatever 2GHz workhorse is sitting on your desktop right now. The ramifications for scientific computing are large; many programs designed around a "click and wait" paradigm can be rewritten to be fully interactive. There's a lot of potential for disruptive innovation here.

C. Server programming. The web still has a lot of growing to do, and fast-growing web companies need folks who know C. Most people will tell you that for web programming you just need PHP or whatever, but when the going gets tough, you're going to bust out some C. When I was on the server team at a fast-growing chat company, nominally I just needed to know PHP and Perl, but I found myself needing C in order to: 1. Fix a bug in Memcache that was horking our graphs 2. Fix up the prediction algorithms in RRDtool 3. Write a PHP extension for monitoring CPU time on Windows. I couldn't have done any of those things without knowing C. If you want to be at a company that uses the latest and greatest open-source server technology, at least somebody will need to know C when you run into the programs' problems or limitations.

D. Web programming. This is still several years off, but the Google Native Client is on the horizon:

http://en.wikipedia.org/wiki/Google_Native_Client

If it takes off, we're looking at a lot of desktop C/C++ code that will need to be adapted or rewritten to run in web browsers.

4. If you're hoping to be "very well paid" (esp. starting out at age 36) knowing C is a good strategy. First, it sets you apart from the stack of resumes touting Cocoa and jQuery knowledge. Second, knowledge of C is an excellent way to get involved in open-source and have your contributions widely used (and your coding skills validated). As a former boss of mine said, there are basically two paths to the major leagues in software development: first is to go to the right schools and get recruited into the right companies, and the second is to contribute to open-source. The most popular open-source projects are all written in C.

On a personal note, I've had to learn a dozen or so computer languages at various points and I find C to be the most satisfying. It's a difficult language compared to most, but if you know it, like it, and get good at it, you can let other people worry about bullshit like CSS workarounds and concentrate on getting the most out of a computer. Knowing C will seem completely unnecessary as you get started on any idea, but as soon as you start thinking any of these thoughts:

- "I've done everything, but it's still not fast enough" - "I've done everything, but it still eats too much RAM" - "If only I could use this library" - "If only I could use this system call" - "If only I could fix this bug"

...then if you know C, you will be the hero of your own party.

Re: Ask HN: learning web programming vs. tablet programming

#24
Programming for both is hard in different ways. With web programming, you can generally throw together arbitrary designs quickly but once it works, you have the second half of the work ensuring it works everywhere. With device programming, you have an easy path to the platform defaults and a more difficult path to arbitrary designs but (particularly on the iOS devices) once it runs, you're pretty much done.

The hardest part of web programming is getting consistent results out of CSS, particularly since this is generally non-repeatable. The best solution is to use a CSS preprocessor (I recommend sass/compass) and up the abstraction a level so you CAN repeat the solutions.

Javascript is comparatively stable. There are the same number of quirks/variations in the raw browser APIs but the libraries are to the point where they fill in the differences. I don't recommend programming a general use site without a library. Most of the work in building the lib is shimming+testing the differences between browsers, not doing the raw library design+construction.

The trick to client side wizardry is modularization. You need something like Sproutcore, YUI3, Backbone, or Knockout to do modules/KVO otherwise things get out of control as your app size grows. It's a boring trick, but it's the trick. All flashier tricks (and there are hundreds) are easy to copy, you look at the source and pull out the interesting bits.

I'm a devoted frontend developer. Dealing with browser quirks is annoying but I think the web is the healthiest platform available and I like not being a sharecropper.

Re: Ask HN: learning web programming vs. tablet programming

#25
post #9

Go for the tablet using ONLY native Objective C. Don't use PhoneGap. It will be a good learning experience, you will be able to instantly test the code, and there are no two ways about it. Few hacks or tricky stuff. It's a pretty straightforward platform. Also, you can easily earn money with this, and the money is purely passive. No server administration, etc. You can finish it, put it in the store and run off for th…

Also, you learn about memory management and device constraints. Didn't know that a tablet platform will have device constrain with so much processing power at hand. Will someone enlighten me about the amount of low level stuff (memory management and thinking about rams and disk space and the likes) goes into writing software for iPad or even an android and iPhone.

There is a 10MB limit on 3G app store distribution; anything over that will be wifi only.

Memory management is handled via a set of rules that are basically if you create it you are responsible to release it. If you borrow it you must not release it. Similar to malloc/free and new/delete in c/c++. It is a level of abstraction higher though. You are dealing with retain counts and autorelease pools. A memory leak in an application can crash a phone with limited memory fairly quickly.

Re: Ask HN: learning web programming vs. tablet programming

#26
post #9

Go for the tablet using ONLY native Objective C. Don't use PhoneGap. It will be a good learning experience, you will be able to instantly test the code, and there are no two ways about it. Few hacks or tricky stuff. It's a pretty straightforward platform. Also, you can easily earn money with this, and the money is purely passive. No server administration, etc. You can finish it, put it in the store and run off for th…

And whatever you do, test it on an iPhone 3G or iPod Touch 1G. If it performs reasonably on that, it will be blazing fast on an iPhone 3GS/4 or iPod Touch 3G/4G.
Post reply on HN