Techdegree Journal 3 “Don’t Repeat Yourself. Seriously Don’t.”

Reading Time: 2 minutes

IMG_3521

Summary

I often like to take time out of coding on my computer, to go over old notes that I have written. What I have found is that once I’ve gone ahead and learnt new things, all the concepts that I found difficult, often like magic makes sense and this is where I get my lightbulb moments!

IMG_3518

One of the concepts that I found difficult to get my head around what is the “Don’t Repeat Yourself” (DRY) philosophy that was taught by the excellent Guil Hernandez on “CSS basics ” course at Treehouse

Guil explains that:

“DRY is a CSS philosophy where your aim is to write the most effective code with the least amount of lines possible. Repeated code makes the CSS style sheet harder to maintain and makes the browser work harder.”

Thoughts and Takeaways 

The DRY concept in a way it is like watching “The Sixth Sense” Movie for the first time. You think that you understand what’s happening and then the surprise twist at the end makes you realise that you’re watching a different movie all along (Damn you Bruce Willis!)

Initially I thought that DRY was concerned with the use of IDs and classes. But might been diesels voice, DRY goes a lot deeper than that. As I started to embrace dry, it helped me make my code cleaner, easier to understand and more readable.

For example, I saw the use of drying using shorthand. If I wanted to change the attributes of my particular font would be like so:

font long

Whereas if I use the font shorthand, it would be:

font long copy

Same thing but uses less lines of code:

Also HTML5 includes new elements that help make your markup more readable. For example if I was styling a simple webpage and I was creating containers, I would have to use with IDs & classes to describe what they are like so:

div

Whereas with the new elements, they are self explanatory. Also notice there are less lines of code.

nav

Key Takeaway

Taking time to learn how to use class is affectively, learning shorthands and using new HTML elements can make your code leaner, cleaner and and help you become a better coder. It did for me!

Catch you again soon!

Karlwebdev

Advertisements

Book Review “Show Your Work”  by Austin Kleon

Reading Time: 5 minutes

IMG_3487

Introduction

Hi guys! Here’s another quick book review and today I’ll be reviewing “Show Your Work” by Austin Kleon. I read his first book “Steal Like An Artist” and loved it and over a smoothie decided to share my thoughts on his follow up…

Review

The book does exactly as it says on the tin: Kleon’s book is all about creatives sharing their work and making an impact on the world: whether it’s growing their business, sharing their applications/programs or serving their community. In a way I feel that it’s a sequel to his first book “Steal Like An Artist” which is all about how an individual could to grow in their craft by emulating the work of those who have come before and I would recommend buying/borrowing or (stealing) that as a companion to this book.

First of all you will be struck at how beautiful Kleon’s book is. “Show Your Work” displays Kleon’s distinct freehand style that has many simple yet profound drawings scattered throughout the book, adds a visual element that keeps you engaged in the content.

IMG_3488

IMG_3490

IMG_3489

Two ideas that I felt were the main themes of the book were:

  1. You don’t have to be a genius – Join a group of talented and creative individuals and learn to contribute.
  2. Think Process not Product – creatives need to stop obsessing about the finished product and learn to take your audience with you, behind the curtain, & let them know what makes you tick.

Kleon’s style is very personal and friendly and it shows many of his own personal processes, struggles and breakthroughs.

How this can help you

At 215 pages long (And with lots of pictures) it’s not a mammoth read and I read most of it in over an hour on the train. But I found myself referring to at least every other day since I got it.

Those of you who (like me) are learning to code find this an inspiring and motivating read, that will courage you to seek out and connect in the coding community and encourage you to expose your projects to the wider world so that you can get the much needed feedback, critique & support to help you on your journey.

One key idea that stood out is to have amateur mindset. Kleon argues that the world is changing at such a fast rate that we are all becoming amateurs, and to stay ahead we need to commit to lifelong learning. This is even faster in the world of tech with so many languages & frameworks becoming absolete at record pace, coders need to stay humble & open to learning.

