this post was submitted on 29 Apr 2023
11 points (100.0% liked)

Asklemmy

43856 readers
1784 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy ๐Ÿ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS
top 10 comments
sorted by: hot top controversial new old
[โ€“] ganymede@lemmy.ml 15 points 2 years ago* (last edited 2 years ago)

Write many small programs as often as you can. That is, write new programs often, and make them small so you learn the full cycle of beginning, middle and end, over and over. This is the best way to learn.

Learning programming consists of 3 main things (imo):

1) The problem:

Learning to break a problem down and solve it in individual steps.

eg. Fill Car With Gas:

  • Turn Engine off
  • Open fuel cap
  • Get out of car
  • walk to fuel pump
  • etc etc

This is fundamentally what you will end up telling the computer to do when you write code, breaking a big problem into smaller problems, and smaller problems into individual steps.

Sometimes before writing a program, we will do the steps manually ourselves first to understand them. Then you write the code.

Its like when telling your friend how to do something its much simpler when you've done it yourself before.

2) The Machine:

When you're first learning its not required to worry about the actual machine the computer is doing. Just to note a few quick things.

The computer can really only do a few very simple things, almost everything the computer does is literally just combinations of the following very simple things:

  • INPUT - Read a number from somewhere (from memory, from disk, from network, from a previous step)

  • OPERATION - Do something with the number (add, subtract, multiply, compare etc)

  • OUTPUT - Write a number somewhere (to the display, to memory, disk, network, to a subsequent step)

  • Do combinations of any of the above IF some thing is true (eg. number is bigger than 10)

3) The Language(s):

To tell our computer friend the steps we want it to do, we need to use a language it understands. Don't get hung up on languages, in the end most of them have alot of similarities, and learning the core concepts is more important than memorising specific syntax.

To say this another way, while syntax is important to USE a language, it doesn't always have a huge bearing on the core concepts underneath. A classic beginner mistake is muddling the language vs the core computing concepts.

In the end, almost whatever code you write, no matter the language, it ends up doing a combination of those simple steps from #2.

The job of the language is to make it easy and efficient for a human to tell the computer which combinations of those steps from #2 we want the computer to do to achieve our task. And if the language has done its job, it will hide many of those tiny steps from us, so we can worry about the main steps which relate to our problem.

Re. first language choice, python is probably a good starting point, since if you use it properly it's often almost like writing in english to the computer. In the end it doesn't matter so much as sticking with it, practicing and slowly learning the core concepts. In general any user friendly high level language will have an easy learning curve, Python, Javascript etc.

General Tips:

Learn some basic debugging & troubleshooting methods, at first this might just be displaying numbers during calculation steps to check the computer is doing what it should be doing, and then slowly move to more sophisticated methods. Along with basic commenting etiquette etc.

Avoid stackoverflow like the plague. There is some good discussion there, but if you want to actually learn, you need understanding. And copy/pasting someone else's code will not give you this.

Same goes for chatgpt coding, autopilot etc.

When googling deliberately search for the official manual/documentation, or even a tutorial is fine if it's unfamiliar or the official docs aren't easy for you to understand, but absolutely avoid pre-cooked answers on stackoverflow etc as google will also push them on you when googling programming stuff.

The only exception is if you're absolutely stuck, when doing learning exercises it's ok to view someone else's answer as a 'solution', but IMPORTANTLY, do not move forward until you have understood at least 90% of how and WHY they did it. Without that understanding you're wasting your time, and sometimes you will even find mistakes in those answers, so blindly copying is only hurting you.

Get onto IRC (or matrix, discord whatever), and TALK with other programmers. Don't go running to someone every time you stumble, but you can learn ALOT from others when you put in the right amount of groundwork and sometimes you will learn just by seeing other people solving their own problems.

[โ€“] garamasala@lemmy.ml 9 points 2 years ago

Take it as slowly as you need, there's a lot to learn and it can either be daunting or easy to rush ahead without fully understanding.

Practice as much as you can. Videos and tutorials are good for gaining an understanding but nothing beats solving actual problems and writing code. Try to do a little everyday and more when you can.

[โ€“] ThatPrivacyGuy@lemmy.ml 6 points 2 years ago

Its a 30/70 thing. You spend 30โ„… of your time programming and 70% of your time trying to figure out why your program doesn't run right. There are plenty of resources out there with different ways of teaching the same thing so take in as much as you can even if it's on something you feel like you got down.

[โ€“] if_you_can_keep_it@lemmy.ml 6 points 2 years ago* (last edited 2 years ago)

Codeacademy.com

It's free for individuals and teaches all the popular languages (Python, Java, C++, etc.). Figure out what language will be most useful to the kinds of programs you wanna build (website, game, etc.) and start with the beginner courses. Once you get the hang of it, you can look up how to run a local development environment on your computer for the language of your choice so you can start building applications for real.

Best of luck!

[โ€“] nerrad@lemmy.ml 3 points 1 year ago

I bought a Udemy course for python, and then immediately came up with a project (writing a telegram bot). I learn best when I have a project to try new concepts on. If i'm not building, I'm not learning.

[โ€“] Kissaki@feddit.de 3 points 2 years ago* (last edited 2 years ago)

Start with a simple intro guide or course. Something where you can see stuff is preferable for feeling impact, success, and progress.

Consider

  • your learning type
  • your interests
  • chase short achievable goals
  • code scripts and tools that help you
[โ€“] uthredii@beehaw.org 1 points 2 years ago (1 children)

It is very hard to learn on your own. You will have problems that are completely new to you. Luckily most of these problems have ready been saved by someone, google and chatGPT is your friend.

Try out this website: phind.com It is a search engine optimised for programmers.

[โ€“] JoeBidet@lemmy.ml 6 points 2 years ago (2 children)

undefined> google and chatGPT is your friend.

That has to be one of the most unsettling things I've read this week....

...now all considered i wonder if this was written by chatGPT?!

[โ€“] salarua@sopuli.xyz 3 points 2 years ago

never trust a "programmer" who says ChatGPT is your friend

[โ€“] bobs_guns@lemmygrad.ml 2 points 2 years ago

chat gpt isn't very good at coding but it is pretty good at documenting functions and suggesting possible improvements, making things more idiomatic, giving you a quick run down on how to use a library, stuff like that. just gotta keep in mind that it lies to you with 100% confidence sometimes

load more comments
view more: next โ€บ