I've gone through multiple programming tutorials. How do I actually MAKE STUFF...

I've gone through multiple programming tutorials. How do I actually MAKE STUFF? All I've ever done is programming exercises. I don't have a clue how to actually make an app or videogame or website

If you actually gotten in a lot of practice you should be able to figure out how to make pong by now.

You already asked this in /dpt/

A thread died for this shit...

read your sicp

Do NOT do this

You know what's the easiest way to get chops up?

Make games.

Make clones of basic shit. 1942, breakout, pong. Remake a classic old game

I've almost finished the third chapter. It is boring

APIs. If you want to make a program with a GUI you'll need some sort of API. What you use will depend on what language you're using and what systems you want to develop for.

Because you are a noob. Come back at it when you got better with programming and it might help you.

Just one example:
In one of the first chapters they are talking about the various kind of recursion. And yet you'll see o many guys doing this:

fib(x) {
if (x==1) or (x==2) return 1;
return fib(x-1) + fib(x-2);
}


You should know why this is a very bad idea, do you?


You see, all you have to do is doing "programming exercises" with more ambitions. If you can make a FizzBuzz, then maybe make a TicTacToe game. Then make it so you can save your current state. Then add a graphic library and make it more beautiful. Then make a field with 4x4 and more complex rules..

Just copy what you see or know, there is no need to reinvent the wheel.

And if you find that you are reaching your limits in terms of code structure then it's time to learn about software engineering and test driven development. But it's a continuous process, one step after the next one.

I'm not op, but why is it bad? What is the correct way to do it?

I'm not sure. Because it might need lots of space?

ask this guy instead:

You repeat the calculation of fib(x-1) in fib(x-2)

Uhh other way around
tfw brainlet

How would you solve this problem?
t. New to this thread and curious

Look up memoization [sic] and dynamic programming. They are two different methods to avoid repeated calculations in recursive algorithms. Learn more in algorithms 101.

Because you calculate the lower fib numbers a lot of times.
>pic related


Read SICP.

You save a lot of computation if you make it a linear iteration:

fib(x) {
return fib_iter(1, 0, x);
}

fib_iter(a, b, counter) {
if (counter == 0) return b;
return fib_iter(a+b, a, counter - 1)
}


Every step of this process has all the informations to proceed: the higher number, the lower number and the counter.

Other properties are that it's nicer to the stack, because every process spawns only one process. And it's tail-recursive which makes it good to optimize in some languages.

Just calculate fib(6) and you'll see the difference..

Forgot the pic.

Come to terms with your ego and laziness and force yourself to write something above your skill level knowing that it's going to be garbage. Also, read lots of code.

this, grab Godot and make games. You will improve your skills and maybe get into a new hobby.

Or, you could learn VBA and turn into an Excel wizard and get loaded with money doing macros.

Roll now or forever be a dummy.

>VBA Excel macros

An economist friend of mine got sick of helping the old people in his office everytime they fucked up their spreadsheets. I hacked together a GUI for him to put on the shared drive, and some higher up somehow found it. Now it's apparently used in fucking banks all over. It was so shittily made, too. Kek.

that's the power of Microsoft

Nobody has yet addressed the fact that using recursion to solve a problem that doesn't become easier on the programmer or the computer because of recursion is stupid and causes stack overflows for large n. Dynamic programming as mentioned before is a good solution for finding many values in the fibonacci sequence, but not particular independent values

int fib(int n) {
int i;
int f[3] = {1, 1, 0};
for (i = 0; i < n; ++i) {
f[2] = f[0] + f[1];
f[0] = f[1];
f[1] = f[2];
}
return f[1];
}