background preloader

Programming in Good Style

Facebook Twitter

A Simple Example of Object-Oriented Design: An Address Book. Rob Pike: Notes on Programming in C. February 21, 1989 Introduction Kernighan and Plauger's The Elements of Programming Style was an important and rightly influential book.

Rob Pike: Notes on Programming in C

Laser Game - Squeak Development Example for Squeak 3.9 (2007) Introducing the Coding Dojo by Emily Bache. About - Hacker School. Defensive Programming vs. Batshit Crazy Paranoid Programming. We Recommend These Resources Hey, let’s be careful out there.

Defensive Programming vs. Batshit Crazy Paranoid Programming

--Sergeant Esterhaus, daily briefing to the force of Hill Street Blues When developers run into an unexpected bug and can’t fix it, they’ll “add some defensive code” to make the code safer and to make it easier to find the problem. Sometimes just doing this will make the problem go away. They’ll tighten up data validation – making sure to check input and output fields and return values. Expect the Unexpected The whole point of defensive programming is guarding against errors you don’t expect. The few basic rules of defensive programming are explained in a short chapter in Steve McConnell’s classic book on programming, Code Complete:Protect your code from invalid data coming from “outside”, wherever you decide “outside” is. SOLID software design... My hopeless backlog One of the bad habits I have is accumulating lists of things to read.

SOLID software design...

Google Reader used to be a handy place to categorize and keep my "subscriptions" to blogs and so forth to read. NbK - 17 - the cookbook and pensive way of doing things. It's been a while since I was wearing gloves and mixing solutions, but I find myself a lot of times still in a wet-lab mindset when it comes to how I do things.

NbK - 17 - the cookbook and pensive way of doing things

A lot of the daily routines in the lab is center on doing things. Like putting on gloves and mixing solutions. So it makes sense that a lot of information transmission in a lab using a way that is best at his. Watching somebody do something, and then trying to replicate. Norvig's LISP style guide. Robert C. Martin - Clean Architecture. Where can I find problems - CS101. Short coding exercises in Python and Java.

Where can I find problems - CS101

Interactive lessons in Python, JavaScript, HTML, etc. Math problems that usually require programming. Difficult problems from coding competitions. Always copy code examples, and get them running. How to Write Without Writing. Fix error handling first. Created 6 February 2003, last updated 24 January 2007 Often when unexpected errors first occur, I've found problems in the way the error is handled.

Fix error handling first

This isn't surprising: error handling code is often the least-exercised part of your system, so it's natural that there are bugs in it. It is important to fix the error handling problems first, then the original error. Sometimes there is a whole chaing of problems started by the original error condition, then compounded as layers of error handling code mis-handle the condition. Fix all the problems, backwards. In any program, there will be code specifically designed to handle unusual situations, whether they be errors, exceptions, failed assertions, edge conditions, odd input, whatever.

Estimates vary about what fraction of a large program is devoted to error handling, especially when different error handling techniques (status codes vs. exceptions, for instance) are taken into account. Always fix error handling before fixing errors. Stringification. Created 9 December 2002, last updated 6 February 2003 One of the greatest features of modern programming environments is also the most humble: ubiquitous stringification.


Books, course supplements and other learning resources - CS101. Teach Yourself Programming in Ten Years. How to be a Programmer: A Short, Comprehensive, and Personal Summary. Debugging is the cornerstone of being a programmer.

How to be a Programmer: A Short, Comprehensive, and Personal Summary

The first meaning of the verb to debug is to remove errors, but the meaning that really matters is to see into the execution of a program by examining it. A programmer that cannot debug effectively is blind. Idealists that think design, or analysis, or complexity theory, or whatnot, are more fundamental are not working programmers. The working programmer does not live in an ideal world. Even if you are perfect, your are surrounded by and must interact with code written by major software companies, organizations like GNU, and your colleagues. Debugging is about the running of programs, not programs themselves.

Written on Wednesday, November 23, 2011 I posted a very brief response to a post on HackerNews yesterday challenging the notion that 8 weeks of guided tutelage on Ruby on Rails is not going to produce someone who you might consider a "junior RoR developer.

" It did not garner many upvotes so I figured that like most conversation on the Internet it faded into the general ambient chatter. Become a Good Programmer in Six Really Hard Steps. How I Learned to Program. Programming is, without a doubt, the most mentally rewarding thing I've ever done.

How I Learned to Program

Programming taught me that life should be fun, filled with creativity, and lived to the fullest. Programming taught me that anything is possible; I can do anything I want using only my mind. Programming also taught me that learning is fun. Learning to Code: The Roadmap I Wish I Had Been Given - Jimmy Li. Log message style guide. Created 9 December 2002, last updated 6 February 2003 One of the fit-and-finish issues all systems developers need to address is the text of log messages. This is a log message style guide. Once your product ships, it will be in customers' hands. “Note to Self” by John Barnette. Be Confident Tests build confidence. Write ‘em. The Zen of Python. Abstract Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.

Style Guide for Python Code. The Principles of Good Programming. Heron-Centric: Ruminations of a Language DesignerThe Principles of Good Programmingby Christopher DigginsJuly 24, 2011 Today's post is a lightly edited repost from my blog at The Area, a web-site dedicated to users of Autodesk media and entertainment products. Python. Sourced[edit] Bret Victor - Inventing on Principle. Welcome to the SICP Web Site.