this post was submitted on 04 Dec 2024
85 points (97.8% liked)

Ask Lemmy

27210 readers
1924 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


6) No US Politics.
Please don't post about current US Politics. If you need to do this, try !politicaldiscussion@lemmy.world or !askusa@discuss.online


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS
 

How do I go about this? Are there any free resources that’ll help me get started?

I see people advising to start with a small project, but you need to get some basics down right? What language? How to develop it and stuff?

My only experience is some very basic C programming classes I took during school.

you are viewing a single comment's thread
view the rest of the comments
[–] laurathepluralized@lemmy.world 2 points 1 week ago* (last edited 1 week ago)

This is a great analogy! To build on these points and the analogy: I like to think of my coding in terms of inputs, outputs, and what needs to happen to the inputs to get the outputs I want: that is, inputs->how->outputs. So for this buttered toast analogy, your inputs would be:

  • toaster
  • electricity
  • bread
  • butter
  • knife
  • plate
  • operator's hands

The desired output: toasted bread on the plate with butter spread on one side.

The "how" is the sequence of specific instructions the instructor gives to the operator.

This approach is even more helpful as you start working on larger projects; as you think about a problem you're trying to solve, try to break the overall input->how->output into smaller modules of input->how->output, and then you can use those modules (often called "functions" or "methods") in the overall "how." Let's say you want the instructor and operator to prepare a full breakfast with bacon, eggs, and buttered toast. You'll have some more inputs, of course (frying pan, raw bacon, shelled eggs, stove, in addition to the toast components), but since you already made a known-good make_buttered_toast function, you can incorporate that function into the pipeline to go from your more comprehensive set of inputs to the full breakfast outputs, and you can make separate functions for making the bacon and making the eggs. Finally, your overall program can then call your bacon, eggs, and toast functions to result in the desired output of a full breakfast.

Now here's where breaking the problem down into smaller input->how->output chunks really comes in handy: one day, you are tweaking your breakfast-making code, and suddenly, your overall outputs have good bacon and good toast, but the eggs wind up dumped half-cooked on the stove. But since you made nice, modularized functions for toast, bacon, and eggs, you automatically know more where to start looking for the bug: the eggs function.

There's a lot of good advice in the responses to this post! Overall, I just wanted to emphasize what I wish I had learned much earlier on in my career: the benefits of thinking in terms of inputs->how->outputs and modularizing sub-problems in the overall program's "how" into subproblems that can be independently considered, debugged, and re-used on future projects. (A secret for you: those of us who have been coding for a while often don't start everything from scratch--we'll re-use some functions or classes we wrote in the past, tweaking them as necessary for new applications, but not needing to start from a blank text editor :) ) Learning to write applications in code is exploring a new way of thinking about problems and how to solve them, and personally, I find it very rewarding!

I wish you all the best on your coding journey!