I’ve been wanting to learn how to code for a while so I figure now is as good a time as any to start. I downloaded VS code on my laptop for python but I don’t really know end product I should try to code and I also am just bad and barely know what I’m doing. Does anyone here have any advice on what to code and how best to learn?

You are viewing a single thread.
View all comments
19 points
  • Hello World
  • Read a file
  • Write a file
  • Read a file and loop through it line by line, printing each one (for loop or equivalent)
  • Program that consists of 2 or more source files

What I’m getting at is instead of a full program, write code snippets and small programs. In doing this eventually an idea for something larger will pop into your head.

permalink
report
reply
2 points

Yep! And then read argv for command-line parameters + a parser. File IO + command-line controls gets you a shell of a utility to work with. Then grab a package you like the look, bring it into your project, and do something with it (image manipulation, network stuff, whatever…)

permalink
report
parent
reply
2 points

This is a good start.

My latest python script loads my monthly banking CSV, arranges the columns in the correct order, assigns categories based on the merchant, and finally exports the data to a new CSV.

permalink
report
parent
reply
4 points

In addition to what this guy said, don’t just use libraries to skip steps when writing small programs.

For example when parsing a file you will often use the split and strip functions in python, but learning how to implement these by yourself will teach you more.

To really learn fundamentals you should try and implement most operations yourself. It’s why in my opinion C is a better language to start with, because it forces you to learn the fundamentals.

permalink
report
parent
reply
3 points

I’d say it depends on the learning style. For some people, it’s a lot less demotivating to start as just plumbing libraries together to get the end result than starting from the deep end. Same debate as starting with ASM vs starting with Python.

permalink
report
parent
reply
2 points

I see your point, but I would almost argue that starting out with all these shortcuts available in high level languages is ‘jumping into the deep end’ itself.

When a newbie sees obscure error messages in some of these libraries they might not have any idea what they mean or why they were triggered. My opinion is that having a smaller set of tools to start is actually simpler despite being able to do less with them.

I’m slightly biased because I started with C 😅

permalink
report
parent
reply
2 points

I agree with this comment. Get these down then you can check this out

permalink
report
parent
reply
7 points

When I’m learning a new language I like to try and solve problems from sites like https://adventofcode.com/ or https://projecteuler.net/ I find this gives my learning more of a focus. After you’ve done a few of these you should have enough confidence to attempt your own projects

permalink
report
parent
reply

Programming

!programming@programming.dev

Create post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Community stats

  • 3K

    Monthly active users

  • 1.7K

    Posts

  • 28K

    Comments