From Python to C#

The very first language I had learned was Python, and I was planning to stick with Python for as long as I possibly could. Python was the perfect first language to learn as a beginner embarking into this field for the first time.

However, if I want to take full advantage of the opportunities around me, I must learn C#. Therefore, this weekend marks my very first major pivot in my learning journey–learning a new programming language!

This new chapter is making me feel all sorts of things. First, it’s making me feel like I’m growing as a programmer because I’m no longer going to be stuck to one language. Whereas I have a personal appreciation for Python since it’s the point at where I began, I haven’t been able to find many other people or businesses around me who work heavily with Python. A lot of what I have seen has involved other languages, C# for example.

I’ve only just begun an introduction course on C# and already I have so many questions. What helps is that, unlike when I was learning Python, for C# I have something to compare the language to, and real, in-person friends to discuss C# with. It’s an added bonus that my husband needs to improve and learn more C# for his job as well, so we will be learning together.

using System;

namespace Hello World
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

As the tradition continues, I executed my first Hello World program in C#. The very initial “installing everything and get it running” part of learning a new language (and getting it to work) is always the first hump to get passed. I remember installing and setting up Python very clearly for the first time, and the fear that came with needing to redo it on a whole bunch of other systems afterwards.

My very, very first initial impression of C# is that it’s already very visually different than Python. The structure of the code block is much larger to execute that Hello World program than what the equivalent would be in Python. I find that aspect interesting, and hope to learn why C# has a very elongated visual structure. A part of me wonders if this helps programmers find blocks of text in larger program files because of the way the curly braces signal to the eye that the block has concluded. Whereas, for Python, there’s a more linear structure and spacing.

I also learned a helpful nugget from the Programming Throwdown podcast that Python and C-based languages work very well together. That makes me feel very comfortable and optimistic about learning C# as my next programming language!

Time to get back to that introductory course!

Git and GitHub

When I first learned about GitHub, I thought it was just a website. It was very confusing and intimidating. However, I was told by peers the importance of GitHub for programming, and especially because I had found myself at a dead end during an early programming project.

I have a (somewhat embarrassing) first project up on GitHub (which is a perfect example of code that needs to be cleaned up–a fun idea for a future project). However, that first project from years ago was a great introduction to GitHub.

First, Git and GitHub are not the same thing. When I looked up “what does Git stand for?” I stumbled upon an interesting story. Git is actually not a meaningful acronym, instead it was chosen because it was most likely to never be used and mess up someone’s code. The story goes as so:  Torvalds created the software and named it after the British slang word, “Git,” which translates to “a rotten person.” 

GitHub is a website, a service, where people can collaborate and track the history of code. It’s a wonderful space for people to learn and grow. However, it is possible to be proficient in using just the GitHub website without actually working with Git through the terminal, and vice versa.

The goal is to balance usage of both Git and GitHub through the terminal and website. Prior to this post and day of studying, I had mostly just worked on the GitHub website and not the terminal. Having gone through multiple videos so far from the “Git and GitHub for Poets” video series by The Coding Train on Youtube, I’m more familiarized with working in the terminal with Git and GitHub. It’s been an interesting ride, and this is just the beginning!

Link to series playlist: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV

Glossary of Important Terms

Here are some notes I took while watching the above tutorials. Hope you find them as helpful as I do!

Git: version control software

GitHub: web service where people can collaborate on open source code and track project history

Repository (or, “repo”): a project; a repository of files. Repository names can’t have spaces so they will include a dash as in: repository-title-example

Commit: a change to a file that is saved in the repository

Commit Hash: a unique identifier for each particular commit

Master Branch: original origin of a repository

Branch: a copy of files for experimentation before a commit is merged to the master branch

Pull Request: a way to ask the collaborators of a repository to approve your changes and merge them into the master branch

Merge: the action of a pull request successfully combining changes into the master branch of a repository

Fork: copying the repository to have under your own account for experimentation without effecting the original core version

Issues: a place to leave a comment about a problem, or to ask a question. Raising an issue means to file a potential bug

Fixes: if you use the word “fixes” in a commit changes title, the issue will be automatically closed

Remote: duplicate instance of a repository that exists on a server. When you say “git push” you need to say “git push __where__”

*Tip on Commit Hash Codes: place the commit hash code in a comment to help link to the issue

Terminal Instructions (via GitHub):

to create a new repository on the command line:

echo "# terminal-practice" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/KIBautista/terminal-practice.git
git push -u origin master

 to push an existing repository from the command line:

