Learn algorithms and data structures instead of programming languages and frameworks.

@alexcleac Learn problem analysis and communication instead of algorithms and data structures.

@deshipu can you solve computing problems if you don't know algorithms and data structures?

@alexcleac When was the last time you had to implement your own sort algorithm?

@deshipu long ago. There are algorithms besides sorting algorithms, most of which are implemented almost in no library

@alexcleac And you are not going to learn them in an "algorithms and datastructures" course, or find them in books. Besides, no point in memorizing them, since you could as well spend that time implementing a library and never having to think about them again.

@deshipu nice point, although to implement it you have to know it.

Although, I don't think that problem analysis and communication are thinsg less relevant than basic CS subjects. I think they have to be learnt all together, but it is hard for me to imagine university courses on them 😁

@alexcleac To me it's the difference between memorizing the Bible and knowing where the library is and how to find the book I need in it.

Yes, you need to learn the basic mathematical thinking skills to even be able to understand those algorithm descriptions. But memorizing how to rotate a red-black tree on a whiteboard is not going to make you a better programmer.

@deshipu agree. Memoizing how to rotate red-black tree is not going to do any good work except if you are rotating them every day by hands 😂

Although, understanding, how red-black tree works under the hood will help you recognize it and understand, which operation is fast enough, and which should be avoided. There is no need to learn every single algorithm - there are too much of them, that won't make you a better programmer. But understanding basic concepts on them will make.

@alexcleac You really think a programmer who knows algorithms and data structures but only one programming language will write a better quality code than a programmer who knows many programming languages but only one data structure?

@wolf480pl I think that learning programming language is not that hard and useful compared to learning basic CS subjects like algorithms and data structures.

You can learn any language to level at which you can write decent code in a month or so. It may be not that idiomatic, but you will be able to achieve most of tasks if you at least know theory under the hood.

@alexcleac but if you only know one language, you lack perspective of what languages can do and whether the one you're using is a good fit for the job.

I'd recommend everyone to learn a few languages that are far enough from each other, to learn different paradigms. Maybe sth like:
- C
- OCaml or Haskell (static functional)
- Java without lambdas (static OO)
- Python or JS or Lua (dynamic)

and if you want to explore more:
- Prolog
- Smalltalk (eww)
- Erlang or Elixir

@wolf480pl basically, at this point you are right: learning languages from different ends spectrum helps a lot. But still, does linked list or binary trees behave much differently in C, Haskell or Elixir? This is kind of point I am trying to make 😉

@alexcleac yes, definitely!
In particular, in C you don't have GC and are more likely to use mutable data types. In which case sharing list nodes between lists is hard to do. So a double-linked list or array list will be preferred.

OTOH, in Haskell, you're more likely to use a single-linked list, as making a double-linked list or array list would be difficult to work with in Haskell's type system.

@wolf480pl doesn't single-linked list in Haskell work exactly the same way it works in C? Yeah, languages can limit in some ways... but the math underneath is still the same.

@alexcleac the theory stays the same, but the considerations which to use in which situation change a lot

@wolf480pl That seems like a silly question, but.... yes, I do!

The boring answer is of course you need both: without some feeling for algorithms and data structures you won't become successful in any language.

On the other hand, different problems sometimes call for different languages.

To make things worse: some algorithms/data structures fit better with one language than another, and vice-versa!

@alexcleac Indeed.... but one way to learn a new approach can be to learn an new programming language.

For example I can comprehend C, C++, Fortran, Python and related imperative / OOP languages with ease. Learning Haskell is an ongoing task which forces me to think differently.

@ashwinvis FP introduces a bit higher level abstraction on how programms are executed. It's like ASM -> C: it still has same concepts applied, same algorithms, etc. But with a bit different abstraction level.

@alexcleac Better abstractions are essential. If we were trying to mimick assembly we would still be using the goto statement.

FP let's you think problems differently as a flow of data, avoiding mutation, and composing higher order functions. I guess that is inline with your point in learning new algo and data structures. Alternatively one could stay with familiar tools and try to translate mathematical concepts into new code.

@alexcleac I think what you want to say is: learn the *general concept* instead of *special technologies*. And I fully agree!
Technologies come and go, but the general concept stays the same.
On the other hand, learning different programming languages and frameworks also gives you new perspectives for solving certain problems, so I don't see it as black and white.

To sum it up:
Always understand the underlying concept instead of superficial bells and whistles.

@janriemer Well said! This was my original message, but I added a bit of controversy for people to pay a bit more attention ;)

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!