Data structures and algorithms

Data structures and algorithms
0

#1

I m currently learning Javascript still and I don t have CS background but reading other threads around I noticed that some people mention data structures and algorithms to make it easier to solve problems and help with programming in general.

Do I need to learn C++ or Java for this? I also want to mention that I learned math longer time ago but since then I haven t touched math subjects anymore so I m quite rusty atm. Do I need to learn math again and then try to learn data structures and algorithms? If so I can search on the forum for such courses, If anyone went through this process and wants to share resources it s also fine.
The more I read on forum the more I realize that I need to learn so much more… I don t want to stop at learning Javascript only. I guess at some point I need to learn some more basic stuff anyway.


#2

No. It obviously helps - having a strong knowledge of how common data structures work, or how to optimise algorithms is not going to hurt at all. But you don’t need it at all for the toy problems on FCC. It is more a case of getting to know what tools are available to you in JS, and how to break a problem down into simpler parts until it’s solvable, and trying out different approaches to a problem. You don’t need maths for that, mostly it comes via practice (which is what the algorithm sections are there for - see http://codekata.com/kata/codekata-how-it-started/ for an explanation of the technique).


#3

I read that CS is more like a tool that helps with going into any programming language in general because it teaches us how to approach problems and that s why I was thinking it might be useful for more complex problems and solving them easier in general and also once I decide to learn other language it might help the process going smoother.


#4

Yes, that is correct - a given language is just a tool to implement some thing. Common data structures are generally common to (or can be implemented in) all languages (though they may be better/worse suited to certain languages). Algorithms are just the necessary set of steps to acheive some result, and there are ways to make them more efficient, to measure how efficient your implementation is and to point toward how to improve that.

The problems on FCC aren’t that complex (though they will likely seem so at first), but what they may help you do is see where you feel your knowledge is lacking - eg maybe you read about stacks or queues, and one of those would be ideal to solve a problem, and so you try to implement one or the other after doing some research/reading and so on.

A few things that might be helpful

A full CS course, using free resources:

Explanation of some common data structures, using JS:

Common programming problem solutions, in multiple languages (imo this is really useful):

https://rosettacode.org/

A site/app for practising programming problems like those on FCC (I like this a lot, you can work through them in one language, then if you’re learning another language, you can run through them in the new language and compare with how you did it in the first language)


I’d emphasise a CS background isn’t necessary to be a good programmer, it can just help.


#5

Thank you for these links. I wanted to start with web development cause I had no CS background and I thought it might be easier this way. I m planning to stick with this atm but for the future if all goes well I might learn new languages and maybe do something different. I always liked games so going into game development one day might be awesome.

As far as I saw C++ is ideal for games in general. But gaming development is a big challenge and I m aware that I might need more math and not only so I ll stick with web development for now :slight_smile:
I also heard about CS50 course and I think I might start with that and go further with other resources.


#6

Heh, I’m starting down the road of trying to git gud at game development, and maths is necessary there - but note a lot of that is geometry, calculus, and vector and matrix maths (supposedly you only need to know the simple stuff 99% of the time but as it’s been a very long time since I learned high-school level maths, simple stuff === hard for me).

For web development (front or back end), you very, very rarely need anything beyond the most basic of basic maths. Data structures and algorithms - again, deep knowledge is going to be helpful in some situations, but generally all that’s needed are the very, very basics.


#7

Math has never been my friend. I mostly learned cause I had to do it not because I felt love for it. But I like games and for this I might have to learn math again, but the simple thought that I have to start all over again and I forgot lots of stuff since it s been a long time for me as well.

I might remember some stuff but I will have to start all over again still. If everything will be ok I would consider in the future since gaming was always a hobby but for now I want to focus on web development, baby steps and stuff, but later I really want to go into much more deep into programming.


#8

@Osiris What I hear often from vet programmers put concisely:

Knowing syntax and thinking like a programmer/using best practices are two different things.

You can learn fundamental data structures pseudocode to algo - to coding - to debug - to coding processes using and learning any language.

Some languages are more robust than others but an architect doesn’t necessarily know the mix ratios for every blend of concrete cement or drywalling methods etc…

@DanCouper Thanks for the useful links!

I am still relatively new to code as well, not including a few QBASIC and VBASIC things I played with as a kid and classes I took in grade school and college.


#9

@Osiris @microbay by nice coincidence, this blog post was published today, and it covers the issue a little bit more eloquently than I put it:


#10

Yes yes yes.

This should be the answer to your own thread :stuck_out_tongue:
Because pretty much what you said is the right answer, and idea. Computer Science is the science of computation in general. Computer science will teach you a Turing Machine is a strong as any programming language. And with that knowledge you can understand programming in general a lot better, since you tackle the concepts.

Also I hate math and I’m not very good at it and to make games you have to deal with physics most of the time (depending on the game we are talking about) also something like Unity allows your to use a high level language(C# is the common lang for Unity) to develop games without going deep into the underlying math or dealing with a lower level language like C++. You totally can create game in C++, but you would more or less be making the game engine, then the game. (This is what most companies do)

Finally all Computer Science knowledge is very applicable to all areas of programming, regardless of realm (game development, web development, etc) or goals, they do help and are great for your career if you do plan on being a professional programmer (or hell at least a better hobbyist haha)

PS I think I liked the wrong post, oh well haha


#11

Thank you for your answers they are a great help.