Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 PROGRAMMING


  Don't Overload #nil?

There’s a popular post on Hacker News about writing confident code by, among other things, overloading Object#nil? and returning “null objects” instead of nil itself.DO NOT DO THIS.In Ruby, all objects (except nil itself) coerce to the boolean value true. Your object will be nil and true at the same time. Bad things will happen. Your coworkers will cry. Sad people from around the world will ask bewildering questions on your mailing list.Here’s what happens:1234567891011class NullObject def nil? true endendo = NullObject.newo.nil? #=>...

2,811 0       RUBY #NIL OVERLOAD OBJECT


  Java is not the new COBOL

If you Google “Java is the new COBOL” you’ll find a glut of articles proliferating this mantra. I don’t know its origins, however I’m inclined to think it’s mostly repeated (and believed) by the Ruby community. Ruby, from a developer’s perspective is a low-friction language. A developer can just sit down at a text editor and start banging out code without really thinking about such superflous things as types. Java on the other hand, well, you have to think a lot about types. Java is a statically typed language after all, and it makes the deve...

2,426 0       JAVA COMPARISON RUBY TYPE COBOL


  Program Or Be Programmed

On Thursday night I gave a talk at NYU Poly and in the Q&A a young man asked me for advice for "those who aren't technical". I said he should try to get technical. The next morning I met with a bunch of Sloan Business School students doing a trek through NYC. A young woman asked me the same question. I gave her the same answer.I don't mean that everyone should become a software engineer. I do mean that everyone should understand software engineering (or whatever technical subject/industry you want to work in). I don't speak French fluently. But when I go to France, I kn...

1,690 0       PROGRAM TECHNICAL BASIC KNOWLEDGE


  Programming: the benefits of taking a break

This post lists several benefits of taking a break during programming.You work smarter, not harder. Once, I worked really hard on a feature. For two weeks, 12 hours a day, I put in a lot of effort. After those two weeks, I took a break and came up with several ideas that made much of the work unnecessary.You think more clearly. Being tired has a similar effect as being drunk. At the end of a day, I often kid myself that I’ll just get this one thing finished quickly to have a fresh start the next day. In reality, I usually need to clean up yesterday’s messes then. If ins...

2,279 0       PROGRAMMING BREAK REST REFRESH NEW IDEA


  Yes, Virginia, Scala is hard

Let me first say that I am a Scala lover and have been a Scala champion for almost 5 years.  I've written books and articles on Scala.  I've worked with dozens of companies that have launched Scala and Lift projects.  I've code reviewed many dozens of Scala projects.I used to think that Scala was easy.  It was, and continues to be, a cure for some of the numerous problems with Java.  From the "stuff that's hard or impossible in Java is simple in Scala," Scala is a very easy language.  Dealing with collections is super easy in Scala.  Isolating business logic ...

3,017 0       OOP SCALA HARD FP FUNCTION PROGRAMMING IDIOM


  Difference Engine: Luddite legacy

AN APOCRYPHAL tale is told about Henry Ford II showing Walter Reuther, the veteran leader of the United Automobile Workers, around a newly automated car plant. “Walter, how are you going to get those robots to pay your union dues,” gibed the boss of Ford Motor Company. Without skipping a beat, Reuther replied, “Henry, how are you going to get them to buy your cars?”Whether the exchange was true or not is irrelevant. The point was that any increase in productivity required a corresponding increase in the number of consumers capable of buying the product. The original Hen...

2,487 0       COMPUTER DIFFERENCE ARTIFICIAL INTELLIGENCE ENGINE HUMAN


  How can I teach a bright person, with no programming experience, how to program?

I usually prescribe the same sequence for anyone who wants to learn programming. It's very theoretical, but it lays a good foundation. It should take three or four months of fulltime study, but programming isn't something you learn overnight.If you can't get through this sequence, you're not going to be able to program, so you might as well give up now.Code, by Charles Petzold.The C Programming Language, K&RThe Structure and Interpretation of Computer Programs, Abelson and Sussman.My rule is: work your way through those three books by sheer force, if necessary. Ask any questions you have, ...

2,499 0       PROGRAMMING STEPS NO EXPERIENCE NO KNOWLEDGE


  Objective-C Is The Language

My good friend Brent Simmons invokes a historical email from Linus Torvalds, about his disdain for C++C++ is a horrible language. It’s made more horrible by the fact that a lot of substandard programmers use it, to the point where it’s much much easier to generate total and utter crap with it.Brent affirms his support while paying homage to plain-old C:But I will admit to an enduring love of C. I still think of C not as C but as the language.I loved C. Emphasis on the past-tense. As object-oriented programming concepts became popular, those of us who were programming in C or simi...

3,566 0       OBJECTIVE-C C APPLE OOP C++