Tag Archives: coding

How to learn to code – other people’s advice /5

I am glad to see that some of the readers are taking advantage from some of the advice I got from other programmers.

Here is another advice I received:

I’ve never tried a freelance site yet. However, I am working on freelance projects for 3 outside companies now. They found me themselves on LinkedIn. Hmm….I think it’s too early to try to get a software job. I don’t know if people would hire you with no experience. You can always try, of course.

Whatever way you can learn and get experience, go for it. A good way is to contribute to open source projects. That means you must first learn GitHub and Git. Look at popular projects on GitHub: https://github.com/explore

Here’s a popular Python project: https://github.com/poise/python

Here are current “issues” for this project. Problems, bugs, features that they need someone to fix for them: https://github.com/poise/python/issues

Here are the latest “commits” (code uploads) to its master branch. You learn a lot from studying what code changes people make to a project: https://github.com/poise/python/commits/master

Here are its latest “pull requests” (new code changes that developers are asking the main developer to accept for merging in the master branch): https://github.com/poise/python/pulls

See? Study how code gets made and changed day by day by studying these details for different projects on GitHub. Feel free to contribute your own changes/issues/fixes to a project. People are very picky about what code they will accept. If they reject your code, they will give you comments and tell you what to fix/improve. This whole culture of contributing to open source projects on GitHub will teach you the daily process of software development.

We do the exact daily routine at work. We have meetings every 2 weeks to figure out the main issues each of us will work on in 2 week “sprints.” Then each morning we meet and talk about what we’ve accomplished so far. We each make a new branch on GitHub to work on our feature or bug fix. Every day we commit and push new code to that branch. When we feel we’re done, we make a “pull request” to our boss to merge our branch with the main branch. He may accept it or reject it with comments on how to improve our code. We also do a demo every 2 weeks to management and our team of what we’ve done.

That’s how our job is like. So yeah, eventually try fixing problems people have on different projects on GitHub. That’s a fantastic way to really learn and get critiqued by experienced software developers worldwide. IF you have a bunch of open source contributions highlight that on your resume. That’s impressive, because it means your code is up to their high standards.

Here’s the prework site for my school, Flatiron. They give you a bunch of suggested tutorials/links to prepare to be: 1) a Ruby on Rails web developer or 2) an iOS developer. http://prework.flatironschool.com/

You don’t have to cover everything. First just focus on your main language (like Python). Eventually you’ll have to become a T (deep knowledge in 1 main language, with broad more superficial knowledge in several other languages).

http://prework.flatironschool.com/web-development/

Advertisements

NEJC_TOMSIC_INTERVIEW

INTERVIEW WITH NEJC TOMSIC – SELF-TAUGH PROGRAMMER, MD and MEDIATELY COFOUNDER

NEJC TOMŠIČ

 

Your bio :

2010 Won iGEM Grand price with Team Slovenia at MIT

2011 Graduated from Medical faculty in Ljubljana

2011 Learned to code

2012 Cofounded my startup (Mediately)

2012 Won second place at Health 2.0 hackathon

2013 Raised seed investment

 
Nejc, when you started to code ?

It was after I graduated from Medical faculty and had two months of free time before starting my residency.

You graduated from the Medical faculty, did it somehow help you being better programmer ?

Maybe the endurance to read a lot of thick books :). Also, I came across the idea for my startup while doing clinical work which gave me motivation to start coding.

What made you start ? What was the trigger ?

During my studies I always felt that drug information wasn’t easily accessible to students and doctors. The information was either in the books or was only partially available on the web page of Slovenian Health insurance. For quite some time I wanted to create a solution and learning to code enabled me to do that.
What resources did you use and how you keep up to date within rapidly growing field as programming is ?
I watched several video tutorials from lynda.com to get me started . Then I started to code my project and used stackoverflow and googling for every problem I ran into. And there were a lot :). Then I started to read programming books which gave me more in-depth knowledge. I also completed several online courses from Corsera.

Reading hackernews and weekly summaries from my field keep me up to date with what’s going on.
Do you code only for hobby or is this your job ?

I used to work as radiology resident and coded in the afternoons and weekends. Because I couldn’t give my 100% on both jobs I decided to work only on my startup.

