Getting beyond programming basics

Hello Sup Forums,

so I've been starting out programming, both in C(using mostly google) and in Python(using mostly learnpythonthehardway). I really hate the book because it doesn't at all emphasize some background knowledge / terms that I think would be useful to even start a conversation about things.

For example I wondered about pointers in other languages, because I just read about them in C and they seemed really important but apparently there's no such thing in Python.
However there seem to be barenames and decorated names. I'm 20 exercises into this book and never heard of those.

Point is, I'm constantly hitting brick walls. I can program your usual FizzBuzz or "count from 700 to 200 in steps of 13" but as soon as I want to try something else I feel uninstructed. Things like why gets() is a bad thing.

The way I progressed in C was picking some challenge I thought I could do and doing it. That was fun and helps me stay motivated. But I am constantly baffled at how "untrivial" seemingly easy challenges are.

To break off the rant, can someone help me out? Someone who knows the feel and got over it?

I wish there was just a long list of programming challenges sorted by increasing difficulty where I could acquire the missing pieces myself.

Otherwise I guess some non meme book recommendations would be nice.

I don't wanna do
>pic related
all the time.

For C I use CodeBlocks with the GCC and for Python it depends on the platform I'm on, either Notepad++ or Gedit and the command line.

(Reason for this thread is I was curious about how to help port a tool called GeDoSaTo from DX9 to DX11, but I probably don't even know what I'm asking, which is exactly my problem.)

Other urls found in this thread:

xkcd.com/323/
webassembly.org/
twitter.com/NSFWRedditImage

Try ProjectEuler.

Also, I've been learning C++ as well for a month and struggle with some trivial shit. Crushes my self-esteem, familia.

People keep telling me I shouldn't start out with C++, would you share that notion?

go through these maybe

I feel like most of these are really god damn hard for me right now.

#include
#include

//This program will find the sum of all multiples of 3 and 5 below 1000

int main()
{
int i = 1;
int sum = 0;

while (i < 1000) {
if (i % 3 == 0) {
sum += i;
}
else {
if (i % 5 == 0) {
sum += i;
}
}
i += 1;
}
printf("%d", sum);
return 0;
}


Did the first projecteuler challenge. I totally didn't think it would work but it did.

The thing is I'm not sure I want more mathematical proficiency right now? What I do want is being able to look at any given project of any given complexity and at least know enough so that I can look where to find specific information on the topic.

If that makes any sense.

Do you have any of the previous versions of this image? Looks like an excellent thing to have on my desktop.

>Coding Drunk

Is there some point to this?
Is there some weakened state you can put your body into that will increase it's trained strength when restored back to normal?

I can't, I like the language (yet). However, I didn't get past classes and templates, not saying about writing a complex program with several algorithms here and there. The general feeling I get as I deep down into the language practices, its syntax and nuances, etc, that I am pretty slow learner (read "retarded"), I think everybody else in my place would have already learnt much, much more.

>What I do want is being able to look at any given project of any given complexity and at least know enough so that I can look where to find specific information on the topic.

Guessing that it's simply related with practice. Why wouldn't you look out for junior Python tasks? Depends on literature you grasp, do every task listed there, if it is, of course.

When I was learning python I decided to pick up tkinter and make a few cool things that helped me with my daily tasks. It was a good exercise and I suggest you do the same, start a project with end result being something useful for you, even if a program that can do that task already exists.

>What I do want is to be able to look at any given project of any given complexity and at least know enough so that I can look where to find specific information on the topic.

Yeah, that comes with experience. Think of it like this: if you had no knowledge of basic math and walked into a calculus class, you'd be fucked. In the same way, trying to look at any project of any complexity when you haven't done a lot of small things in the given language will leave you lost. For me, I rewrote a lot of standard utilities like grep, cat, ls, etcetera etcetera. It helped me learn the ins and outs of C (C++ too) so I would be able to apply the same small tricks to larger projects.

The problem is the things I really actually want for myself are usually far too complex in scope.

Found your problem ; problem solving skills if you can solve problems and break them down & know the language syntax you can program.

Why do you want to learn programming?

C is a low-level systems programming language. Do you want to program microcontrollers or write a new OS?

It's hard since you don't see the "bigger picture".
C has a lot of things that are pretty cool for mid/low level programming, but unnecessary for programms where you don't need every microsecond of speed.