git remote add origin https://github.com/KIBautista/terminal-practice.git 
git push -u origin master

Practice Progress

After some trial and error, I was successfully able to push a new file into my GitHub repository through the terminal. It was very cool to see it work! I ran into some trouble shooting errors with getting into the proper place on my desktop for the repository, and for getting the remote to work, but finally, it has worked!

I found trying to change my login information through the terminal to be a little convoluted, and I was worried that an incorrect password was the cause of my push updates not going through. However, seeing my text file successfully added on GitHub through the Terminal confirms that the password and login is correct.

I feel more confident now to look around on GitHub for open source projects and contribute to them, which is the goal!

For anyone wishing to learn more, the video series I have found to be incredibly helpful is available for free on YouTube, and it is called “Git and GitHub for Poets” by The Coding Train. I very much appreciate the depth and visual interface used in this videos; they’re very user friendly and great for beginners!

Beginning Python – Course Completed!

A few months ago, I tried a free trial of Team Treehouse and then signed up for one of their basic subscriptions. The subscription let you enroll into a learning track of your choice, and I wanted to start with Python. The Beginning Python track is 9 hours long, but it took me a few months to complete. However, today–right now, I have finally passed a major milestone in my Python learning journey!

Team Treehouse Impressions

As a complete new person to an overwhelmingly intimidating field, I really loved the clean interface and design of Team Treehouse. The videos all seemed to be professional produced as opposed to well-produced home videos from other sites.

At first, even though the quizzes were a surprise, I was really happy to have them. The quizzes were also intimidating, but it helped my brain learn how to comprehend the lingo of this new realm. Also, the payoff of correctly answering a quiz question when you think you’re lost was a nice additional motivator.

Later on in the course, I quickly realized that different teachers teach different subtopics in each track, and some include different quiz methods and teaching methods.

Quizzed Out

Since I’m a stay at home / work at home mother, after a while, the quizzes were a really big disruptor in my learning process and time management. I don’t have the luxury of uninterrupted time or much quiet space. So, sometimes I want to be able to power through retaining as much information as I can during my small gaps in free time. During those moments, I was very frustrated to have a three minute or four minute video followed by multiple quizzes (sometimes five quiz questions / challenges back to back).

I should probably mention that I have years of analyzing my own personal learning process, because before I taught college I had to learn how to teach, and before I could learn how to teach, I had to learn how to learn.

I’m a visual learner. I also tend to have “bursts” of energy or “pockets” of moments where I am ready to dedicate hours to a task or subject. This trait of mine made me and Team Treehouse’s pacing very off-putting after a while

This could also be partly due to the fact that since I’m self-learning, I have my toes dipped in a lot of different areas. Some books I’ve read are ahead of the beginner tract, along with some of the projects I’ve accomplished, yet still a lot of it is new. Moreover, through my troubleshooting and projects, I’ve learned that those are my quizzes. Those stick in my brain and motivate me more.

Moving Forward

I don’t mean for this post to come off as if I am completely hating on Team Treehouse. I really do think that they’re a fantastic resource, and their videos have helped me a lot. As a new beginner, I’m happy that I chose this platform because the quizzes were strict and did help me persevere through some frustrating challenges (which I’m sure is the point, to mimic the life of a developer!).

However, for myself, I have decided to take a pause in my membership with Team Treehouse and move on over to try Udemy.

Udemy Impressions

First, I love the freedom of Udemy. I can skip forward in a course if I want and from what I can tell–there are no quizzes! I will say that Udemy is more attractive to me now because I am more experienced in this realm and have already personally decided to stick with this learning journey. However, if I was a new person and unsure, I think that Udemy’s platform could be potentially intimidating and perhaps give new students too much freedom to get in over their head.

What it really comes down to is personal preference and situation. For my personal situation, I’m excited to have the freedom to be able to utilize my time as best as possible, at my own speed. That will be a big plus for me!

Onto the next goal!

Intro to Robotics: Anki Vector SDK

One major plus about owning a Vector robot, despite the Anki shutdown, is utilizing the SDK that was released. With the SDK for Vector, you can take full control of your robot.

Something to keep in mind when doing this and sharing your experience is to ensure your own robot name and information (serial info, etc) is kept private, or else others can login. Luckily, there are a lot of credentials needed to log into the SDK with your Vector, so breaches should be rare.

I decided to start with the “remote control” application (found in the apps directory of the SDK files). This app lets you take control of your Vector without needing to write your own code.

