Programming - A guide on getting started

This is a article that grew out of a answer I was writing for a question that I was asked in the thread, What programming language do you know?

As I was writting it, more people asked me similar questions (Including PM) and after realising there are people who want to get started on programming, I thought I would expand it into an article and dedicate its own thread to it.

I was initially addressing one person, so pardon me for the way its written.

You don't have permission to view the spoiler content. Log in or register now.
I will first answer the difficulty question, It largely depends on the field, Some fields are relatively easy and have a low entry barrier (web development), from then on, the difficulty scales relatively to how deep you are going in.

Its very hard to tell what "the important language" for you is without an end in mind. For solid foundations of programming (since that is your stated interest) then I would say to focus on a language-agnostic approach, as in dont focus on language specific features but on learning solid principles of programming, this is what counts long term anyways.

Of course, on top of having to learn a bunch of names and concepts, you dont want to further add to the difficulties by doing your exercises and programming in "machine code" (an arrangement of "0" and "1") or something else around that end of the deep:

9ptwWgl.jpeg

Python is at the shallow end of that same deep, and yet you would not be incurring a noticeable trade-off for picking it, why is it at the shallow end? Its the closest language to "plain English", on top of that:
  • It is mature (30+ years old) so just about everything is figured out and settled
  • Its second selling point which is "Batteries included", its standard library is extensive (add more features, as you need them)
  • It has the largest community, so you will not be short of high quality learning material nor QnA forums to reach out to (when you are stuck)
  • Has a wide use in open source projects (After a certain point, growth is only obtained through collaboration)
At the end, if you opt to go into developing websites (known as "front end", "back end" or "full stack") or going into developing desktop applications or mobile applications, then you will be using Python in some form, or if you decide to go into big data, machine learning and even AI fields, then Python will be your main language.

Remember, dont use python to just learn python, use it as a driver to focus on core programming concepts.

What is "core programming concepts" anyways?

A core part of programming, as I tried to explain in my other post is not understanding syntax (grammar) and semantics but how to approach a task/project and when you find yourself in a pit inside of a pit, how to break down the problem, and then further break it down, this is known as decomposition/composition

And of course the following which is found in most languages:
  • Good naming conventions, documenting and maintaining code
  • Variables and their types
  • Operators
  • Conditionals
  • Loops
  • Functions/methods (with the _call stack_)
  • Arrays (Lists in Python)
  • Regular Expressions
  • Encapsulation
  • Program flow
  • File I/O
A good instructor I can recommend is Fred Baptiste, he 100% knows his stuff (he covers very advanced stuff that others rarely touch), and on top of that is an excellent teacher, two rare combinations.

Start with his first series, he is very comprehensive so he covers the above and minds good programming practices along the way:
If after that you are feeling adventurous and depending on how you feel about Python, you can carry on to his advanced material:

"The pros always have the docs open"

Other than the above course I recommended, you should not need anything else other than the documentation for python, which is at https://docs.python.org/3/.

Dont neglect the documentations, a video is more interesting than dry documentation but you risk in ending up with incomplete understanding of matters.

The people who wrote the documentation are the same people behind the designs and implementations of Python (or "X" thing), so as well as giving you insight into the why, they also provide a comprehensive A to Z explanation that is always up to date.

A good teacher of mine used to always tell us:
>The difference between the pros and the noobs is that the pros always have the documentation open

And my observation of my peers has borne it out, the pros always the docs open. Right now, I have three documentation tabs pinned (not that I am a pro):

OPILT6J.png


Dont be hard on yourself if things are not sticking, that's what the docs are for, keep revisiting the relevant pages and manually typing and tinkering.

Quality of life tools

Dont leave yourself open to a "death by a thousand paper cuts", invest in your tools and you will have a smooth experience. If something is not right or broken fix it, dont let it break you flow and tolerate it because its a "small thing", it add up and it will make your work not be pleasurable, and before you know it, you are avoiding it.

Its hard enough internalising all this, learning to appropriately name things (which is said to be the hardest thing in programming), imagine on top of that having to fight your tools.

Also Programmers are very fussy about their workstation, workflows and tools, there is no "right tool", its all personal and over time you will discover this yourself. Right now you need:
  • A source code editor - Just go with Visual Studio Code, its the most comprehensive option
  • A documentation tool, Visual Studio Code also doubles as a Markdown editor (for formatting your text)
  • A good video player, these days majority of your learning will be video. A 40 hour course sped by 2x could be a 20 hour course. (you get used to the speed)
  • A shell (command line) for doing generic tasks and running build tools, use PowerShell, its already on your system and its versatile.
  • A terminal, which is used to host your shell and interact with it. Windows Terminal is already on your system and its versatile.
The last two points are a must, many will tell you its optional, you will be doing yourself a disservice, especially as you come to need git and build tools. It will be a big part of working with others and no doubt your job, better get started on it.

Getting effective help

Its inevitable that you will get stuck, the good news is these days, its very easy to get help and people are more than glad to help someone who is trying in earnest, however no one likes someone that just wants his work done for him, to spare you any calacaal from being ignored or slighted do the following.
  • Make sure your question is on topic, that you are asking a suitable community
  • The title or question should be clear, and summarises your post
  • Describe what you are trying to do in the first place (imagine you are talking to someone else)
  • Describe what is stopping you or breaking you code, so that others can recreate it on their end in order to diagnose it
  • Include any errors or bugs you are dealing with in the post, dont take pictures of it, copy and paste it in.
