News for hackers. Stuff that matters.
Re:Want to learn to code? Don't copy and paste, type out oth... by UnoriginalGuy on Saturday December 15, 2012 @04:12AM (#4924997)
I think it is important to learn enum's but it is a bad example. You really should use the built-in types when they're available. Color is a particular example (in both .Net and Java) where you should never re-invent the wheel.

In general teaching enum's is very important and something I've not really seen schools do (although their "learn to program" programs are typically 101 to newbie, I've never seen a program that really builds on the basics).

Re:Want to learn to code? Don't copy and paste, type out oth... by robomartin on Saturday December 15, 2012 @10:44AM (#4925475)
While I generally agree with what you are saying, it is very important to understand that built-in types are not magical. This is where coming from a low-level embedded C or assembly background can be very useful.

As an example, there are a number of sites showing the performance hit you take if you use some of the NS types in Objective-C. If I remember correctly, in some cases you are talking about NS types running 400 times slower than alternative code.

In my mind, the question of data representation could also include this very choice: Do I use an NSArray or do I do it "by hand", allocate memory and use a "simple" array?