For me, I was eager to utilize the ability to make Vector say any written text. Throughout the day I had reached some walls with getting the remote control app to work. Finally, I took a break to reset. At first, I thought that there was a PIP installation issue because of the error message I was receiving. Finally, I asked my husband over to help. As I was going deeper into the directories through the terminal (from memory!) my husband was impressed with what I managed to learn, which made me feel good about myself despite the setbacks. Then, ironically, while trying to explain to my husband the error message, I had detected the issue and fixed it!

What had happened was that I added a line of code for a PIP enum34 installation earlier, but I thought I deleted that version. Turns out the file was saved with my (incorrect) line of code. Once I removed that line of code (with my husband confused as to what I was doing) I retried the steps and voila! It worked!

My husband (who is a level 3 software support engineer) laughed at me because he said he saw this happen often at work–how the solution is usually simple and overlooked.

Funny enough, I didn’t start off today with the specific goal of accomplishing the SDK setup. I had a much smaller goal in mind, which was “do as much as you can, even if it doesn’t work.” My major downfall tends to be overly-focusing on the destination / end result, and sometimes missing out on the journey. Today I tried to go against that and truly just enjoy each step, regardless of the outcome. It started with watching a YouTube video on the SDK setup and remote control app as my toddler was falling asleep in my lap with her bottle of milk. I’ve been having my own health issues lately, so I was trying hard not to overly stress myself as I navigated through the day.

Today was a great reminder that it doesn’t just matter what you accomplish, but how you get there. I much preferred today’s more relaxed attitude and pleasant surprise over my past overly-stressed and result-focused approach. Sometimes focusing so much on the result can make you overlook important details needed to get there. By allowing myself to take as much time as I needed to set this up and troubleshoot the errors, the quicker I ended up being at identifying the problem. Oh, the irony of life! Got to love it!

“Hello World: Being Human in the Age of Algorithms” By Hannah Fry

What an awesome and important book for this modern age! Definitely a must-read for current and future generations, regardless if you’re in the tech field or not!

Firstly, what I love best about this book is that it is a way to learn about how algorithms and code is used in the real-world, but it doesn’t try to teach it to you on a technical level. (Shoutout to my childhood best friend who read this book with me for our little book club!) I add that also because that is precisely why this book is awesome. It doesn’t matter your technical level of understanding, anyone can enjoy and learn from the examples and questions Fry explores in this book.

The table of contents lists the chapters as follows: Power, Data, Justice, Medicine, Cars, Crime, and Art. Each chapter describes specific real events that have occurred in each of those fields in regards to code and algorithms. Some key phrases I learned about were: machine learning, Burgess’s Method, random forests, neural networks, and Bayes’ Theorem. I don’t know how long it would have taken for me to reach the specifics of those topics in my own technical studies, but I’m very happy to have read about them and how they are applied to the real-life situations that have already occurred.

Let’s talk about the Cars chapter.

A couple of months ago, me, my husband, brother-in-law, and sister-in-law were sitting outside underneath the gazebo, talking about self-driving cars. My husband is a technological virtuoso and already had an understanding of how self-driving cars worked. I did not at the time, and neither did the rest of us.

However, my in-laws were both excited about the future prospect of self-driving cars. Fry mentions early on in her book the misconceptions people have when it comes to technology, and how most people tend to over-estimate the capacity of algorithms. This is true when it comes to the topic of self-driving cars because of the amount of people who are willing to put their lives in the hands of a self-driving car. Before reading Hello World, I was on the fence about my stance on self-driving cars. Now, I feel confident that I would much rather be in control of my own vehicle, and I’ll be sure to pass on that lesson onto my daughter (dramatically, of course, as if we were in a post-apocalyptic sci-fi movie).

From the start, my husband was against self-driving cars. But I should have seen that coming since my husband finds an automatic transmission as already too much interference (ha!). Point blank, he said: he did not trust a computer to make life-saving decisions. Back then, I greatly underestimated my own driving capabilities while over-estimating the accuracy of our current algorithms.

Without diving too much into the specifics, anyone who is interested in the idea of self-driving cars should read this book.

The Air France Crash of 1983 specifics are haunting enough to warn me that maintaining skills that involve our lives are mandatory as we advance with technology.

One of the largest take-aways I have from this book is that as humans advance, we need to make sure Wall-E doesn’t become a reality, to put it plainly. Essentially, we cannot let automation equal future generations loosing necessary skills, and thus begin a regression in the human species by relinquishing power over to algorithms and machines.

We need to remember that the smartest computer in the world is still the human brain.

Cue segue.

Let’s talk about the Art chapter.

