ECMA666

devil

You're just fine.

Coding Blog

an image

This is just full of random thoughts about coding as I go through the never ending process of studying code.

Here you'll find things I've seen, things I've leaned and experienced and what I thought about it.

Love Coding

an image

Since a particularly late and somewhat tipsy evening, in 2020, I've become absolutely enamored with coding. It takes up all of my spare time. And I do it only for myself.

I often dream of having some fancy coding job in a slick glass cubicle but I suspect that doing this as a hobby on my own time, at my own pace in my own way is what makes it so much fun.

There are just so many possibilities when coding. Anything you can imagine you can represent on the screen. It is a never ending puzzle and you get to choose how you want to solve it. Coding has been a balm for me. It is infinately satisifying and insanely fun.

Accomplishment

an image

Last night was a milestone in my coding life: I completed my first database driven webiste!

It took over a year to design, plan and develop. I thoroughly enjoyed every step of the way.

Now, I'll spend the next long while weeding out any bugs that I have probably missed, but I even enjoy that part of the process as well. It's just so much fun to code!

Position: sticky;

an image

New feature added.

The date picker on this website is now sticky.(^O^)/

So happy tomorrow is Friday! That is always the very best day. I'm looking forward to a nice quiet weekend of coding.(ɔ◔‿◔)ɔ ♥

Weekend

an image

Ah, that nice 48 hour respite from the daily grind. So excited to have a bit of time to do what I want, when I want. Well, more or less.

Looking forward to some good quality coding time interspersed with some video games.

I've been trying my hand at an old space flight simulator called Evochron Mercenary. Fun but man the learning curve is steep.

MySql_Battle

an image

When it works, it's great! Love that MySql but when you get this awesome message:

"Error: MySQL shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check the Windows Event Viewer for more clues If you need more help, copy and post this entire log window on the forums"

It means you get to spend a lot of time fiddling around and not coding. Which is sad. I wouldn't mind it so much if there was a simple fix but it just seems to be an error that is destined to pop up from time to time and there's no way to totally make it go away never to return.(╥﹏╥)

Endless Editing

an image

Well, my new database driven website still seems to be working fine. Haven't come across any major bugs just yet. Next week I hope to start using it with a larger base of users. We'll see what happens...

In the meantime, I still see plenty of things to improve; bits of code that could use refactoring and images that could use redrawing. Funny how all of my effort is totally unpaid. My only payment is the satisfaction I feel every time I see someone using my website.

Once I get it polished up, I'm going to have to start looking to see in what other ways I can up my skills. At the moment, I'm thinking of just diving deeper into JS and PHP. There is so much to learn there and I really feel like I've only just scratched the surface.

Efficient Coding

an image

I'm really the type of person that has to learn by doing. While studying coding, I've often come across phrases like, 'You should be careful about doing X or your website will be difficult to edit as it get bigger and more complicated.'

I understood what that advice probalby meant but I had to make a big complicated website myself and then realize that changing one thing meant I would need to change everthing that was realated to it before it would work.

My most recent challenge is with MySQL. I am currently working on figuring out to to reset certain columns in a given table to their default settings. I want to make a funciton that will update every row of certain, but not all the columns in a given table. Luckily, when I figure this out I don't think that resetting these tables will break the site. So long as I reset all of the proper tables in the right way.

Study time / Coding time

an image

Coding seems to be a never ending learning process. There is no definitive end where you can turn around and say, 'OK, I know all of the code now.' Coding is ever evolving and changing. In order to learn and keep up with the best practices I have found that it is very important to spend equal parts coding, learning new code and refactoring old code to keep it current.

I love to learn new ways to code and to then go back of old bits of code and make them better. It's a great way to reflect on where I was as a coder and see how far I've come.

There are a lot of libraries and different ways to make it so you don't have to figure out all the little nuts and bolts of coding but I much prefer to figure it out on my own. I really enjoy the process of trial and error. My mistakes are my best teachers. And I have a lot of teachers.

Image and Reality

