59

I always liked to ask myself "what's the first principle(s) of this?" after I learned the basic stuff of something (e.g. programming). It's an inspiring question, IMO, that can force you to think about the most important principle(s) behind something, especially a skill such as programming.

So, what do you think is the first principle(s) of programming? I'll give my answer below a little later.

Weipeng
  • 889
  • 1
  • 9
  • 8

93 Answers93

97
  1. KISS - Keep It Simple Stupid
  2. DRY - Don't Repeat Yourself
  3. YAGNI - You ain't gonna need it
  • KISS should be Keep It Simple Smart. The first time you have to rewrite a large chunk of your code because you didn't design smart and extensible you will agree to this. :) –  Dec 04 '08 at 08:35
  • 8
    I think KISS should be "Keep It Simple, Stupid!" – Dennis C Dec 09 '08 at 16:33
  • I'm actually working on a blog post about how these two are the two most near and dear to a programmers heart and how at the same time they are a bit of oxymorons as often times you'll need to choose one against the other –  Jan 08 '09 at 20:11
  • 10
    I would also add YAGNI. –  Mar 09 '09 at 12:29
  • This enumeration is the wrong way around. DRY should be first. – Svante Mar 09 '09 at 12:49
  • I also like the "Keep it SUPER simple" expansion of the acronym. – Agos Jun 14 '09 at 11:46
  • @Agos: But that's not the idea. It shouldn't be super simple. It should be simple enough ;) –  Jun 14 '09 at 13:04
  • KISS and KISS again ;-) – Perica Zivkovic Jun 22 '09 at 10:20
  • I always the KISS acronym was kind of dumb and hypocritical. After all, the extra S is more than the phrase needs. Keep It Simple conveys the point. The Stupid, Super, or whatever is superfluous. But hey, has to be clever right? –  Jul 31 '09 at 18:46
  • 3
    @Programmin Tool - I don't think "stupid" is superfluous. I think it conveys that we have a tendency to want to be "smart" and this manifests as unneeded complexity. As I see it, the "stupid" tries to remind us of this tendency by helping us remember what we initially think is "smart" is usually not. – codekaizen Jul 31 '09 at 19:01
  • They are worthless if you don't understand the problem first: http://bit.ly/XwvOh – OscarRyz Aug 13 '09 at 03:01
  • COC - Convention Over Configuration
  • – Ates Goral Mar 04 '12 at 03:15