Tag Archives: week3

My code works and I have no idea why

When Greg sent us that funny little photo saying, “My code doesn’t work and I have no idea why. My code works and I have no idea why,” I had to laugh. I had just spent an hour trying to decode the JavaScript we’d hurriedly written in class enough to add captions with divs. I changed around some tags and parentheses for a while, and all of a sudden, after several iterations that made the photos all disappear, all appear, or refuse to flip, it finally worked. And I had no idea why. I couldn’t even remember what I’d changed that time – it didn’t seem more significant or profound than everything I’d tried before. It was almost more frustrating to see it work for a reason I couldn’t explain than to see it fail.

 

JavaScript works best with a cup of java!

I really think it’s amazing how the languages for computers are so similar, but yet do such different things. It makes it easy to learn a new language (as in learning JavaScript after learning CSS, after learning HTML). It builds upon the last language you learned and makes options more accessible with the more that you learn.

I am worried a bit about getting confused with the syntaxes. I began with COBOL years ago and have become comfortable with it, but it is so similar to JavaScript and HTML that sometimes I find myself writing in one of the languages that I shouldn’t be (as in writing HTML in JavaScript or vice-versa). I am confident that with practice it gets easier, but for the beginner in any language, it is frustrating to constantly be checking to make sure that I am writing in the correct syntax as well as learning the new functions and other options.

Once the learning curve is adjusted for, I found JavaScript to be quite exciting, because it is a language which is intended to “do things” on a web page. I like the abilities of HTML, but JavaScript has the commands that make actions occur, and that type of visual feedback is comforting at a base level for me. It reminds me of the contrast to the frustrations of both HTML and COBOL, where if the code doesn’t work the computer just sits there. That meme that you sent us about the coder’s code working and having no idea why was very amusing and reminded me of many of my colleagues (and if I’m being honest, me!).

I like the slow pace of the Codeacademy, because it is actually teaching a lot of material very quickly, but it makes it seem manageable and not overwhelming. I remember (and STILL have) many of those fat language books you referred to in class (right now I can see three COBOL books, an HTML for Dummies and a SQL book weighing down my bookshelf). The manner I learned COBOL was a trial by fire (and almost fired…) that really made me feel that it is so hard to pick up a language cold, and I wish I had found the codeacademy long ago.

A few roadblocks this week…

A couple of roadblocks this week…

This week was the hardest for me yet, and I found myself hitting the wall and reaching out to message boards more than I ever have before. Codecademy, where I had been breezing through in HTML and CSS, started to become more vague and confusing for me. In more and more cases, instead of saying, “type this,” the instructions were “do this.” I found myself looking back through past lessons and trying to find links to what I had learned and what they were asking me to do, but — no matter what — the code didn’t work. (In one case I think that there was an actual bug on the page, when I deleted all of my code and submitted it the display still came up with type as if there was code present). What I ended up having to do was go to the Codecademy forums and look line for line a code that did work, finally finding out how to structure something seemingly out of thin air.

I also had a lot of trouble with the captions, and figuring out how to attach them to the images so they wouldn’t be on the same page. Once again, I went to the message boards (and Google) to help me solve my problems.

What I learned was that I’m always going to have to rely on a community of experienced coders if I’m going to keep experimenting with new tricks. There are times when I’m going to get stumped and the instructions aren’t going to help me anymore, and I’m going to need to keep an open dialogue with others. Fortunately, the coding community is very responsive and friendly, and there is always someone who is able to look over your code and provide a fresh set of eyes.

Most of the time, especially in confusing JavaScript, one beginner’s mind isn’t enough.

Learning How My Credit is Judged

This week’s assignments, though very basic, revealed the complex functions that help businesses and organizations interact with their clients, customers, readers, or viewers through the Internet – the most obvious example being the “creditCheck” assignment. It was easy to see how more complex code (specifically functions) can help businesses make decisions and process information quickly, remotely, and more accurately. There is no doubt in my mind that I will forever think about what is going on behind the scenes when I visit websites, having now had a glimpse into the “inner workings.”

I can see why these lessons are important to those, namely journalists, who use the Internet to interact with others for work. For example, just as one written word in a newspaper can change the entire meaning of an article, one piece of code can change the entire meaning of a web entry. Knowing and understanding the construct of that web page can help journalists prevent errors, and quickly correct those that are missed. This helps them maintain control of and protect their written word and personal brand, two things that are vital to journalists that are seeing more of their work on the Internet.

As far as Codeacademy is concerned, I like the method used to teach code on that site. However, there are parts that are extremely difficult and require one to go to the Q&A section for assistance. The problem is that not all of the answers given in the Q&A are correct, and it can be a little confusing. I would like to see a page where one could go to see exactly how the code should be written. It’s true, this could encourage users to cheat, but that seems to be exactly what web developers do anyway – use code that has already been written. So why not just let users see the answer, and let them retype it and manipulate it as they go through the courses?

Throwing Your Laptop out the Window is Not the Answer

Last night I had a nightmare that I could not figure out how to add captions to an existing image gallery using jQuery. Then I woke up and realized that this nightmare was reality. It took me awhile (longer than I’d like to admit) to figure out how to add these dang captions. When I finally managed to make it work, I took a step back and thought to myself, “Wow, that was really easy, why didn’t I initially think of doing that!?”

It’s probably because I tend to over-think everything and get easily frustrated. For example, while I was working on one of the functions exercises in Codcademy, I almost tossed my laptop out the window on multiple occasions. JavaScript is intimidating, confusing and downright annoying at times. But, I’m starting to realize that it doesn’t have to be; you just need to try and understand what the code is actually there to do. And let’s be honest, the image gallery does look better with some nice captions and CSS styling, doesn’t it?

So I have come to the conclusion that JavaScript is a good thing (not the devil), and for someone who works at a digital marketing company, it’s important for me to have some knowledge about these programming languages. Earlier today, I informed one of the colleagues that I was taking a web development class, which consisted of learning JavaScript basics. He was impressed and applauded me for making the effort, knowing it’s not easy and not a requirement of my current job position. He also quickly recommended that I read this book “Eloquent JavaScript – A Modern Introduction to Programming.” I glimpsed the digital version and definitely like how it’s intended for people who do not know a lot about JavaScript or programming in general. The descriptions are simple and use plain language. I think it’s worth another glance when I have the time!