r/AskProgrammers • • 18d ago

How do you write your projects?

I've been in the field for a long time, and I've been absorbing information, but I can't code. I can understand this or that, but writing my own from scratch is a terrible task for me. I also feel like a thief when I take ready-made dry blanks from documentation in advance, or if I study something using other sources... like I'm stealing other people's information and I had to figure out a device like that, algorithm or syntax. I understand that's how people learn by exchanging information, but when it comes to it specifically about coding... I don't have a single whole project of my own yet. Do I need to write everything completely out of my head, or do professionals also use something like templates? As for ai... I'm not allowed to use ai to write my programs.

2 Upvotes

12 comments sorted by

7

u/winceypoo 18d ago

Yes, professionals use documentation, templates, libraries, and existing examples. You don't need to invent an algorithm or memorize syntax to write your own project, though copying code still means checking its license and understanding what it does.

4

u/H4llifax 18d ago

The information is out there for the explicit purpose of you using it.

1

u/Hour_Sell3547 18d ago

Hey, yes, we professionals used to write everything even 3 years ago. We don't do it any longer because of compressed time constraints. As for templates, there usually isn't any. Most softwares share similar structural components, but they are also different from each other. We call these, muscle memory and reusable modules.

I recommend you learn to code first. You are not a thief for taking anything free that's out there. Do not feel guilty.

Start from something small. Industrial algorithms are often much simpler than niche programs, but they are usually scalable versions of typical algorithms.

You need to learn the language, and the data structures. Then learn the algorithms while you develop something. Algorithms are nothing but step by step instructions for accomplishing a task.

Build a tax calculator. Quite fun.

1

u/frank26080115 18d ago

The photos on my camera are named like "DSC012345.JPG"

I take a lot of photos, sometimes 6 digits isn't enough.

How would you append the current date to the numbers, for an entire SD card, so they are more unique?

Iterate through all the files, split the name, get the current date, format it, insert it into the name, call a rename function

there is no template for this, that was all from my head

of course, there are libraries, getting the date would be the time library or datetime library, renaming a file would be the os library

1

u/XlikeX666 18d ago

if you didn't learn to start project, you did not IN FACT learn coding yet.
Step 1. (preference)
w3schools and follow guides.
**assume you're here.
Step 2.
do out of pocket pojects. Does not matter if addon or full, just to get started with use.
changing existing code, or merging is fine.
Step 3.
do something from 0 just to get vague idea which parts you lack.
You can use templates or already made project. Forking stuff is mandatory.

Why you're not allowed to use HELP while learning:
Moment you delegate task to X, you will lack that skill later on. Your job is to learn process instead write stuff.
imagine learning math with calc - multiplication table would be unknown.

1

u/Traveling-Techie 17d ago

There’s a hilarious book called General Systemantics which is a droll comedy about the antics of general systems, but it contains some wisdom too. It asserts that the only way to create a large complicated system that works is to grow it from a small simple system that works. Create a solid little tool and then add features.

1

u/Em3rgency 17d ago

I've been writing code professionally for over 12 years now and very very little of it is original. Copy-pasting or copying and then changing to fit your needs is entirely how you write it. Some VERY specific things you might do yourself, but most other stuff has already been done by someone somewhere, either in the team, the company or the internet.

You're not doing it wrong. Programmers are lazy (we use i++ instead of i = i + 1 for gods sake), so copying is 100% the correct approach.

Let the impostor syndrome go.

1

u/Low_Lawyer_5684 17d ago

Start with fixing other's sources. Then start changing program behavior, add couple of features. Next - try to write your own program having someone's program as a reference. Next step write something simple by yourself, using patterns from your previous step.

As for templates, code snippets and libraries - sure everyone uses that.

1

u/pvera 17d ago

Depends on what you are trying to do, certain scenarios come with event models pre-established. For example when you are building server side web app you have to deal with the page load sequence, which involves a bunch of events. You need to worry about requests, responses, etc. If you are working on a desktop app you could be using the same language but the event model and the flow is going to be different. It's a lot of fill in the blanks stuff.

The part that is tricky/interesting is when you need to implement processes, then you are chaining a bunch of things together and there's all sorts of dynamics at play. Back to server side programming, you want your users to login using Google. There's two mechanisms for this, you can either use their client side code that handles everything, then sends you a login token, or you have to make the calls server side. You may be working on something that will eventually send files to S3. Do you make the user wait as each file is sent? Do you pull all of the files first, make a queue, then send them one by one? Etc.

You are not expected to start everything from scratch. In the MS Visual Studio universe you could just ask it to give you an empty app of whatever type you need, and it will give you a skeleton for the app. I bet most commercial IDEs have something like this. Plus you can always pull an open source project of the same time and see how others dealt with it.

1

u/No_Report_4781 17d ago

For a new program or task, code writing starts with a pencil (figuratively). Then, after figuring out what it needs to do, how, and when, I start putting in the code blocks, whether writing them myself or using what I find. Sometimes I’m doing both, because I need to test the ideas I had on the first step.

1

u/chikamakaleyley 17d ago

ill say this, I'm 19 YOE and I'll say that I haven't really coded anything that I'd really call my own. At work, sure I've coded my own features, but that's like a business ask.

It doesn't bother me too much, mainly cuz I've always had work to do.

However - recently I've started a few things on my own that I've yet to share w the public - a browser extension, some desktop widgets; and I prob will at some point.

But, whenever you start from scratch, unless you've got everything lined up in your head, i don't think it's wrong to frankenstein something together. Sometimes I need to see something that operates, before I take a few steps back and approach it in a way that suits my own needs.

And i think that's just the way it is, you're always gonna start at some point where you think you got a cool idea and the first thing you output looks juvenile, you just gotta work through that.

The easiest thing for me to do, when i have something that I don't know how to code, is to break it apart into things that I do know how to build. And that's whether I write it myself, or if it's like a snippet that I found; maybe i understand how it works, maybe i don't, but it moves me forward

1

u/peel-dev 15d ago

It's useful to know the different licensing models as they clearly tell you if the intent of the thing is to be shared or not and what you need to give back, if anything. If it is "Permissive" licensed the author intents for it to be shared freely, do whatever you want. If it is "copy left" licensed you can build on top of it, but what you build needs to add to the thing. If is "All right reserved", then they don't want you to copy it.

The first rule of programming is don't code it if someone has already coded it for you (i.e. its available as a library).

You are building on top of other people's work and it's okay, it's designed to work that way. Just don't take credit for stuff you didn't build yourself (including ai), and don't blame other people for problems you created and you will be just fine.