r/AskComputerScience • • Sep 14 '19

What are some basic Computer Science concepts every self-taught person should know?

I have been a frontend developer for almost two years now. I am self-taught so I didn't study Computer Science at the university, which means there is a considerable amount of holes in my knowledge. That's why I would like to ask what are some basic concepts that every self-taught developer should study in order to have a better understanding of the tools they are working with.

I have always have a natural curiosity and am still very much learning a lot about programming and computers in general, but as I try to learn more and more about tools, languages and technologies (JavaScript, Blockchain, Mobile Development...) I come across basic concepts and ideas I am not familiar with. For example, I don't really understand what a Turing machine is or what we talk about when we say procedural programming.

When I ask the which of these concepts to learn to have a better general understanding of how computers work, people often say it depends on your career goals. But in my case, I don't really have a defined career goal, and it's in part due to my lack of understanding of what else I could be doing with the tools available out there. I work as a frontend developer for a blockchain development studio, which I love and hope to get deeper into, but at the same time, I feel like I will never become a better developer as long as I lack some basic computer science knowledge. I am currently learning C, as most serious developers I've talked to have explained to me the importance of understanding C. What are some other concepts, books, design patterns, technologies... you would recommend to learn to someone without a CS degree?

37 Upvotes

23 comments sorted by

View all comments

Show parent comments

1

u/beeskness420 Sep 14 '19

What do you mean by a looping over a loops of loops being exponential?

2

u/IAmNotNathaniel Sep 14 '19

It means that if you loop over an array of n items, then within that loop you do another loop over some other list of m items, you are now doing n*m loops.

Now add another loop of p items. you have n*m* p iterations.

Which is fine when the numbers are small, but if any of the indexes increase in size - or worse, if your logic is such that n and m are related (i.e. increase of n results in an increase of m and p) and with a list of only 1000 items you can easily be doing 1000*1000*1000 = 10003 or a billion iterations.

It's usually easy to avoid, but for newcomers it's easy to forget about. Or sometimes you might decide to use a library function in a loop and not realize it loops inside as well, etc.

1

u/beeskness420 Sep 14 '19

This doesn’t describe exponential behaviour.

Number of loops is independent of complexity, all that matters is total number of steps.

It’s only in simple special cases you can compose loops by multiplying them together.

If you want an exponential algorithm why not just loop over all binary numbers of length n?

A freshman is more likely to say the above example is cubic rather than hinting at anything exponential. But you really can’t say anything just based on number of loops.

2

u/calinet6 Sep 14 '19

It's been a long, long time since I was a freshman, and the real world is very different from university CS (I tend to lazy-load memories from CS classes as needed). But, this is AskComputerScience and not AskSoftwareEngineering, so I stand corrected.

It still could be quite bad, though, and that's the point—and it's one of the things I see junior software engineers (or even more experienced folks without formal CS experience) gloss over and run into issues because of it. Maybe not accidentally writing exponential time algorithms (though I have definitely seen it), but definitely some gnarly polynomials that really could be broken up or optimized. It happens often, and that's the thing to remember.