Create software from scratch.

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 1584 Views - Last Post: 08 April 2018 - 12:03 PM

#1 [email protected]   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 94
  • Joined: 24-February 15

Create software from scratch.

Posted 13 March 2018 - 06:48 AM

Why is it that when I think about making something like pong for example, my brain directly freeze and I don't what to do.
How do I get the thinking part of code and create software from the bottom till the end. I got the basics down and I know practice makes you better, but that part keeps busy for a while because I'm not getting anywhere. Has it something to with studying design patterns?
Is This A Good Question/Topic? 1
  • +

Replies To: Create software from scratch.

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14091
  • View blog
  • Posts: 56,456
  • Joined: 12-June 08

Re: Create software from scratch.

Posted 13 March 2018 - 06:55 AM

*
POPULAR

Write it down on paper. Get your software design doc sketched out.

List out:
-- the goal,
-- the moving parts,
-- all the functionality,
-- user interaction,
-- gui layout,
-- screens, windows, characters, etc,
-- what defines an 'end point',
-- chalk up features that are needed to produce a minimally viable product and which are gold plating

Basically write out the end to end coverage and requirements. With that done THEN start the actual coding and use the doc as a guide.
Was This Post Helpful? 7
  • +
  • -

#3 h4nnib4l   User is offline

  • The Noid
  • member icon

Reputation: 1274
  • View blog
  • Posts: 1,809
  • Joined: 24-August 11

Re: Create software from scratch.

Posted 13 March 2018 - 07:52 AM

*
POPULAR

One of the most important mental processes needed to be a good developer is the deconstruction of problems. The game Pong isn't one thing, it's a collection of things that work together to provide a user experience. If you want to build it, you have to break it down into those discrete pieces. If you look at those pieces and don't know what to do with them, break them down more. A solution is atomic like that - you can always "zoom in" a little further and find another level of interactions occurring that defines the structure and rules of the interactions a level up. The "ball" in pong, from the user level, is just a white circle that moves around and bounces off of stuff. If you go down a level, it's an ellipse with ever-changing coordinates in a 2D playing field with conditions that fire when those coordinates match certain conditions, namely intersecting with other game objects. At another level down, those conditions are defined - hitting the top or bottom walls, or a player paddle, causes the calculation and application of a new vector of movement based on a number of conditions; hitting the right or left walls constitutes points for the player defending the opposite wall. Down further, movement itself is defined as the combination of a vector of movement and a rate of change. Down further, a vector of movement is really a formula being applied to every point contained within the ellipse. Down further... see what I mean?

This is by no means a proposed template for you to use, it's just an example of the kind of thinking you'll need to apply to the problem you're trying to solve. A surprising amount of programming requires no keyboard (in fact, a keyboard would simply get in the way).
Was This Post Helpful? 7
  • +
  • -

#4 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 2539
  • View blog
  • Posts: 10,171
  • Joined: 03-December 12

Re: Create software from scratch.

Posted 13 March 2018 - 08:11 AM

View Posth4nnib4l, on 13 March 2018 - 09:52 AM, said:

A surprising amount of programming requires no keyboard (in fact, a keyboard would simply get in the way).


I get more accomplished than most, and intentionally spend the most time away from my keyboard. If you can think through the problem to find the solution, it doesn't matter where you are to do it.
Was This Post Helpful? 1
  • +
  • -

#5 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 11069
  • View blog
  • Posts: 18,906
  • Joined: 19-March 11

Re: Create software from scratch.

Posted 13 March 2018 - 08:41 AM

Quote

How do I get the thinking part of code and create software from the bottom till the end. I got the basics down and I know practice makes you better, but that part keeps busy for a while because I'm not getting anywhere.


We say it a lot around here, because it keeps being true: build lots of smaller things, because the smaller things teach you how to build the bigger things. Start with something simple, like tic tac toe or rock paper scissors. Make it work as a command-line interactive thing. Then make the one you didn't do. Then make a slightly more complicated game - don't try to make a fancy interface yet, just get the game logic. Repeat until it feels like you're just repeating yourself.
Then go back to square one and maybe make a GUI version of your tic tac toe or rock paper scissors. This will probably require rewriting a certain amount of the logic. This will be painful and you will learn from it. Repeat for the other games you built. At some point you will definitely feel like you're repeating yourself. Try to pay attention to that: is there anything you can pull out and reuse?
Once you have GUI versions of the games you've already built, write a new game. This one should play either from the command line or from a GUI, without changing the underlying logic. That is, you're going to have two different front ends, one of which I access by starting the game from the command line and the other of which is accessed by launching your application. Now you're going to have to think about architecture a little bit.
And so forth - gradually work your way up to more ambitious stuff.

You probably won't do all of this, of course. You will find other things to do, this is just one path which you could follow. But until you've done something equivalent to these steps, you're likely to be floundering. Build much, it's the only way to learn.

Quote

Has it something to with studying design patterns?


Sort of. I don't recommend studying design patterns, actually or at least not until much later on. They're fantastically useful, but mostly they're useful for organizing the understanding that you've built up by making lots of little things. The reason you build lots of small programs is so you can make lots of design mistakes. The reason you then add functionality to stuff you've already made is that extensibility is a critical part of architecture. A design that constrains you and prevents you from adding new functionality is a bad design. How do you learn about constraints and how to avoid them? By building bad designs and seeing what constraints they put on you.
Once you've done that, you can go back and see that people have named these things, and that's fun too.
Was This Post Helpful? 1
  • +
  • -

#6 [email protected]   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 94
  • Joined: 24-February 15

Re: Create software from scratch.

