I’ve been coding for a month and i love it i quit playing games and sold them, I’ve even been so dedicated i quit smoking cigarettes. I keep struggling though whenever i need to make the code from scratch how do i know where to start I always have to go online or look at notes to find a starting point.
What code from scratch are you trying to build?
I had that too. I know it may not seem like it right now and that you may think “oh my brain is not made for this code thing” sometimes, but simply the more you practice you get the more it will all start to feel more natural and second nature. Keep in mind that even seasoned coders go online sometimes to check simple syntax things so don’t get discouraged by that, I check stuff online all the time at work (though I’m at a Junior level).
I’ve been developing for 20+ years, I still regularly have to look at notes and go online - so don’t let that be your measure of your success/failure. You’ll do it less as you get more practiced.
There are a couple of techniques related to Test Driven Development and Behavior Driven Development which help. Essentially what you have to do is keep breaking down what you need to do into smaller and smaller pieces and if possible write them down in the form of tests.
For instance, if you are making a website with a login form, break that down by asking yourself questions about what it means. What’s in a login form (title, username label, username input, password label, password input, login button) and then ask yourself questions about each one of those elements, what does title do? what does username label do (when user clicks on label focus goes to username input) what does username input do (receives input, validates input, submits on enter key)? How does it validate? What are the validation rules? and so on and so forth. At the end you should have essentially a list of requirements and tests to validate you are meeting requirements. But even if you skip writing tests, you still have a better idea of each of the functional pieces of your component and where to start development.
There’s no shame in looking at code to get you started. My advice to you is to keep looking at the bigger picture: the code is just lines and syntax. The important question to ask yourself is this: when you’re facing a problem, can you build the algorithm to solve it? Can you visualize the steps and make sense of them in a particular order? If yes, then you’re on the right track. Eventually you’ll get wired to the syntax and find it easier to begin writing the code without having to look at a sample.
Keep going. The road is long and arduous, but it’s made to be worthwhile in the end.
@theironcock, congrats on all the life changes in addition to starting your coding journey. Those are no small feats.
Damn, I feel like that everyday!!
I’ve been coding for around 10 years now and professionally over 5 years.
I still have to look at Stackoverflow, google, notes from my evernote and such.
Don’t worry about not having to memorize stuff.
I cannot remember where I saw this, but to paraphrase. There will always be tons of similar code and helper docs online somewhere. Coding is about understanding how things work not trying to remember everything.
What I do (and I’ve been coding for so long now it’s starting to come naturally) is to break problems down. To start, I’d write an outline of what the computer was going to do step-by-step like this on paper:
I need to reverse a string.
Try thinking of it like this:
Well, first I’m going to need to get the string. Then, I’m going to have to loop through it backwards, character by character, and add each of those to the beginning of another string.
My main point is to try to think like a computer when solving problems.
Good luck and hang in there!
I can SOOOO relate to you. Sometimes I feel like a fraud or think that perhaps I’m not learning anything, but I know that’s not the case.
Going off of what others have said, breaking things into smaller pieces is a great way to start shaping your mindset to ease off the needless stress and worry. If you can’t seem to find a place to begin, sometimes it helps to just start coding and go from there.
… I’ll add a header at the top
hmm maybe I should put the nav before, or I wonder if it would look better styled inside the nav !!!
Wait! What about some cool icons and maybe some content or jumbotron next ?!?!!?
But in all seriousness, try not to stress yourself out too badly and NEVER feel bad about looking up code. No one expects you to memorize every method, of every library, of every language that happens to be popular at the time. Hope that helps
Random collection of thoughts:
I think every project is worth staring at a wall or something for a minute or two, just to get your brain use to the idea behind the project.
Ain’t nuton wrong with looking at notes, going online, you might get distracted.
Every project has steps or stages, and every user story is one or more steps (I’m assuming you’re on to the algorithm projects.)
I look at the rest as a lack of momentum. So don’t just sit there, sit there and do something, even if it’s write a comment at the top or start with the html/css code.
Pick a user story, write code and test it until working, then move on to the next.
I start with pseudo-codes as comments in my code or html page. Then, they get more detailed, or more fleshed out… then it’s converted to the language syntax.
// display form // upon form submit, validate // create new database record // save and close table
then I may write additional notes/comments
// display form // use bootstrap form classes // form must be mobile-friendly // data validation on form inputs via (React, Vue, Angular, whatever) // use pulldown menu for states // use jquery/ajax to real-time check if entered IDs are unique // upon form submit, validate // re-check if ID at least 4 char long, mixed alpha, numeric. filter out all symbols (quote marks, etc) // re-check that email address is valid format // re-check if password must be 8 characters or longer // re-check first and lastname entered // create new database record // remember to capture IP address of user, and also save to database // store datetimestamp // id is auto-incremented // save and close table // go back to main menu after successful save // display error if not
Once you have notes like these, it’s just a matter of converting it to the language you’re using for that project. These also serve as reminders of the big picture stuff you need to do, and avoids tunnel-vision when you’re working deep in code, without a guide.
Just some tips, hope you find it useful.
That’s what the internet and a global community of developers is for. You are doing the right thing. Whenever solving a new problem, go check if anyone did something like that already, find their code, see if you can improve it, and share back whenever you can.
Thank you for asking this. I had been facing the same code freight even after I just finishing a class! From the responses I see it’s not a big deal. I am even going to start saving some of my basic code for re-use.
thank you all so much i really appreciate the help and support. On same note i’m about to get the first certification and really need someone to pair code with.