NOOB to Programming?

[Image: coding.gif]

Hello. Very often in this subreddit and generally on the internet, there's plenty of takes on how to learn to code, programming and computer science.

I have started learning programming many times in my life and I always came up to some point where I felt that all I was learning was for nothing and programming and computer science were subjects much too broad and complex to me to learn and make anything useful. Every time I went through a new language, every time I wanted to make some useful script for me I would just end up in a dead path were I would just give up for some months/years just to come back later and begin again from the very basics.

This summer I begun again learning from the beginning with some different approaches that I feel have worked very well for me and here I am going to list them.

a) Learn Python as your first language.

The very first time I started to learn programming I did so in PHP or C++. I'm not very sure which one it was. But there are few reasons why I feel Python is a better choice.

First of all Python has a rather simple yet effective syntax.
Python forces you to write "cleaner code" through forced indentation and I feel this experience pays off when learning other languages.

Take another very important concept in programming like types. Javascript treats variable types implicitly which I find very confusing for new programmers.

The same way C and C++ overcomplicate types and have the programmer fight through it without really knowing why and when they should use one type instead of another.

There are many other factors that make Python an ideal language for beginners.
It uses many of the most important programming concepts like object oriented programming, multi threading, scheduling, functional programming, bitwise operations, ecc.

To add to this, which I find extremely important to beginners, Python is widely supported by an immense number of modules and extensions. Python fits perfectly for pretty much any kind of possible use.

While it is obviously not the perfect tool for every use, it's always okay enough to make any kind of program, even 3d games (which are often a huge appeal to beginners). Even in game making Python is a very useful tool.

Python is the de facto scripting language of industry leading tools such as Autodesk Maya and the most important game engines such as Unreal Engine have Python wrappers allowing you to focus on making first and optimizing later as you gain more experience with C++.

I don't think that even Javascript fits the general go-to programming languea as well as Python does. Somebody with a grasp of C will have a hard time writing a dynamic website easily, somebody into Javascript may find it hard to use his knowledge into other stuff (plus JS feels somewhat impredictable during runtime, something I have never, ever, felt in Python).

Next, Python's very diffused in the programming community. It often sits at the top of questions and answers on stackoverflow, this is very important as beginners have often plenty of questions ranging from beginner to complex subjects. This implies that a large number of this questions has plenty of answers.

If you're looking on how to make an online quiz app with Python, you will probably find plenty of repositories on github. You want to make a reddit bot? You want to create a program that tracks the price of AMD's GPU RX 580 because you're tired refreshing your browser and looking at the stores manually? You will probably find hundreds of scrapers and alert bots and truth to be told they are often easier to understand than equivalent scripts or programs in other languages (that's at least my opinion).

b) Code in the terminal.
One of the beauties of Python (but I wanted it to have its own section) is that you don't need to compile it.

Not only you don't need to guess what is your compiler doing under the hood but you can actually open your terminal and start coding directly, you can check on the fly what type is a variable, you don't need to quit your script, go back to your text editor, add a print statement, relaunch your script, get the information, quit your program, delete the print statement and go back to what you were doing.

I find that writing each and every small part of your program makes you a better programmer and makes you understand each and every line of your code more clearly.

I'll give you two small examples from my own experience: creating a bot that alerts me when a certain item on a website is below a certain price.

You have so many small problems at once: making https requests, handling the responses, converting the website information from string to dictionary, multi threading, scheduling, event handling, ecc, ecc. Just open your terminal and play around with all of this stuff. Requests? Import the requests module and start to learn what the server responses are and what kind of data it gives you.
It's formatted like a json? Learn the json module by writing a stupid dictionary of lists and tuples and learn how to get the key values you need.
Oh, but you need the script to perform the function periodically? Play with the scheduler module, read documentation, watch videos, search the questions you have. But do so directly in the terminal. Don't waste your time on writing this big classes and functions that do all of this stuff together.
Really, play in the terminal it's so much faster and instructive than going back and forth between your code editor and your terminal.