Posted 13 March 2018 - 10:58 AM

Ah thanks for the great answers, it still feels that the smallest of the smallest like a tic tac toe game feels very very complicated, but I will try my best applying this knowledge.
Was This Post Helpful? 1
  • +
  • -

#7 jon.kiparsky   User is online

  • Beginner
  • member icon


Reputation: 11069
  • View blog
  • Posts: 18,906
  • Joined: 19-March 11

Re: Create software from scratch.

Posted 13 March 2018 - 11:21 AM

View Post[email protected], on 13 March 2018 - 12:58 PM, said:

it still feels that the smallest of the smallest like a tic tac toe game feels very very complicated


Then do something even simpler. Matching pennies? There's a mantra: "do the simplest thing that could possibly work". Think of the simplest thing that you could possibly write, then write it. Then think of something that does a little more, and write that. Repeat until winning.

Quote

but I will try my best applying this knowledge.


That's the stuff.
Was This Post Helpful? 1
  • +
  • -

#8 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5224
  • View blog
  • Posts: 14,003
  • Joined: 18-April 07

Re: Create software from scratch.

Posted 13 March 2018 - 12:57 PM

You have gotten a ton of great advice and I recommend it all. I wanted to add to the conversation with a slightly different perspective in that sometimes it feels overwhelming to just get started. Sometimes it gets harder as you get more experience. Just think of it, if you can build anything and have built a lot, wouldn't it be harder to build something you find interesting and haven't done before?

My recommendation, and what helps me from time to time, is just write a function or a class. Something ridiculously simple. Then ask yourself "how could I make this better?" and then suddenly you find yourself coding more and more. It is like when you doodle on a piece of paper when talking on the phone. You start by drawing a circle, then some other shapes and by the time you get off the phone you have something sketched out that is freakin awesome and wish you could frame. This tip helps with tons of professions. Coding is one but it is a great way to get past writer's block too.

Good luck with the project! :)
Was This Post Helpful? 1
  • +
  • -

#9 NeoTifa   User is offline

  • NeoTifa Codebreaker, the Scourge of Devtester
  • member icon





Reputation: 4211
  • View blog
  • Posts: 18,472
  • Joined: 24-September 08

Re: Create software from scratch.

Posted 13 March 2018 - 02:29 PM

Just do what I do: contemplate the project, different styles, different languages, different frameworks, different patterns, etc. and get overwhelmed and give up before you even start.
Was This Post Helpful? 2
  • +
  • -

#10 8Bit Bob   User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 69
  • Joined: 07-February 18

Re: Create software from scratch.

Posted 14 March 2018 - 07:06 AM

Neo, you must be a very efficient programmer :P
Was This Post Helpful? 1
  • +
  • -

#11 NeoTifa   User is offline

  • NeoTifa Codebreaker, the Scourge of Devtester
  • member icon





Reputation: 4211
  • View blog
  • Posts: 18,472
  • Joined: 24-September 08

Re: Create software from scratch.

Posted 14 March 2018 - 07:55 AM

The most efficient.
Was This Post Helpful? 1
  • +
  • -

#12 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7181
  • View blog
  • Posts: 14,969
  • Joined: 16-October 07

Re: Create software from scratch.

Posted 14 March 2018 - 08:08 AM

View Post[email protected], on 13 March 2018 - 12:58 PM, said:

it still feels that the smallest of the smallest like a tic tac toe game feels very very complicated


As much as I admire modi123_1's organizational skills I, alas, don't have them. Which is to say, I understand exactly where you're coming from. Indeed, if I had to map out an entire project start to finish, I'd probably never be able to leave the house.

I like tic-tac-toe, so lets start there. Don't think about it too much, just pick one thing you'll need to do and do it.

You like GUI; draw a board. Don't even worry about any code, just paint a picture.

How to store a board in memory? It's nine positions: you want nine variables? An array? A string? You needn't start with the best choice here, but you might get there eventually.

Oh, hey, how can you draw the board in memory? How will you change the board when a move is made? How will you process a move from the user? How do you know when the game is over? Check for a winner?

If this seems all over the place, it is. Is it a lot to think about all at once? Yep. But the point is that you don't have to think about it all at once. The art of programming is breaking down big problems into smaller problems, and those problems into smaller problems, until you have something you can wrap your head around. Once you've solved a few of the really small problems, you'll often have a more concrete idea of how to tackle other, larger, problems.

You say, "from scratch." Meaning that you're familiar with tweaking extant code to some extent, just not dealing with the blank abyss of nothing. Well, get enough of your code filling in the gaps and you're no longer at "from scratch" and well into "wrangling my mess." Which is a much easier place to be.
Was This Post Helpful? 2
  • +
  • -

#13 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14091
  • View blog
  • Posts: 56,456
  • Joined: 12-June 08

Re: Create software from scratch.

Posted 14 March 2018 - 08:13 AM

Really? Not even a post it note list of features to keep in mind? Hmm. Guess I am a weird one.
Was This Post Helpful? 0
  • +
  • -

#14 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7181
  • View blog
  • Posts: 14,969
  • Joined: 16-October 07

Re: Create software from scratch.

Posted 14 March 2018 - 08:24 AM

Taking notes? Seriously?!? Hard copy is for losers. ;)
Was This Post Helpful? 2
  • +
  • -

#15 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6642
  • View blog
  • Posts: 30,931
  • Joined: 10-May 07

Re: Create software from scratch.

Posted 14 March 2018 - 09:24 AM

View Post8Bit Bob, on 14 March 2018 - 09:06 AM, said:

Neo, you must be a very efficient programmer :P/>

Doubtful, she's a Java geek.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2