As a coder who is at the beginning of their journey, it’s incredibly intimidating to talk about, research, and contribute your ideas to the world of code. But the ideas in this book have taught me that the only way that you can truly learn is to “show your work”, collaborate and open yourself up to new experiences that one enhances yourself and others around you. This book is part of the reason why I started this blog.

Also those who are interested in building up this social media presence, Kleon shares many gold nuggets of advice on the structure, selection & curation on what content you should share. But you need to read the book to find out more!

It’s not a strict ‘how-to’ Book but Kleon’s book contains many ideas are you be continually refer to again and again.

I fully recommend this to any beginner coders as this will serve as helpful guide throughout your journey.

Karlwebdev

3 Things Every Newbie Must Know About Coding

Reading Time: 5 minutes

Everyone-should-know-how-to-program-a-computer-steve-jobs-840x560

Introduction 

Officially on July 17th, 2015, was the day I decided to take coding seriously and started the journey to become a web developer. Learning to code is like riding a rollercoaster: there will be times that you will be climbing up the track and will feel like you are “on top of the world”. Then there will be other times that you will be plummeting feeling sick and this disorientated!

In honour of my first year anniversary, he is free critical lessons that I discovered and it will hopefully hope you have a smoother ride!

1.Coding Is Hard… But That’s Good.

The Internet has millions of fantastic resources that will help you learn to code. But as fantastic as they are, you must be aware of some of the “mistruths” out there. Websites and books that say “learn JavaScript in one hour “or “learn python in one minute” tempt us newbies into thinking we can book on the next mark Zuckerberg in the same time it takes to make your instant coffee!

But what I have found was that although I was making functioning website or programs, I still lacked the understanding why it works. As soon as I came across a bug or a glitch, I had no idea how to even begin to fix it and that’s where my greatest frustration would lie.

But slowly I discovered the best coders do 2 things:

  1. The best coders are excellent at troubleshooting and debugging the code.
  2. The best coders use code to solve other people’s problems

That’s also what makes coding so satisfying. Your ability to overcome these obstacles, whether in your code or solving a need, is what makes you valuable. Don’t shy away from problems – embrace them! This takes time and effort. Expect that coding is hard and don’t beat yourself up if you don’t feel you’re making fast enough progress. Be kind to yourself.

2. Coding Takes Time & Effort

Some resources will convince you that with “as little as five minutes a day, you would be able to code like a professional in one month”– unlikely. To be a good coder need to significant investment of considerable time and effort.

Let us take it from another angle: as you know, great relationships need time and presence to make them grow. Going on the dates, the phone calls, the walks in the park, the ‘cards and the candy’ light that spark and keep the flame alive hopefully for a lifetime.

Likewise I have learned that you need to buy the books, attend the talks, go to the workshops and chill at the hangouts to become a better coder. Just one resource is not enough, otherwise you will plateau. Carve out one hour of your day at least: skip that reality TV show, wake up slightly earlier, reach out to people on Twitter/LinkedIn/Facebook and network of people in the field. If you get stuck with one resorts, switch gears and try something else – it will be pay off!

3. Coding Is Totally Worth It.

Coding is hard and takes time and effort but it’s a wonderful and enjoyable skill to learn. To me, coding is as close to magic as I’ll get on this side of Hogwarts.

Despite all the frustrations and days of confusion that I inevitably get while learning, when I write a piece of code and it renders correctly or I fix that bug, there is no feeling in the world like it.

The reason why I feel so deeply in love with music was the idea that I could create something from my imagination and present it to the world. Coding allows you to do the same thing and once you get the bug (pun intended) you won’t stop.

I’ve come to realise that coding is not a sprint nor a marathon – it’s more like a really long steeplechase.

Youth+Olympics+Day+4+Athletics+gyK80y2k7yjl

Will be times that you will be gliding on the track, then your find yourself jumping over hurdles face first and some ditch water – to get up and do it over and over again. Code is everywhere and even if you don’t take it as a career, learning to code will gives you the passport to see how technology is changing the way that we live, way beyond what our grandparents physically thought was possible. There are still days I want to give up, but it’s the lightbulb moments that makes the struggle worthwhile.

Thank you for reading, sign up to my blog and leave your comments.

Share this post on all your social networks & tweet at me @karlwebdev