Really, try using Python in the terminal when you approach a new problem and dumb it down to the very bare concepts you need: making https queries, converting strings to dictionaries, parsing the dictionaries for the keys and values you need, multithreading your program, scheduling tasks, ecc.
I have learned all of this concepts in just one afternoon all as a programming newbie hobbyist because I tackled them down to the very basic concepts and I played with them directly in my terminal and I can safely say that I have a solid foundation of the very basics of this different concepts. I am not an expert, but I can make use of them, and that's enough for me at the moment, till I will have a problem that will require me to delve more into those arguments.
c) Code stuff you actually need. When I started programming I wanted to make videogames, giant and complex websites so I delved into Unreal Engine, Django, ecc. Yet here lied the problem: I did not have enough experience with the fundamentals of programming (I still think I don't) like making https requests, vector math (fundamental in gaming), garbage collection, flushing data, ecc, ecc. Yet I encountered most of this problems not all at once but one at the time while writing small programs that I wanted to use. In example I wrote a simple program to automatically refresh my github repository with the files on my local one just by writing a script that only needed a commit message to handle it for me. Saved me what? 30 seconds? I then also wrote a script that automatically executes at startup of all my computers and pulls the latests commits of the repositories I follow (yes I know that's not the ideal way to use github but it was perfect for my use, as all my repositories are private and I'm the only one contributor).
Another example: me and my wife are italian and we have a dedicated budget for alcohol. We like wine, but we don't like paying too much for it in the supermarket. So I wrote a small webpage where we enter the name, producer and type of wine and what shops sell it. This way we didn't have to remember dozens and dozens and dozens of wines but we would know from the start which we liked and which we didn't. Then I expanded on this program: we would write our grocery list on an android app, and I wrote a small script that linked us to website like supercook and others to find out what we could cook with what we had in our fridge. Using this app is literally 30 seconds a day, but we know what we have in our house all of the time and what can we cook with it, and in case, what we have to buy to cook this or that. I wanted to track cryptocurrencies? I made a script to do so. Really, start using the power of coding to make your life simpler, and learn along the way. I find it pretty pointless to learn in a linear way stuff that you won't use for simple yet important to learn smaller programs. All the courses, books I learned at some point started to teach classess, inheritance, event handlers, decorators, stuff you probably don't need as a beginner. Mind you I am not saying that you this stuff is not important and if you're serious about learning programming you should definitely learn, but the point is that once you have an understanding of the syntax of your language, googling and writing programs that you actually care about and are useful to you is much more valuable and impactful on your learning than following the usual paths of code learning.
If you give up and quit while learning to code chances are you lack curiosity, a purpose and are overwhelmed with information you don't really see a use for it.
Really, it took me to actually write programs that I needed to start to really feel like "hey, I can actually program".
d) Learn in classical ways. There's plenty of people, tutorials, guides, websites like codeacademy that want to teach you how to code. Yet, reality is that there's a reason if learning from university courses (plenty of them online and free) and very solid books is a better idea. If you want to learn how to code from may succeed in doing so. But I don't think that Bucky's the best programming teacher around. He's a guy that in my opinion has an intermediate understanding of programming and often lacks the biggest picture (or at least he can't deliver it to viewers) of why stuff is used in a certain way. No book or teacher is perfect, and here you may find help on youtube, blogs, ecc. I have to admit that I really understood regex, exception handling in Python and other stuff better on youtube than in books or other written format and sometimes I had to learn about something on 3-4 different sources and watch several youtube videos to get to the point where "oh, know I get it" but generally speaking chances are that people you are watching/reading are young and somewhat inexperienced programmers (because think, if those guys were great programmers, why are they trying to make a living on youtube visualization and their website adds rather than having a good job?).
I also do not recommend stuff like CodeAcademy. There's an overemphasis on algorithms. I see the point of it, but honestly speaking I very rarely need to program scripts programs and functions that rely on algorithms. My point is: if you are trying to learn if, then, while ecc statements, the best way to do so is by applying them to stuff you need or are interested in, rather than writing a terminal battleship game or stuff like that. Chances are you're not interested in writing a terminal battleship game or stuff like that so why spend hours on stuff that puts you in an algorithm [Image: 111.png] rather than giving you a solid foundation on stuff like variable passing which is much more useful and general but is touched once or twice?
e) Use the internet to ask and find questions. How many times did it happen to you that you had a problem but all of the questions where similar yet not the same you have? Ask. Come to reddit and ask what you want to know. Go on stackoverflow and ask. If you don't understand the answer or if the answer gives you even more doubts, ask for explanations. Another great source for my learning has been irc. I know in modern times the very purpose of irc is somewhat lost, but there are beautiful channels on irc where beautiful people will answer your questions very soon as you ask them. Props to people like Ygh1s, ChrisWarrick or altendky on the #python channel on freenode. You give so much time to newbies, literally hours every day, just to help less experienced people. The same way, go on stackoverflow, reddit, irc, ecc and answer the questions of people that understand less than you. Chances are that in most cases you won't have the answer, but if your curiosity drives you, you will learn from other peoples answers and you will actually find that many things you thought you knew you actually don't. You will also learn new modules, new stuff, new programs and new ways to apply your limited knowledge that may inspire you. Thanks to stackoverflow I found about tensorflow which I found very curious and I started playing with it to try teach my computer play some videogames. I can't say I had any success till now, but I enjoy it and learn along the way.
That's all folks, I hope this wall of text inspires some newbies that encountered my own problems as well and I hope that a nice and informative discussion might be built on it.

form reddit

[Image: giphy.gif]

also ruby is a good programming language too
[Image: 5c8f08b5fe55e12baae6fc54e46c343a.gif]

Users browsing this thread:
1 Guest(s)