0
0

[–] ufgood ago 

Respectfully, I don't think you are ready to give this kind of advice.

0
0

[–] lmkevin [S] ago 

I am in college right now. So admittedly, yes I'm under experienced. HOWEVER I doubt you have witnessed the incredible retardness colleges are teaching. They teach you to

  • build you own Linked List instead of how to use ArrayList and vectors
  • Barely do they even talk about how to model or design a project. They touch UML and nothing else.
  • Recursive palindrome, recursive Fibonacci, recursive x, recursive y for the excuse of "logical practice". Why the fuck will I be applying recursiveness in my day to day work life?

Things they don't teach you:

  • How to use git... let alone what a cvs is.
  • How to start, maintain, and close a project
  • Software Engineering, they teach you how to code like a slave. Models and designs are not important to engineering I guess.

Keep in mind, this is my 4 year college experience. I'm sure if I were going to MIT or something I wouldn't be saying this.

0
0

[–] ufgood ago 

Well, I have been programming professionally since before I graduated high school, and I have a computer science degree from an "elite" college. And I can tell you that I use recursion on a daily basis. While the academic Fibbonacci is indeed often very dumb -- and typically, not the way Fib is really written in pure functional languages, by the way -- learning recursion is quite valuable.

It's good that you are questioning and seeking past what you are being taught. But sometimes it is also hard to recognize the value of concepts at an early stage.

My college program included almost no "practical" stuff, only computer science and math. I think that's a pretty good way to go, but it's not for everyone. You do seem to be able to learn the more practical matters on your own... right?

0
1

[–] 7758759? 0 points 1 point (+1|-0) ago 

Linked lists and recursion is like the main thing I use in Scheme and my favorite way of programming, when it suits the problem ofcourse.

UML and OOP design is so stupid, it just makes me angry thinking about it.

0
1

[–] 7750979? 0 points 1 point (+1|-0) ago 

At anytime when you're programming and thinking about using recursion, there is a 90% chance you're doing something wrong.

Spot on! I have created millions of lines of code and rarely needed recursion.

0
0

[–] cruelecole ago 

At risk of Excel being rejected as programming: hiding rows/columns when it's always better to group (select row/col and then alt, d, g, g) or save a new version and delete (alt,e, d) the rows/columns; respectively, the rows/cols are either meant to be seen again, or they are not - the middle ground of hiding creates confusion in the former case and fails to achieve the goal in the latter.

0
1

[–] TeranNotTerran 0 points 1 point (+1|-0) ago 

Kernels are loaded with linked lists. Or especially, doubly linked lists. That said, I've never had to use one.

Not familiar with UML. Looks strange and there's diagrams, so I probably won't be able to understand it.

Recursion... I think it's necessary sometimes, but it really confuses me and I feel iffy about it. I like it more in assembly where you're already jumping anyway, and most of it is pretty recursive. It's more natural. But in higher level languages like C or Python, it's pretty darn strange. That said, I don't know enough to say for sure if it's good or bad. As it stands now, I certainly don't prefer it.

Actually, hmm. Recursive functions are probably a lot more complicated to understand. You have to think of each pass through the code, with different state, and predict each case.

0
1

[–] lmkevin [S] 0 points 1 point (+1|-0) ago 

Kernels have linked lists? I certainly was not aware of this... where do they use them?

0
0

[–] TeranNotTerran ago 

Process tables, or whatever you want to call them. Although it's a doubly linked list, child to parent and parent to child(ren)?

At least on FreeBSD. This may be the older version of the book, but the newer one is quite the read. I haven't read the older copy.

https://books.google.com/books?id=KfCuBAAAQBAJ&pg=PA803&lpg=PA803&dq=freebsd+process+table+linked+list&source=bl&ots=u9z0ovNf07&sig=6C1XE-7GXkvK6ZCq4RPwnpRj__o&hl=en&sa=X&ved=0ahUKEwj1guSYgNvRAhXn24MKHdvEDXUQ6AEIGjAA#v=onepage&q=freebsd%20process%20table%20linked%20list&f=false

Looks like they would use queue() as a helper, though: https://forums.freebsd.org/threads/38827/

0
2

[–] Antikaon 0 points 2 points (+2|-0) ago  (edited ago)

Check these out:

Kernel Newbies discussion of the Linux kernel's linked list API: https://kernelnewbies.org/FAQ/LinkedLists

From the Linux kernel 4.9 src (Linux/include/linux/list.h) http://lxr.free-electrons.com/source/include/linux/list.h

Linked lists are used in various places in the kernel and in device drivers. They're fast and efficient.

0
7

[–] Phen 0 points 7 points (+7|-0) ago 

Linked lists have O(1) random insertion (if you're already at your link node), array lists do not. Array-based lists have O(1) random access, linked lists do not. The correct choice depends on the workload.

Nearly all lists I work with on a day-to-day basis are just collections to be iterated over for some sort of processing like validation or whatever. Algorithmically, either would be fine. Array lists have a lower memory overhead, so it's reasonable that they should be chosen for most cases, especially if you have a good idea of the buffer size.

But they certainly should not be chosen for ALL workloads.

For example, the application I write at work maintains a navigation stack. Depending on user action, we may need to remove the head or tail of the stack, pop or push navigation states. If the user navigates to a screen, we push the screen on the top of the stack and pop the tail so that we don't keep too much history. As the user goes back and forward, the list node moves to previous or next. Etc. How is that stack implemented? A linked list, of course! Anything else would be silly. It could have be implemented as an array list, after all the number of elements is so small that there would be no measurable performance impact. But we'd just have to write an interface overtop of the array-based list that looks the same as what the linked list already provides, so why bother?

HOWEVER, I think all of that misses the point of education entirely. Even if the linked list isn't used all over the place, you still need to understand the algorithms! That's the point of education. A college education in programming shouldn't just be bunch trade school style instructional courses where you're told what to do and how to do it. You have to understand the abstract data structures, why they're used, why they behave as they do, why you should use them, why you should avoid them.

If you don't, you'll risk winding up like my coworker who uses linear lookups for everything even when hashtables are the obvious solution. (Curse you LINQ!)

0
4

[–] ketezer 0 points 4 points (+4|-0) ago 

I use recursion to build/search trees and it works well. I've never seen UML by hand but the idea of it sounds awful.

0
0

[–] freed00m ago 

I hate Linked lists, that I agree with you on.

UML by hand is also waste of time in my eyes.

But what about finding a node in a tree? I would use recursion, for high quality demand we have MISRA and stuff like MISRA.

1
0

[–] lmkevin [S] 1 point 0 points (+1|-1) ago 

Yeah thinking on it, I knew that recursion does have actual use (hense the 90%), you can't get away from recursion when dealing with trees.

0
0

[–] freed00m ago 

I don't think you "can't" but I just do it with recursion. The other memory ease method usually linked lists :D and that I hate more. All MISRA sets should be satisfied with linked lists. There you go :D