Tag Archives: programming

Programming Language 101

Just as I was last week, people who have never had any close contact with programming are afraid that it is extremely difficult. However, it is worth realizing that programming is nothing but a process of learning a new language. Obviously, beginnings are always difficult, but once we learn our first programming language, studying new ones becomes easier. Right now, we are not learning programming because of the need to change a profession, but because it is important to guide our minds to a resourceful way of thinking, which is essential in the field of communication. Even if our careers are/will not be related to programming, these compact skills will help us to better understand the problems that can stand in our way in the future.

What’s more, learning programming involves not only acquiring new knowledge about coding in different languages, but is also a great way to work on ourselves. It is as effective as solving logic puzzles such as sudoku, which helps to train your mind. In addition, programming teaches consistency and organization. Namely, while writing a line of code, we must plan and implement next steps necessary to achieve a goal, which includes application of the most efficient solutions.

To conclude, a good programmer has to be like a writer. He/she should not only know programming languages – most of all, one must be able to think in an analytical way, to break down a problem and prepare component elements from which a given program can be later developed. Just as a writer creates his work to make it interesting for the reader, the programmer creates a program that is supposed to be as effective as possible. Thus, the ability to understand a problem, which often involves the need for interdisciplinary thinking, is essential. However, it all comes down to a programmer facing the need to translate the gathered knowledge into a programming language.

Learning the basics to code

Coding is an important skill more than ever today. It seems to be a skill employers are looking for more from aspiring journalists today. Learning the basics to it today reminded me of learning how to do different math problems back in high school or college. Not because the basics to coding are as complex, but because the process of learning of them is similar. Learning how to do a math problem usually starts by watching the teacher complete a similar problem on the board. Often, you will follow along and understand the steps the teacher is taking, nodding along as the teacher arrives to the answer. But, once you sit down to do a problem yourself, it is impossible to evaluate how well you grasp the material. Without the teacher’s help, you’ll come to understand what confuses you or what steps you’re forgetting.

Similarly, when I was going through the Codecademy exercises, there were times when I would run into trouble and use their “show me a hint” feature, which was usually helpful. But if I was still stuck, I eventually noticed that you could ask for the solution. While I appreciated that feature when I was stuck, I also think it offered a bit of false comfort. I could nod along and tell myself I just had a minor error and *basically* had everything right, that is not actually the case.

With coding, minor mistakes have enormous consequences. Or so it seems to a beginner. Forgetting to close a tag or include a quotation mark can make the difference between the code functioning or not. As we go along, I am trying to figure out the best way to learn through Codecademy — when to struggle with the code and when to ask for a hint, or when to struggle with the code and when to ask for the answer. Moving to the next slide was helpful in itself because, just like a math problem, sometimes you need to just look at a new problem.

Metaphor is key

I’ve never been great at left-brain thinking — math especially. Reporters are notoriously bad at math, so that was one more thing that helped me fit into this profession.

But the further removed I’ve become from the feeling of stressful confusion that dominated my experience in math and other classes that generally served as precursors for those who went into computer science careers, the more interested I’ve become in the prospect of learning code. Computers aren’t going away.

Getting past the jargon of programming will be a huge hurdle for me. I love deciphering jargon — good journalism writing is being able to cut through jargon and clearly explain concepts to readers — but up until I really understand a concept, it’s difficult for me to connect the dots for myself, let alone readers. That’s why Greg Linch’s post on computational thinking was so helpful.

Specifically this passage, from Jeannette Wing’s article that Greg pulls is very helpful for getting in the right frame of mind:

“When your daughter goes to school in the morning, she puts in her backpack the things she needs for the day; that’s prefetching and caching. When your son loses his mittens, you suggest he retrace his steps; that’s backtracking. At what point do you stop renting skis and buy yourself a pair?; that’s online algorithms. Which line do you stand in at the supermarket?; that’s performance modeling for multi-server systems. Why does your telephone still work during a power outage?; that’s independence of failure and redundancy in design…”

Metaphors like these will greatly help me de-mystify the definitely mystifying world of computer programming and instill some much-needed confidence when I’m tackling topics like this.

I also felt super mellowed out when reading the Zen of Python post. Many of these mantras work for life.

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.

Especially in regards to the “explicit is better than implicit” piece, I’m getting a sense that writing code is a bit like doing the work of an observant reporter — one who shows rather than tells — but it’s even more akin to writing a screenplay. When doing screenplay writing, every action is clearly denoted and explicitly stated. Actors in a horror never “feel scared” in a screenplay. They start to sweat. They clench their fists. They dart their eyes around. Their intention and thoughts are only conveyed through action.

