In which I updated a bunch of old projects that none of you will see.
August 22, 2022, 2:37 am

So this weekend has been a bit of a whirlwind of coding.

Two weeks ago, I started watching a video on how to make a python game using a library called pygame. Creating a Stardew Valley inspired game in Python. It's a pretty decent 6 hour tutorial on some basics of game design. It's incomplete in terms of its game outcome, but it will get anyone interested in the topic pretty far into the start of some concepts.

The thing is, I don't really want to learn python. Not really. Not right now. I already know javascript. And the two languages aren't THAT divergent, so I thought I'd give a shot at converting his example into javascript.

The immediate problem I ran into is his use of the pygame library. Its documentation is... rough. But the thing is, I've made a lot of libraries in my time, including math, graphics, and querying concepts. I just needed to bring them all together, and sort of adapt any interesting pygame concepts I came across.

So I started into it. And after about a week, I was doing pretty well. And then on friday something terrible happened. Well this whole time I had been diving through old code, to see if any of my stuff I'd already written was compatible to be brought into this project. But then I started looking through old projects and applications on my server.

You guys, a few months ago I updated my php installation to php8. I don't regret this. But it broke like 10 of my websites immediately when I did it. After making sure all of the sites I could think of were fixed, I moved on. But this weekend I found more. And more.

I found old scripts like my file browser that weren't working. And then trying to fix that made me realize my php package manager wasn't working. Then I made myself a link page to some behind the scenes projects of mine and realized my sql manager wasn't working either. Then I noticed a bunch of my old AAU example files weren't working either. It was a mess.

Slowly but surely over the course of this weekend I've been not only fixing php8 bugs, but I've been adding to and completing a bunch of old projects. Hell, I'm writing this in my blog editor, and I've even started updating the css and layouts of that tool as well.

I'm writing some of the best code I've written in years. I'm way better at javascript and php now than I was even 6 years ago, and both languages have improved a ton on their own. For a few years I've had zero motivation to work on my own projects. Getting laid off put me down low for a bit, but I think I'm coming around the corner. Now my only enemy is sleep. And money, I suppose. I wish I could just keep going forever.

A contextual difference
July 11, 2015, 11:27 am

There is a major difference between fundamentally learning how to program, and learning a new programming language.

Let's look at an example.

$a = 0;

If you said, "That looks like code!", congratulations, it's your first day. Have a lollipop. If you said, "That's a variable assignment", congratulations, you seem to know how to do basic programming. If you said "That's a variable assignment in php", congratulations, you seem to know the basics of PHP. If you said, "That's a variable assignment of the number zero, which has a basic value type of Number, to a variable with the designation of $a, in the php programming language", then congratulations, you're a huge nerd! But what about when the language is less obvious, or you don't know that particular language. Should you still be able to figure stuff out?

function sqr(num:Number):Number{ return num*num; }

Now, if you didn't know that was Actionscript code, that's ok. Not everyone does. But you should be able to use your knowledge of basic programming to figure out what is going on. It seems to be a function definition. Something called sqr(). I'm not sure what those colon parts are, but it seems to be a basic type of value, so I'll bet it's saying num will be a number. I can only assume then by the second :Number placement that sqr() is also supposed to be a number? The function seems to be multiplying the number by itself, then returning that value.

Did you see what I did there? I don't know Actionscript 3. I learned Actionscript 2, back in the day. Actionscript 2 did NOT have type casting. I found that code on the Adobe help site when I searched for "actionscript function return value".

Learning to program means you should be able to know a few basic concepts, and recognize those concepts in any language.

  • What is a variable?
  • What is an array?
  • What is a function?
  • How do I if else?
  • How do I loop?

Those are the core concepts of programming. And they are (mostly) language independent. If you can figure out how to do those things, you can probably write anything in any language.

... after about 2 months of intensive study in that new language just to get anything to freaking show on screen...

It can be difficult in the early days of learning your FIRST programming language to measure the difference between learning that language's syntax and learning the essentials of programming in general. It might not even ever become clear to you until you attempt to learn your second programming language. Suddenly things that weren't important before can become very important. Suddenly things that were so hard before can become easy. Changing languages is a difficult task, and learning your first language can feel like a monumental challenge. It isn't until you learn to differentiate the fundamentals of programming, from the idiosyncrasies of a particular language, that you will truly begin to reach your potential.

  • 0