Subscribe to ...considered harmful

## Some Notes On R: A Dialog

When beginning R, the user should expect a number of gasps of disbelief, face-palm moments will not be uncommon, and occasionally the responsible programmer will be tempted to take the language out back and shoot it in the head.

I'll get much of this reaction out of the way for you in one line:

`...`

## Java: "Why isn't my input inputting?"

One of the most common beginner traps in Java is the behavior of the "convenience" methods of the Scanner class. The usual scenario is this: the assignment is to write code accepting inputs of various types and process those inputs in some fashion. For example the assignment might be to prompt the user for a String, a substring, an...

## Switch Statements in Java

It has come to my attention, both here on DIC and in the real world, that many programmers do not actually know that there is a difference between a switch statement and a string of if-else clauses. This seems worthy of correction. You may have been told at some point in your path to becoming a developer that a switch statement is "just like...

## The Easy Way

Just to clarify: "the easy way", in the real world, is the way that you can get done, and up and running, immediately. "The easy way" is not the way that would be easier if you just figured out how to do it - don't go down that rabbit hole!
If you have to choose between the clever way and the way you know, do it the...

## Everything is done wrong

Everything in software is done wrong. This is because, by the time you know how to do it right, you've already done it. The only exception is when you do the same thing over and over - and that's a DRY violation, and so wrong by definition.

## How to think about finding primes

Finding primes is a common exercise in programming, and for good reason: it's a good exercise that combines mathematical thinking with programmatic thinking. The exercise comes in various forms, most commonly "find the nth prime" or "find the first n primes". Also common is "find all primes less than n". It turns...

## ++ considered hazardous

The postincrement (++) and postdecrement (--) operators (hereafter called "postinc" and "postdec") are a perennial source of befucklement for new and intermediate Java programmers. In particular, people get snagged on complex exp...

## The Programmer's Bookshelf

Following is a list of some titles that I've found beautiful or useful or both. I'm not gong to say much about them here, but they're all likely to give you interesting things to think about.

• Introduction to Graph Theory (Richard Trudeau)
• The Art of Computer Programming (Donald E. Knuth)
• ...

## "Write a code" considered painful

Pet peeve time: "code" in the software sense is a mass noun, not a collective noun. It has no plural. You don't eat "an oatmeal" or several "oatmeals", you eat oatmeal. In the same way, you don't write "a code" or "codes", you write code. If you mean a unified body of code that can be run...

## dd considered terrifying

If you don't feel a little twinge of fear any time you start typing an invocation of dd, you should probably not have admin access to anything at all, including your refrigerator. dd is the primal Elder Sorcery of unix. It is absolutely terrifying in the raw power that it commands, and the utter disregard it shows for safety. Its very syntax...

• (2 Pages)
• 1
• 2

S M T W T F S
1 234
567891011
12131415161718
19202122232425
262728293031