Use this excellent article, Writing the perfect question, as a guide for getting help and for how to best reach out to others, a Checklist version of it.

If you do the above, others will see you care about their time and will likely help you. Over time you will discover which communities tend to yield better insights and answers and you will naturally rank them accordingly.

For Python, I have discovered the following order be the most useful to me:
  1. StackoverFlow - Python
  2. AskPython
  3. PythonHelp
  4. LearnPython
  5. Python
Feel free to cross post as well, sometimes you will get a nothing burger answer on website X, so if you take care to ask across two to three websites, you will likely wake up to more answers the following morning.
 
Last edited:

Type, Practice, Type some more, and stay away from AI bots

Its well enough to read things and watch videos but that is just the start, its also the reason why when most people ask about getting started or improving they are hit with "Practice and then practice", its a cliché but it is the truth.

Practice what you are you learning, test it and if you break it try to fix it back rather then just deleting the code and restarting from the top.

Dont copy simple lines of code, type it the old way. Look at this Example 3 of the get-childItems command from the PowerShell docs, the code example is:
Code:
You don't have permission to view the code content. Log in or register now.
It has a convenient "copy" button besides it, you can copy and then paste it, this is fine once, anymore and you will do yourself a disservice.

Typing it requires your focus as well as hand to eye coordination. Our hands are big part of how we ingest and retain things, dont worry about getting it wrong, as your code editor has many ways of alerting you to errors.

Lastly, its become a very recent nasty practise that when someone asks how to do "X", the answer is often "just get the AI to do it for you bro". Avoid using IAs until later on. Not only can they be wrong but will often spit out overly convoluted and bloated solutions for what could have been two to four lines of code.

You want to go down the untread paths yourself, its only after going down these untread paths enough times that they will become established roads. That is when you will see actuall improvements.

Build programmes


The only way to learn a new programming language is by writing programs in it
― Dennis Ritchie (Father of the C language and UNIX)

This whole article was just a long winded way to get to this section and just this section alone would have sufficed.

Dont get bogged down on cool or ideal programmes to build, just pump them out, "paint by the numbers" wins here.

To keep yourself invested consider building programmes that are a solution to every days problems or needs you have.

Maybe you want to help your ayeeyo to keep track of her ayuuto? Or are constantly findings yourself needing to convert Metric figures to Imperial ones? or whatever else.

Try to break it down into small steps and if you can wrap into the need into a small solution, that can become a small programme.

Remember it does not have to be some elaborate thing wrapped in the latest GUI framework. At the start, stick to writting simple terminal (command line) programmes, this will allow you to focus on the core of the programme itself.

For the above reason, most of the following example programmes are terminal based programmes, that is not to sell such programmes cheap. I use the terminal 80% of the day, and these programmes I am sharing are tools that I use every day.

I also want to mention internally these programmes are using a variety of libraries and frameworks, whatever promised to get the job done at the time of development.

Example 1 - foobar


I like to take notes and also share things with other people all the time. Here is a simple programme that gets information from my music player Foobar2K.

Typing foo alone gets data such as the current CurrentTime time, TotalTime, Artist name, Album name, etc etc. You can compare the values printed on the above window to the ones on the bottom window's status bar:

MhbDW81.gif


The command foo |% currentTime just further drills down into the currentTime property, which is just a Timecode class I built. It provides a real time breakdown of hours, minutes, seconds, even milliseconds as the song is playing.

X5RqzBB.gif


Another feature to quickly pull the current songs lyrics via the the Genius website, foo -genius:

0irLxFC.gif


Example 2 - Custom Bookmark manager​


This one makes use of a simple GUI (Graphical User Interface) that is used to store and then display bookmarks, and any notes the bookmarks might have. Its a simple solution to a need I had, wich is a means of storing bookmarks outside of the browser, so that links dont get auto corrected, for example when a YT video gets deleted.

There are a number of ways to save a bookmark, one way is to just use FOXbookmarkSet at the terminal. If you want to attach a note to the bookmark item then FOXbookmarkSet -note "my note":

PiZJaDH.png


Example 3 - Markdown to BBcode (For enchanced SomalisSpot Shitposting)​


This forum uses BBCode for its text formatting, I use markdown 90% of the time, so I wrote a simple Markdown to BBCode Parser, it uses Regular Expression to do its parsing.

SomaliSpot discloses its full list of BBcode tags under its help article, BB Codes, which I used to standardise the tags.

Simply invoking MdToBB <SomeMarkdwonFile.md> will take the input Markdown text and convert it to SomaliSpot compatible BBCode and place it on the clipboard, which can then be pasted to the forum:

2Eyq29B.gif


Have fun and work with others


Well if you reached this far then you definitely have interest on the subject, and so I hope I have informed you, have been of some guidance and have wet your appetitive.

Remember to have fun and to occasionally laugh at yourself, I noticed the best of the best making trivial mistakes all the time, its why we have IDEs and syntax highlighting and a bunch of other rail guards in place. So dont let it discourage you and keep going.

Also this field has unfortunately gotten the bad reputation of it being for the "loners and reclusive", that is not really the case, you will undoubtably be expected to work with others, whether its at future job, friends or even contributing to a project with strangers you will never meet.

At some point along the way, find like minded people to work with, it will push you forward and past a certain point in your growth, it becomes the best way to advance your skillset.
 
Top