Python Forum
Why do I have trouble creating code from scratch?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why do I have trouble creating code from scratch?
#1
Hi,
I could use some feedback. Do I have impostor syndrome or am I possibly not a 'natural' coder?

Quick backstory: After a 20 year marine engineering career, in 2016 I needed a career change and attended a MEAN stack bootcamp (primeacademy.io). I wanted to move my career into the software side of engineering.
I went to school thinking I would be at the top of my class. I was wrong, I was at the bottom. I went to school with some real 'geniuses' who were able to read or hear a problem and then create the steps and code to solve it.


I can't do that. With a problem I stare at a blank screen, with a blank mind, and zero idea what my first steps are. It's ironic too because in my engineering career, I've always been focused on troubleshooting, straight-line thinking, and electrical control systems, and I've been above-average compared with my engineering peers.

I can follow instructions well and that's how I code now, tutorials and problem-solving Google searches, continually. But I yearn for that code-creation skill which I lack. So do I just keep going or, after 2 years now, is it possible I will never be a 'natural' coder?

Thanks,
Phil
Reply
#2
(Nov-26-2018, 03:24 AM)pcsailor Wrote: I went to school with some real 'geniuses' who were able to read or hear a problem and then create the steps and code to solve it.

This is the key: breaking down a problem into steps. Practice doing that. Take engineering problems you've solved. Break it down into the steps you used to solve the problem, like you were writing instructions to somebody. Break down your daily tasks in to steps.

When faced with a programming challenge, try to think of the first step, and do that. Then think of the next step, and do that, and so on.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
It's interesting Craig, I've thought about this alot. I've been a highly regarded chief engineer for 10 years and I've thought, "how can I be so level headed with engineering but so lost with coding?"

My theory comes down to my trained way of thinking. I didn't learn engineering until my 20's. Another words I wasn't raised by an engineer tinkering in the garage (single Mom in NYC). Somewhat early in my career I had a realization, "I have to change the way I think and tackle problems." I had to start thinking in (whole) systems and this is the way I've been successful. Once you know the system, when faced with a problem, keep mentally dividing the system in half by troubleshooting and one efficiently finds the problem.

Coding seems to be the opposite for the thought process. Don't think about the whole project and how it's supposed to end up. Focus on the little piece of code snippet you're working on, get that written, working, and tested, and then integrate it into the whole project.

Once again in my life, I need to change my thought process to become a successful coder. At 50 (ok 49) I'm having the most difficulty with this changing of my thought process.

Anybody experience this, agree, or disagree with my assessment?
Phil
Reply
#4
You need to think about the whole project. Especially in the planning stages that is still very important in programming. And integrating things into the whole project needs to be considered at the beginning, not just at the end. But at some point you have to get into the step by step process of writing the actual code.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#5
I believe everyone can code. We, humans, are natural problem solvers. We doing it every day dozens of times. Even more. Programming is just that. You have the tools ( Python ), you have the environment ( the operating system, the file system, the network ) and you can use them to do what you need.

Let's say we have a file with tab separated names and the corresponding emails and we want to get all with name Jane or Marta. We can copy and paste by hand by the morning. Or we can write a simple program and take it in a second. The steps are simple. We need:
  • The location of the file
  • To open it
  • To read it line by line
  • To check for Jane or Marta
  • To output what we found

# assign the location of the file to a variable. It's short and easy
path = '/home/victor/Documents/contacts.txt'

# opening the file in reading mode - 'r'
with open(path, 'r') as data:

    # we go through the file line by line
    for line in data:

        # check for Jane or Marta in the line
        if 'Jane' in line or 'Marta' in line:

            # output the line
            print(line)
That's it. A simple example which illustrates all the steps and how to use Python to do the job for us.

Check out Corey Schafer's Youtube channel. This guy explains so well.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#6
That's awesome Wavic. Thanks. Overall I keep going because I'm really excited to be learning this and I have alot of natural passion for it. And that's what being alive is about, isn't it?

I will use your code as an example next to my rubber ducky <:

Thanks,
Phil
Reply
#7
Authors have the same problem, staring at blank pages, not knowing what to write. Even knowing what the end story might be, figuring out how to get started isn't easy.

I find it helpful to think of whatever I start with as a prototype that I'll eventually throw away and replace. That way there's no pressure to make it good or follow patterns or anything, it's just something that can help give me a foothold on what comes next.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  NEW TO PYTHON FROM SCRATCH! WISH ME LUCK! RZola 2 2,085 Aug-16-2021, 06:02 AM
Last Post: buran
  Creating Python scripts in Visual Studio Code Sanjish 4 2,606 Dec-22-2020, 12:32 PM
Last Post: snippsat
  asyncio documentation has been rewritten from scratch snippsat 3 2,858 Sep-22-2018, 09:46 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020