an image

Before I stared to coding myself, I had this image of programmers sitting at keyboard casually typing off lines of code at a dizzying pace. And then dramatically hitting the Enter Button to make it all magically go. The reality of couse is very different. When I begin a new project, I don't even start at a keyboard. I use a paper and pen to do rough sketches and jot down ideas. Then I think about what kind of code I might be able to use to make my idea work on the screen. Next, I'll turn to my books and do some reasearch about any code I'm not sure about to see if my idea is possible or practical. Finally, I will sit at the keyboard and start trying out my ideas for real.

But it doesn't end there. There is never the dramatic pressing of the Enter Button to make it all go. Coding is a never ending process of trial and error. You fumble about in a dark room, feeling along until you find a door. You open the door hoping it will lead you outside but very often you will just find youself in another dark room, looking for the way out of this lightless maze.

Lucky for me, I really like the dark.

Coffee Shop Coding

an image

I love to code in coffee shops. There are basically two main reasons I like going out to this or that coffee shop to code. One is that it's fun to pretend like I'm some sort of professional coder who's actually getting paid to write code. And the other that it is just fun to go out and soak up the atmosphere of different coffee shops around town.

Some shops really have an atmosphere that fits my image of the kind of place a coder might go to write code. These places are usually sleek and simple in design with lots of open space and few decorations; the clientele is the decoration.

Other places are like little lost forgotten moments in time. They are frozen relics that offer a glimpse into a not too distant past when there were no coders typing away on slim laptops. The stark contrast of doing something so modern in a place so (relatively) old just strikes a very nostalgic chord in me.

Where are the other coders?

an image

It's always been a bit of a mystery to me, but where are all the other coders? There is a lot of internet out there and a good portion of it was coded by someone somewhere. Where are those people? With all of the websites that are being churned out at an ever increasing rate, you just have to wonder about these things.

I got into this and have been coding for several years now, but I've never met another coder. I read their blogs online, I buy thier books and watch their Youtube videos, but I've never actually met or even seen one in person. Do they never go out? Maybe their just too busy. I don't know.

I just can't help but ask myself the question: Are there anothers out there like me? People who just code and create for the fun of it?

Scope

an image

Just finised another little project. This one used the drag and drop api for touch screens. It's annoying how many convenient animations and tricks can't be used with Safari. Thankfully, addEventListener("touchstart") and addEventListener("touchmove") work on iOS. Wonder why it won't work on Safari as well?

One of the things I often stumble over when coding is trying to keep mind in the order that the code is going to be read by the browser. In general, it is read from top to bottom but I like to use setTimout() to delay when certain functions will get fired. If I'm just writing a simple short program it's not a big deal but as it grows to hundreds of lines long, things can get a little tricky.

Scope is another issue I often stumble over. It can get to be a real challenge for me trying to figure out how to make sure that a certain variable created by one function can be seen and used by another function later in the code.

I ended up completely rewriting this last project 3 times. It just got to the point where finding the bug and fixing it would probably have taken longer than just rewriting the whole thing, so I did.

OOP

an image

I'm in a sort of doldrums as to where to go next with my coding studies. There's just so much out there to study and all of it looks really interesting! In the back of my mind I've been tossing around the idea of:

  1. Delving deeper into Java Script Fetch
  2. Learning how to properly use OOP with PHP
  3. Learning one of the libraries that abound for either JS or PHP

At the moment I'm really leaning toward learning OOP. I like to use objects in JS to organize my code; it just makes it easier to read that way. With PHP I've mostly been using procedural programming to write everything.

Up to this point that has worked well for me because it was easier to think about how to organize the code that way, but as my last project got bigger and bigger, I started to wonder if there wasn't a better way to do things. Yeah, I think I'm going to need to learn OOP. It's settled.

Now, where to start? This book, 'PHP 8 Objects, Patterns, and Practice: Volume 1: Mastering OO Enhancements and Design Patterns,' looks pretty good. But I've got another book that touches on objects in PHP that I think I'll go over again before I buy anything new. It's a great book called, 'PHP&MYSQL' by Jon Duckett.

