Tag Archives: JavaScript

Achilles’ heel

With today’s sun warming our bodies and souls, it is easy to forget how dreadful the past week has been. With the weather that caused our in-person class to be cancelled, we had to settle for a Zoom meeting. What’s unfortunate is that we missed one of the most important classes (at least for me) and had to learn JavaScript by ourselves.

But before I jump into the “journal” part of my post, let me give you some context. JavaScript is a dynamically typed language. It is frequently used in creating websites, as it, for example, provides interactivity of pages, validating forms or building navigation elements. This use of JavaScript makes it easier to use a library such as jQuery. However, JavaScript does not create standalone apps. In the most common case, JavaScript code is located in HTML documents and allows us to enrich websites with interactive elements that would be impossible to obtain using plain HTML code. Even though it may seem that learning JavaScript is quite easy, mastering this language is quite demanding and time consuming.

I believe that online learning is great in a way that students can take a course or participate in a class from the comfort of their home. Online classes often offer alternatives to live meetings like forums, emails, and chatrooms. I am taking an online course right now, PR Writing. Thus, with some experience in writing press releases, op-eds and so on, it is easy for me to catch up with any additional readings or assignments. However, with more engaging and complex classes, allocating additional time for more practical exercises is something that I believe would be beneficial to some students. Unfortunately for me, this week has been very confusing and even though I was able to complete the online course on Codecademy, my knowledge of JavaScript leaves much to be desired.

Dear Duolingo: Consider adding JavaScript

This week I realized that I have begun learning a new language. Reflecting on my past language-learning experiences, as well as my former brushes with code and query languages, will help me set realistic goals and expectations for this new challenge.

One thing stands out to me as being immediately familiar to my past experiences: I know what the code supposed to look like, but I still have trouble constructing the right syntax on my own. The end-of-unit quizzes highlighted this tendency. I usually got the syntax questions right on the first try (just because they looked right), but I struggled with the questions designed to explain why something is done. That is to say, I’m better at reading the code than I am at writing it.

This week’s lesson with the JavaScript console also reminded me of Data Reporting, where we learned the basics of MySQL query language. I remember when I started learning about MySQL that the process of writing pseudo code was critical in the writing/development of more complex queries. It’s also a great mental/emotional strategy when you get frustrated with writing code, because it’s pretty hard to get it wrong, and it helps you organize your thoughts. I’ll definitely be taking the extra time to write pseudo code and add comments to my code as it grows, just to save myself some aggravation.

Goals for the Future

If “getting better at JavaScript” is too broad a goal, I’d like to prioritize getting better at reading the error messages. When I was learning how to use MySQL, the error messages were immensely helpful at identifying syntax and other input issues. In the Java console, however, I’m still at a loss. Luckily, I’ll have plenty of opportunities to practice reading the error messages, because I anticipate I’ll be generating a lot of them in the weeks ahead.

Is there a Duolingo option for JavaScript?

A Question I’m Afraid to Ask…

