Quantcast
Viewing latest article 8
Browse Latest Browse All 9

hard code

Hard coding is the practice of embedding a pre-calculated result into a program. Input is disregarded, there are no calculations or logic flow, just unchanging (thus “hard”) output. This shouldn’t count as programming. And even though hard code is appropriate sometimes (such as stubs in test suites), it is most often encountered in a matter of avoiding doing real work.

This makes me recall one of my all-time favourite programming webcomics from MacHall:

Image may be NSFW.
Clik here to view.
you miserable monkey men who tried to hardcode the results are beneath my mention

As a person controlling your (DWITE) grades, I too have some advice:

  1. Sidestepping the assignment negates its purpose. You fail to learn a concept or demonstrate your ability.
  2. In an academic setting, you simply fail.
  3. You are almost there. Even the hard code values come from somewhere, perhaps from figuring things out on paper — put the same logic into the program.

Though I think I’ll let MacHall offer the final advice on writing hard code…

Image may be NSFW.
Clik here to view.
work harder or there'll be hell to pay

That is all.

Related posts:

  1. Ways to spot plagiarized code

Viewing latest article 8
Browse Latest Browse All 9

Trending Articles