DEV Community


Discussion on: What's one thing you wish you knew before you started programming?

jacoby profile image
Dave Jacoby

Context: I went through high school believing that I'd need to have 2 years of high school foreign language, but where I went, the requirement was one year of hich school "computing", which I didn't have. So I took a course on "programming", which was taught in BASIC.

There was a certain amount of "just make a thing, we'll judge it later", and I played roll-playing games, so my "make a thing" was a program to print out random numbers between one and six (a common die to roll), and then I made another that would do between one and eight.

I GOTOd to a high-number block, ifd to determine if it was d6 or d8, did the random thing, and jumped back to print.

And I found that computers are highly deterministic machines and that rand is not as random as you want, by running it a second time and getting the same page of "random" numbers.

So, the things I figured out from that process are:

  • seed your randomness, even if it's for toy values of randomness

  • functions and subroutines are an important thing for your language to have, and if you don't have them, you will try to re-implement them, poorly

  • that was enough of all that

But this is what I knew by Jan 1, 1989.

The thing I (today) wish I (then) knew about programming that these stupid roadblocks were known issues at that time, and that the languages I would use as a professional will have worked these dumb things, discovered a whole lot more dumb, and worked out that.

And that the process of fixing and improving is very fun.

(That's another off-by-one error, isn't it?)