It’s clear that so far we’ve been creating variables and functions, and then defining them within the code (i.e. the user’s name is “Cole” so let userName = ‘Cole’. But when we interact with web pages in the wild, that name field picks up data from our user profile. What does the code look like that pulls data from another source and into the field we’re using?

Another week, another language

We are diving into the world of JavaScript this week through Code Academy. I think this is one of the more exciting languages, or fun rather, simply because it can be used to create pop-ups. I would like to include some of them in my final project site, not in an annoying ‘my computer has virus and is plagued with pop-ups’ type of pop-ups but a fun, kind of ‘welcome to my site, here’s a quirky joke’ pop-up. Now this is something I will be able to do if I am able to grasp some of the basics, I have been struggling with keeping up with the different languages and their functions within the site. Well, that might not be the best description. I understand what role each of the language play in enabling front end functions, but I’m not always the best at ‘code-switching’ between languages to write the proper code for them to carry out. This was something I noticed last week, when we began incorporating CSS, and I brushed it off as just a beginner’s mistakes. But, now that there are three different languages in play, I am going to have to really buckle down and focus to make sure I’m both understanding and properly writing the lines of code. What I will say is, as I went through the different lessons on Code Academy I was able to develop a better handle on the language by trial and error, as well as actually reading the instructions on the side panel very closely, and not just assuming I know what I am doing—because in fact, I do not. As a bit of extra homework for myself, I will be doing some more research on JavaScript and how other people use it (or not) within their websites, because right now I am not it’s biggest fan.

JavaScript or Bust?

Whew! JavaScript definitely caught me off guard. I had a pretty strong understanding of coding until we got here. Java is kind of like the cherry on top of a sundae. It ties a website together to make it fully functioning. I got lost with the functions and variables. The syntax wasn’t as easy to read as HTML and CSS, so that was my downfall. With JavaScript, the coding looks so complicated; in reality, you could be executing a simple task like making a list drop down.

Progress (Sort of)

My site is coming together. Well, sort of. I have a lot of pieces floating around in cyberspace. The biggest piece, however, is my first customization: the interactive map. I downloaded the Leaflet map plugin, which uses an open-source JavaScript library for creating interactive maps. The API is pretty well documented, but there are some things I couldn’t figure out.

Once I input the shortcode to create my map at the location I wanted it and then created the marker for one of my sites, I was able to figure out how to program it to include photos on the markers. But I quickly realized that I did not understand the interface. Before I installed the plugin, I was convinced that I had missed the mark and that none of my customizations would be code customizations because they could all be done with plugins. When I started the work, I figured out that you can type code into plugins (duh). Then, I realized I don’t understand the relationship between plugins and APIs.

Troubleshooting my map plugin helped to give me a basic understanding. I know that a plugin contains groups of functions and is written in PHP. I know that the Leaflet map plugin uses a JavaScript library. This part confused me. When I was writing code for my map, I was confused about which type of file to create in Sublime Text. I settled on JavaScript but as I was typing my code, my mind wandered to if I should create HTML and CSS files to accompany it. At that point, I knew I was overthinking.

Though the map plugin boasts about its well-documented API, it’s still a little hard to understand for me as a beginner. It has lists defining elements, events, methods, and options, (?)  but I get confused about what exactly to type since programming is very specific.

I also had problems with issues with FileZilla. When I tried to connect, I kept getting an error message.

I have one lingering question. What is the relationship between an API and a plugin?

The Internet is like onions. Onions have layers.

Learning PHP felt a lot like JavaScript. At points, I got the two programming languages mixed up because of the use of the $ to define variables in PHP and its use in jQuery. I think I’m definitely getting a better feel for it because when I’d slip up on jQuery/JavaScript, I’d be stuck for hours. When I messed up on PHP, most times I knew exactly what I was looking for to fix my mistakes. It also helped that the PHP website tells you which line the error is on.

The PHP lesson also made me notice a concept that I had previously glazed over, thinking I understood. While we used jQuery primarily for interactive purposes and to give us actions with visible results for everything, the PHP lessons in the beginning primarily focused on using data and selecting things out of arrays. On this lesson, the author says we will focus on it as a programming language and not web development. Previously, I didn’t realize there was a difference. I recalled the Codecademy lesson on functions in JavaScript , in which we programmed these functions, but they did not visibly add anything to the structure of a website.

My initial thought after learning more about WordPress was that I need to take it off my resume. What I know about managing WordPress is comparable to taking a French class and trying to speak Haitian Creole. I knew WordPress as the site that hosted my e-portfolio, blogs I once had, and a niche site that I created about the Harlem Renaissance for a project once. I know how to upload content into WordPress using the themes and templates, but I didn’t know anything about hosting a website, which is what I thought (think?) journalists are referring to, after having countless lectures about creating our e-portfolios on WordPress because it’s the industry standard. Now, I know that there are even more levels.

Yikes.

We’re at the halfway point (or near it, at least). Just when I thought things were going great and I was excited to put what I learned into action, it all blew up in my face. I thought I had a pretty good grasp on jQuery but this week, it slipped through my clutches.

Here are a couple things I learned:

  1. If something doesn’t sound familiar, ask for help immediately. Don’t assume it is just another way to say something you already know.
  2. Write down thorough notes when doing the Codecademy lessons. I did this with my HTML and CSS lessons, but stopped writing as much when I got to JavaScript and jQuery. Once it was time to create something of my own, it was harder to recall the step-by-step.
  3. Attention-to-detail is key. Coding is particular. One wrong character and all the slides that were previously hidden show up again, even though you just figured out how to get your button to work after spending hours just figuring out that you had to load the jQuery before the JavaScript in your HTML (true story).

If you couldn’t tell, this week was challenging. This video helped me a little, but I still couldn’t quite get it and I still don’t know exactly what it is that I don’t know.

Here are a couple specific questions I had:

  1. When working in JavaScript, do you use language from both jQuery and JavaScript? Or is it that once you load jQuery, you have to use it the whole time?
  2. How do you increment/decrement in jQuery(/javaScript?)?
  3. What am I doing wrong when trying to increment that makes all of the slides come back up?

Anyhoo, jQuery will not take me out without a fight. I’m coming to class with my pencil ready, and my mind clear.

Here’s a sneak peek of what you can expect for my midterm:

Diana O. Eromosele is a software developer at Newsela. She is also the founder/developer of categorizedtweets.com, a tool that sorts politicians’ tweets out by issue so constituents can easily take a quick look at what they care about. When she’s not busy coding, Diana also teaches web development languages. She has a journalism background. Look out for my profile to find out how/why she made the switch!

An Uphill Battle

It is no secret that the gallery assignment was a tough one. The entire class — not an exaggeration — struggled with completing it. So what is the gallery assignment, anyway? Our class was tasked with creating a homepage (easy-peasy) that contained a slideshow of photos (not so easy-peasy). The HTML portion of this assignment was like a walk in the park. A few brackets here, a heading there, and throw some divs in the mix — you’re good to go. The CSS was a little tougher. Figuring out the exact numbers I need for “top” & “width” (what the heck is auto??) & trying to decide if my position should be relative or absolute probably took me a solid two hours. But, CSS turned out to be no match for the evil-two-headed-monster that is JavaScript & jQuery. Missing class didn’t help, but I think even if I were there I would have still had issues. Dollar signs, squiggly brackets, and commands that didn’t make sense to my human brain — all hope felt lost.

I tried, tried, and tried again to understand how to make it work. The internet was helpful, but also confusing. Every source had a different way of doing a slideshow, so there were no basic commands I could turn to. I was plugging and chugging in different things from W3 schools, Youtube, Wired, and some smaller sketchier sites. I spent hours trying to make it make sense. I left and came back. Still nothing. I left again and came back again, and still nothing.

It just didn’t work.

So how does my tale end? I eventually gave up. I plugged in an automatic slideshow from W3 schools and begged for forgiveness in the /* comments */. It wasn’t a proud moment.

Still, all was not lost. We took the time in the class period following the assignment to really dive into how to do it. All was explained, untangled, unmangled, and demystified. For now, the battle was won and our men could return home.

But, whispers lingered in the air of a more terrifying conquest looming in the near distance. The natives call it: “A whole entire website, like seriously.” I fear what is to come, will my men survive?

The jig is up.

Oh, JavaScript. The most popular programming language.

With HTML and CSS, I felt comfortable. I thought I’d be able to conquer anything. Everything was a breeze. Coding wasn’t that bad, after all.

Until it was.

I felt like I was in math class all over again. I was reliving my worst nightmare. The last two lessons almost defeated me. But just like math class, I realized that I just had to practice to prevail.

At first, I was really confused as to what JavaScript did. Why were we adding numbers and doing true/false equations? What was all the craze? Could I not do these things with my calculator? I slowly began to realize that the adding and subtracting, were just the foundation for larger functions, like creating widgets, games and apps. And just like in math class, if you mess up the basics, the whole equation will come tumbling down. Needless to say, I’ll be revisiting the lessons.

The hardest thing for me was remembering the syntax and all of the necessary elements of a function. After Tuesday’s online class, though, I was reassured in knowing that no one fully memorizes everything in JavaScript. I’ll just have to make a (or find) cheat sheet.

Another thing that baffled me in the Codecademy lessons, specifically, was that the system would sometimes return a syntax error, but I’d still get a check in the box. I found myself restarting the lessons over and over, trying to note the differences between what I typed and what Codecademy wanted.

One good thing, though, is that I fully understand what jQuery is used for. I think whoever wrote that library is brilliant. I also think that I will eventually be able to fully grasp JavaScript. It’s just a matter of time and practice. As I reflect now, I realize that I wasn’t struggling as much as I thought I was. It was a lot of material, but nothing I can’t handle.

JavaScript is…

JavaScript is a the coding language that allows detail to your HTML, similar to CSS but more details. JavaScript is the mostly used language and makes up a huge section of web development. When working with JavaScript, I knew it would become very complex and very out of my box, being that I am a beginner. I did become frustrated with it, being that it has so much detail, but once I continued to stick with it, it became easier. I never thought that I would actually learning how to code, although this is still a new concept to me. I really wonder if I will continue with this or just learn the basics. I would love to keep up with this skill, but I am also asking if this is truly for me and something that I want to be apart of my life. It is still early and I think I have time to discover this. But I do see how all of the languages are coming together to work together.