Subscribe to ...considered harmful        RSS Feed
* * * * -

Some Notes On R: A Dialog

Icon 1 Comments
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?"

Icon Leave Comment
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

Icon 1 Comments
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

Icon Leave Comment
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

Icon Leave Comment
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

Icon 4 Comments
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

Icon 2 Comments
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

Icon Leave Comment
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

Icon 2 Comments
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

Icon Leave Comment
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

December 2014

S M T W T F S
 123456
78910111213
14151617181920
212223242526 27
28293031   

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    0 user(s) viewing

    0 Guests
    0 member(s)
    0 anonymous member(s)

    Categories