MVC

an image

There is a pattern that I've noticed whenever I go to learn something new. I used to think of the learning process as a series of hills and valleys, but for me I actually don't think that's quite right. In my case it feels better to think of it as a series of mountians and plateaus.

I always start at the bottom of the mountain, sometimes it's very steep and sometimes it's a gentle climb. In the cases where it is steep, I always poke around the bottom of the mountain and try to find the most gentle rise possible. And there is always an easier way to get up the mountain, even if it might take a little longer to get where I want to go.

Next, as I climb the mountian I will eventually get to what might look like the mountain top; there is a nice view and I can see very clearly how much progress I've made. But this is not the top, only a plateau. Looking up, I can see there is a lot more mountain to climb. The top of the mountain towers over me and disapears into the clouds above.

Right now, I'm on a plateau with my coding. I'm looking for the gentlest rise that will take me up the next part of the mountain. As I look into OOP I think the framework called MVC will suit me fine.

As with so many things in coding, there seems to be a lot of very strong opinions on the subject of MVC and how it should be implemented. Myself, I like the idea of the Control sitting in the center taking in input from the user, telling the Model to update this and that, and then passing that informatin over to the View which then shows the relative information to the user. Some people like to have the View get the info straight from the Model but I like the idea of View and Model being totally separate.

The next step is to build a simple page and see what it looks like first hand.

built-in functions

an image

I just came across a bit of code that I almost can't believe I have never stumbled on before:

spl_autoload_register();

I'm so excited because with this in-bult funciton I won't have to have a huge column of 'include_once' at the top of every page.

I think the thing that helped me to find this gem was simply trying to think about how to code in a new way. That prompted me to go looking at blogs and articles that I might not normally read. Thinking outside of your usual box is very important.

Thinking about MVC

an image

Still busy studying MVC. On the surface, it seems pretty straight forward but as I start to think about how the information is to be passed from one document to another, I keep running into little questions.

In particular, I'm not sure what to do with the view classes. What is the orthadox way? Is it ok to make different view classes for different documents? For example, we might have a index.view.php and then have a main.view.php and then a userAchievements.view.php. Is that too redundant? Personally, I like to have all of the differnt categories so I know exactly what each class is doing but at the same time, that possibly invites a bit of repetition.

I think I'm just going to need to set up a few dummy sites and see what that code looks like. At the moment, I'm just looking over this and that site demonstrated by other coders to try and get a hold of the basic structure.

Can't wait to get in and start building stuff!

Another mysql battle...

an image

And again I get the mysql error telling me that it can't connect to the database. I spend too much time trying to fix that thing. This time it even happened almost right after I completely uninstalled and reinstalled xampp. I was really hoping that xampp would provide me with a simple interface for running my sql code and managing my database but that seems to not be the case.

I wasn't planning on spending a lot of time studying to understand what goes on under the hood in xampp but it appears I may not have a choice. I'm guessing that somehow during instalation xampp is not getting installed properly which leads to a slow, or this time fast, accumulation of errors that causes the database to crash.

What a pain, I just want xampp to do its thing so I can do mine. Oh, well. Another chance to study and learn I suppose.

Grid Lines

Playing with grid

an image

Just messing around with grid. I've been reviewing old notes about CSS. There's so much to know when it comes to CSS. This time around the main focus of my study was flex and grid. I find I can never study and review those two enough. I changed the layout of this web page from grid areas to defining the main parts of the page by using grid lines instead. That makes it so I can have different divs span the whole page. Pretty neat.

I suppose there's a million way to do that but I thought this approach was pretty cool. Got the idea from Tyler Sticka. Here's a link to the article he wrote. Very cool stuff, thanks so much Tyler!

Well, I suppose that's enough messing around, just had my database on my localhost crash on me again. So depressing. But I will press on because I know with enough study, I'll eventually figure out how to keep the thing up and running!