Python is actually C underneath (it's written in C), but the abstraction level is much higher. The reasoning is that developer time is often more important than super-high performance. Python already is fast, it's just as fast as something like C.


Here is a game plan for learnign a langauge:

1. Learn the basic syntax:
Do simple tutorials, (i.e. "learning blabla in 30 days"), search some challenges (like posted in this thread). Just look them up on wikipedia, try to understand the code examples in different langauges. If you are lost look up the solution in the language you want to learn. But try to solve it yourself first.


2. Learn some important libraries.

Just google "what are important libraries in [language]". Try to use them or find examples where you can use them. Think of easy projects, for example you want to learn a user interface library? Make a simple calculator.


3. Learn some theory.

3a) Data structures
Try to build some data structures in your favorite language. Try to make a doubly linked list in C or a radix tree in Python.

3b) Sorting algorithms, O notation
Try to look up a bunch of sorting algorithms (bubblesort, quicksort, mergesort, heapsort..). Try to understand the big O notation, it's not hard.

3c) Test drive development
It's pretty good to learn testing from early on, especially for beginners. Google up "introduction to TDD in [...]".


4. Learn some important frameworks.

Just google "what are important frameworks in [...]". For example in Python there's a lot of stuff for scientific purposes or web development. Just start simple, you can do a basic webserver in a few lines of code with the right python framework.


5. Whatever you do, have FUN and be passionate.

C is great for understanding programming in general. Also it's some kind of "lingua franca" of programming (together with Java).

It's not a language you want to work with professionally, but it's good for beginners.

> it's just as fast as something like C.

sorry, I meant: "it's just NOT as fast as somethign like C"

Absolutely, but for beginners it's preferable to get started in a language that can get shit done purely for motivational reasons

Theoretical and lower level content can still be learned after a beginner has been convinced that programming is great and after he has written some higher-level systems


imo

relevant xkcd xddddd

xkcd.com/323/

You cannot fucking count from 700 to 200 in steps of 13 fucks sake

then figure it out! You can't learn anything by not learning.

Don't do programming challenges? I don't see any benefit in them other than patting yourself on the back.

Do little projects. For example a python script/program that fetches pictures that fit a certain criteria from a specific folder to your standard picture viewer.

What can these criteria be?
>name
>file size
>resolution
>a sample picture with matching color distribution

Then you can do improvements.
>pick any folder
>allow subfolders
>don't open with an external program but within your program
>add another feature like: renaming
>write your own GUI for it

While you are at it there will be new projects coming alive in your head, because when you start doing something you'll find out how to utilize your programming skills.

Will your efforts be shit. Yes they will. The first thing that will feel like wading through shit it picking a image library or an api for it in python. The final will probably be picking a gui library for Linux.

Don't do to complex shit. Add one little feature and later another. If you start to complex you will get errors untraceable.

Yesterday I restarted my app, because I wanted to many options for it, while being hardly familiar with c# or visual studio. I knew that I will lose my drive if thinks are too complicated.

Later pick up some theory. For example when your script will take ages to execute, you know that you've done something not very efficient. What's Big O, and so on.

Small stuff like Euler can be good for self-esteem and motivation.

webassembly.org/

How gives a shit about math 2bh
inb4 math is too hard
it's my major

Read SICP

thank you for the extensive replies.

I started with Python but got bored, then got to learn some C due to my job (in the broadest sense.)

I found it really intuitive and thought that if I can do a task in C I can do it in any language. Also, since C seems rather basic I feel like Python is doing some magic noone really knows anything about.

Example: I was looking for the correct solution to the second project euler problem. It involves the Fibonacci numbers. In C I would first need to define the sequence. All the solutions involved a fibonacci function built in the language they used. Which for me seemed to defeat the point of the exercise.

I know you won't land on 200 precisely. The point of these kinds of exercises are to give you a simple arbitrary task to see if you know anything about programming at all.

I get it but it's the brick wall problem. I try to google how one specific thing works and the terminology used in the answers seems like a different language. Googling 20 things to understand the one thing I originally googled seems really inefficient. Especially if any of the 20 things again need further explanation. Which is why I made OP.

No.

>I'm missing background knowledge / I don't understand the lingo
Read a solid foundational book, e.g. The C Programming Language.
For Python, read the Python Tutorial / Documentation.

>Long list of programmibg challenges increasing in difficulty
USACO Training Gate. Nice way to learn about data structures / algos / problem solving, some problems can be very hard but you'll be provided the necessary background. Project Euler is nice as well.

Also for C you really should be practicing on a Unix-like OS. For Python it doesn't fucking matter, just do stuff. It is much easier to do real life stuff in Python as it is suited for quick scripts.