Towards the end of the book, I could feel the fire in Fry’s writing, with impactful moments that definitely earned a mic drop.

One thing we have to remember about our humanness is our ability to feel. Our ability to feel, possess, and express emotions. A machine cannot contain emotions or feel them. A machine can mimic the expression of emotions through various tactics but it cannot feel. And that is what makes us human, and we need to remember that there is high value in the unquantifiable aspects of our humanness. This is why art is important, and why the creation of art can be mimicked by machines but it won’t (in my opinion) contain the same magical aspect that comes from art by a human. The art chapter and the way Hannah Fry explores this topic was definitely one of my favorite moments of the book!

I’m extremely happy to have read this book at this stage in my learning journey! My knowledge has been greatly broadened and now I feel as if I have a great starting point for further research into how code can and should be applied to our lives in the future.

In my opinion, more books like this need to be written as technology continues. By the time my toddler is in her teenage years, I’d want her to read something like this so she could understand the world she lived in, and how to progress in the future with technology as a smart assistant, not a catalyst for human regression.

Introduction To Computers – “Code” by Charles Petzold

BACKSTORY & WHY THIS BOOK IS SPECIAL

The book Code is wonderfully unique, and for that, Charles Petzold will forever be one of my heroes. Thank you, sir Charles (if you ever happen to read this) for thinking the way you do and for having been determined enough to write this book.

For those of you who are already entrenched in the industry and know this book, you may think I’m crazy for having started with this choice as an introduction to the technological realm. But, I must say, Charles Petzold’s book Code is my favorite not just for helping me with this learning journey, but because of the writing style and unique approach taken.

As mentioned in his preface to the paperback edition (which must be read, by the way) Petzold’s book takes a completely different approach than others because his main goal is to teach his reader how computers work from a granular perspective.

If you’ve read my very first “origin” post, then it should be noted that I picked up this book after I had already briefly dipped my toes into the programming world. I had known about Python, and a general understanding of computers, but nothing too in-depth. I had walked into the new Amazon Book store near the Empire State Building in Midtown, New York City, where I saw, sitting pretty on a tan shelf, the white and simple cover of Code. What drew me to the book (admittedly) was the cover because I recognized the braille and binary used underneath the title lettering. Immediately, I could tell that this book was special because it was making the connection between language and code, and connections like that are exactly what excite me.

As I continued to read Code, I felt like a bit of an imposter who was pretending to understand everything they were reading. Petzold includes many diagrams and visuals to accompany his examples. His examples tend to build upon each other, with many pointing to parallelism, so that way you develop an “all-encompassing” concept of code, as a whole. Most of it made sense, especially because of the wonderful way that Petzold is able to introduce his subject, zoom in, and then zoom back out at the end of the chapter to help draw together all of the concepts. Since I was a complete novice, as I continued to view the various charts and diagrams, some of the terms and ideas were beginning to feel unreal. Was I really grasping these concepts? Did these diagrams and new words really make sense to me or was I just lying to myself? Regardless, I continued to read. I made it a point to continue to read the book, even if I thought the concepts weren’t clicking for me yet.

Finally, I had completed my first read-through of the book. As time passed, I hoped that the concepts Petzold explained and how he explained them would stick in my mind, and I eagerly waited for the day when I would have proof that they did.

HOW THIS BOOK HELPED ME UNDERSTAND FUNDAMENTAL CONCEPTS

I was gifted my first Raspberry Pi from a good friend. As I opened up the beginner’s kit and looked at all of the components, I was overcome with an odd sensation of confusion and understanding. Although I had never seen these parts before in person, I had an idea of their uses and functions. It was in these moments of assembling the Raspberry Pi when I realized that Petzold’s words and diagrams had clicked, because as I connected each piece I could recall familiar sections from the book.

Simply put, reading Petzold’s way of explaining this subject has not only helped me with my approach to computers and programming, but it has helped me intrinsically understand how basic things work, from my automated Glade Air Freshener dispenser, to the phenomenon as to why my light switches invert themselves sometimes.

I had a good feeling when I chose Code as my very first introduction to this subject, and I’m so excited to re-read it again in the future. Already through my Python studying, I find myself recalling sections from Code with a smile on my face. I’m very grateful to have begun my journey with such a wonderfully insightful perspective on this subject, and I’m sure Code will be a book that I continuously revisit and recommend. However, the largest take-away from reading Code for me was witnessing how wonderfully an expert can perceive, understand, and explain a subject by drawing connections to so many different real-life and historical examples. This book is a wonderful look inside the mind of a true technical virtuoso.