How did you get your first programming job ?
I cofounded Mediately where I’m the lead Android engineer.

What is your favourite programming language ? Which one do you like to work with the most ?

My love at first sight was Ruby but now I work mostly in Java and once you get a grip on it it’s quite nice.

Would you encourage people graduating from non-tech colleges to learn to code ? Criticism about the idea (hype) ‘let’s all learn to code’ is not to so rare among some people who are more experts in the field. What is your thought about that ?

There is a lot of talk about how coding is the new literacy. But literacy helps people to communicate and I don’t believe that forcing everyone to code will improve how people communicate even through computers. However,coding is a wonderful way to get to know how programs, computers and internet work.

What do you think is the best part of being a coder ? Can you think about disadvantages as well ?

The best thing is that you can start working on your idea 5 minutes after you have got it in the shower. But I wouldn’t want to work at the IT department of a big conservative company.

What was the most interesting project you worked on ? People usually give me advices that the best way to start learning programming is to start working on some real personal projects ? Did you had your own ‘starting projects’ as well ?

By far the most interesting project is my startup. Being able to work on your idea and watch it grow is awesome. I would agree that having a project is crucial. I tried two times before to learn to code but because I had no project to work on I failed.

What are you up to today ?

Trying to grow my startup into a business.

Do you have any advice for newbie programmers ?
Choose a language (I suggest Ruby), complete a crash course online,choose a project that you’re passionate about and start coding.

Social media contacts:

Linked in: https://www.linkedin.com/in/nejctomsic

Mediately: http://www.mediately.co

JOY OF THE FIRST ‘BIG’ PROGRAM AND CONTINUE

I keep going with the Coursera course on Python by dr. Charles Severance. Class is really well constructed and I would warmly recommend it to all programming newbies.

Yesterday It took me quite a lot of time to solve the exercise. I experienced two things:

1. It is important to pay attention to details. I knew that but obviously did not remember lesson well as I was furiously looking for the solution while it was really obvious and would have appear to me much earlier if I would have been more precise. Once again: pay attention to details. 

2. The second experience was a joy of making my longest program so far. For an experienced programmer this piece of code will look very easy but for me it was the top of the mountain. If you have write the right solution, the right code either for given exercise or some problem of your own, you will know what I am talking about.

So here is the exercise:

Write a program that repeatedly prompts a user for integer numbers until the user enters ‘done’. Once ‘done’ is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter the numbers from the book for problem 5.1 and Match the desired output as shown. 

This is my first solution which I was so sure it was right but it was not:

largest = None
smallest = None
while True:
num = raw_input(“Enter a number: “)
if num == “done” : break

try:
num = int(num)
except:
print “Invalid input”

if largest is None or num > largest:
largest = num

if smallest is None or num < smallest:
smallest = num

print “Maximum is”, largest
print “Minimum is”, smallest

And this is the right solution. Do you notice the difference. Run the code if you are not sure.

largest = None
smallest = None
while True:
num = raw_input(“Enter a number: “)
if num == “done” : break

try:
num = int(num)
except:
print “Invalid input”

if largest is None or num > largest:
largest = num

if smallest is None or num < smallest:
smallest = num

print “Maximum is”, largest
print “Minimum is”, smallest

 

P.S. I apologize for writing code without proper identation. If you know how could I write nicer lines of code here in wordpress please let me know. 

PARALYSIS BY ANALYSIS

I was recently asked on Quora this question: What’s the worst way to learn programming?

Even though I am not a programmer but rather someone who is learning Python for fun, I did dare to answer the question. My response was:

Starting to many online courses at once and spending to much time on planning what and from where to learn.

I responded because I went through the same experience. You can get trapped into the false perception of doing progress, while everything that you are actually doing is planning and checking next cool learning site for coding. Codecakes, Udacity, Udemy, Teaching Tree, Learn Python the Hard Way, Codecademy, Code School… To name just a few. Stop planning to much, to precisely. You can easily spend too much time on checking these resources but I do believe this is waste of time.

By my opinion, what you should do is to determine the maximum amount of time that you are willing to spend on planning. Once you ran out of the time you must start learning and following one or two resources until you complete the lessons. Than you should move on, otherwise the learning process is confusing and unefficient.

How much time did you take for making your learning plan ?

 