It’s a very different way to think about writing than what many of us are used to, but learning it has helped my journalistic writing.

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.

Anotha One – PHP

I hope you read my title in DJ Khaled’s voice. If not, the reference went over your head. I do know how to spell. Anyway, I can’t believe we’ve been in this class for 7 weeks already. This week we learned PHP basics. This is one of the most commonly used programming languages of today. It’s an interesting language because it can be written in PHP, then the output can be written as HTML. Another interesting thing about PHP is real numbers are called ‘floats.’ I’m proud of myself because I actually caught onto this new language really quickly. Learning PHP would not have been so easy had I not started with HTML, CSS and then JavaScript. I feel like the puzzle pieces are finally coming together. Another thing I want to note is I really liked the website we used for the tutorials. The exercises were fairly short, but easy to follow. It was also helpful that the instructions were written in comments for the exercises.

Thus, my confidence in my coding has increased. This may sound dramatic, but I really feel like my learning this new skill has inspired me to get back to learning. As a senior in college, I’m in a stage where I’m perfecting the skills I need for my desired profession. I’m so hyper focused on that, that I had convinced myself learning any skills outside of that would only be a waste of time. I’ve changed my mind. Having a diverse set of skills makes me more marketable for any field. In the event that I decide to switch gears, I have a whole gamut of skills that can transfer to a number of different occupations. I’m going to keep reminding myself of that as the year progresses. Who knows, I might switch up and decide to go into the tech industry.

It’s Almost Midterm Season

I missed most of the class this past week, so I don’t have much to say on that end. Based on what my peers have told me, the gallery assignment is a little daunting I even got told: “for real though you should try not to miss that class [redacted] is hard.” Ha. So I will do my best to attend every class for the remainder of the semester. (I will be in California on Oct. 4, but we can discuss that at another time).

Anyway, I will talk about my midterm project now. I did an interview with Brittany Ohalete, a senior in the school of engineering. We share a mutual friend, which worked out so perfectly. Brittany Ohalete is unique because she is an artist and a developer. She has a pretty popular graphic design business — called BOPHO — where she creates custom logos, event/party flyers, Snapchat filters, CD cover art, and more. On the other end, she is a full-stack developer. (Sidebar: it’s pretty cool that I even know what that means now.) She fluent in about 6 or 7 programming languages and loves to learn new ones as well as developing frameworks. I’ll end it here, as not to ruin the actual project.

I have written a little over half of it now. My next steps are to finish it — duh. Edit, rearrange, make things more concise, tighten up quotes etc. etc. I don’t really know the direction I am going with this profile, though. It feels as if I am just rambling. I think I need to figure out my hook and how to move the story to a natural progression. When I read profile articles from The Guardian or The New York Times there’s always a very strong hook. All the material is there, I just need to find a better way to organize it.

A Little (j)Querious

jQuery is a JavaScript library that makes it easy to add dynamic behavior to HTML elements. Libraries in the JavaScript community are collaborative collections that extend and ease the use of the programming language. For example, jQuery can do the same function as twelve lines of JavaScript in just three. A good analogy to better understand jQuery comes from Codecademy. You can think of JavaScript like a bunch of individual Lego pieces, all the necessary tools to build grand things are there — it just might take a long time. Well, jQuery is like pre-made building tools. So instead of using individual Legos to build a car to put in your town, jQuery is just the car ready to be placed in the larger scheme of what you are building.

While I’m learning these new programming languages, it’s interesting to compare how these are similar to the language (or languages) we speak everyday. So this has me ponder: what in the English Language could be analogous to jQuery? What comes to mind first are contractions for words. Instead of cannot or do not or I have we instead use can’t and don’t and I’ve. These remind me of jQuery because in place of using the individual words to help portray our ideas, we insert pre-packaged words that still get across our point without using so many characters or in most cases combining two words. In both instances, conciseness is key. Lengthy, wordy, and down-right redundant speech is pushed aside for the brief yet comprehensive.

Approaching these programming languages from a linguistic point of view really helps in my understanding of these new concepts. Stepping back and looking at new concepts from a lens in which you are comfortable with is essential to learning. Many things in this universe are connected. There’s certain patterns that exist across species, languages, science, and math. I guess this all goes to say, you’ve always been aware.