DAY_12_HTML

I always need a good plan. I hate jumping from project to project. This is hard not to do as there are tons of websites  dedicated to teaching people to code. If you are autodidact you have probably noticed numerous places to get basic knowledge about programming. One could easily spend a month browsing through these sites without actively consuming content.  This pose a risk of excessive passivity. To overcome the risk it is really important to decide where you will learn from and then stick with your plan. Be aware of the fact that there will always be another webpage, another tutorial… Focus. Stay disciplined. It may be easier when you realize that all courses will teach you same HTML basics. Among 10 great websites differences are really minor and you will probably learn well from each site.

Today I found another really cool site. It was while I was reading this article by Gina Trapani that I learned about w3schools.com. This is my next pitstop. Here I will stop to learn everything they have to offer about HTML. After completion I will move on. You may wonder why I started with HTML and paused Python ? You probably already know (I did not know that only few days ago) that HTML is a markup language. Python is a programming language. Almost every web page you can think of is using HTML, therefore this is a must for everyone considering web development job. The good news is HTML is easier to learn than programming language. It is even easier to learn HTML than Python. There are few, not to complicated rules and a lot of tag names and attributes. You can compare this with learning a foreign language. The more words you learn, the better your communication will be. Broader vocabulary enables you to speak about more topics, it enables you to express your thoughts and feelings more clearly. Similarly, the more  tag names attributes you will learn to use, the cooler sites you will be able to build.

In next post I will write about my first HTML lines. For now I can tell you that getting familiar with HTML already provided me with great satisfaction especially after finding out how powerful tool can simple notepad (microsoft) can be.

DAY_6_vertical_slash

If backslash was the pearl of the 4th day, vertical slash (bar) – |- was discovery of the 6th day. The fact that I am using alt + numbers while typing is an indicator I may becoming a geek. I was asked to type this vertical sign in one of the video lessons. Instructor did not mention where the sign is located (was not able to find it on me keyboard) so comme toujours Google led me to the information I needed. If you will (for some strange reason) need to use vertical slash, one way to create it is: alt + 124.

In addition, today I was introduced with another useful piece of Python world; list comprehension. As far as I understand, this can be a great tool to keep your code short. Let us say we have a list named squares. We want to iterate through ten elements, square them and add squared values to the list. Here is the code:

squares = []
for x in range(10):
squares.append(x**2)
print(squares)

If you have spent only 2 days learning Python, you should know the outcome of the code. Or I suggest you to type it in the text editor and see what happens. Go, do not be lazy. Practices makes you better.

All right. Now as you have tried it by yourself I will show you how to write shorter code that will have same effect:

squares = [x**2 for x in range(10)]
print(squares)

Go and type this code as well. Quite cool, ha ?

All right, less is more so we will stop here. If you have not ran out of energy try to write few programs with list and loops. Then try to write them using knowledge of list comprehension.

Happy & productive coding

DAY_5_FileIO

Things are getting more and more difficult and I am getting more and more frustrated. I have already spend two days with the tutorial and went only through 45% of it which leave me more than 50 videos to watch and learn from. Everything stopped when I hit the File IO chapter. This was something completely new from what I have learned so far. As if def sth(): was not enough 😉 However, here is the code with which you can create physical file in your computer:

my_file = open(‘File_one.txt’,  ‘w’)

my_file.write(‘Hello world, are you ready for some magic code ?.’)

my_file.close()

I am not going to explain in detail what this code is about, because this blog is not learning blog. After all, If you are more experienced than me, no problem. You already know the theory behind the code. If you are less experienced than me (which is highly unlikely). You will have to learn it yourself. If you want to become programmer no short-cuts are allowed. All I can tell you is that with this code we created a new file. The name of the file is File_one. Write it in your text editor and if you will do it correctly the icon named File_one will appear on your desktop. Go try and double click it. Let me know what does it contain 🙂

After the exhaustible FileIO chapter I returned to codecademy lessons. Surprisingly I completed two courses in a row ( Advances Topics in Python and Introduction to Bitwise operators ). Usually, I cannot do more than one. Even though codecademy is build up for beginners I find their lessons quite energy and concentration consuming.

This is all from DAY_5. I wish you a lot of persistence in learning coding skills.