4 ms·
> Using cut-n-paste code from someone else's program to deal with I/O and Monads > Failure to implement a linked list, or write code that inserts/deletes nodes
by jkot 12y ago
> Using cut-n-paste code from someone else's program to deal with I/O and Monads
> Failure to implement a linked list, or write code that inserts/deletes nodes from linked list or tree without losing data
> Difficulty seeing through recursion
I would argue that using monads, implementing your own linked list or using recursion is sign of bad programming... But I am just Java cowboy, so thanks for the enlightenment!
- woah 12y agoHave you ever used a filesystem?
- cbd1984 12y ago> implementing your own linked list or using recursion I believe I can salvage this piece of the comment, and make it into an intelligent thing to say. Implementing your own linked lists? Not good unless your language is stone-knives-and-bear-skins land. You need to know what libraries are out there and available to you, and if CS undergrad stuff is unknown to the libraries in your language, pick a different one if you possibly can. Recursion is an important skill, but implementing your own recursive functions is low-level. It's error-prone and it's boring in precisely the ways that cause errors. Implementing your own map function is worse than implementing your own linked lists; it's more like implementing your own while loops out of labels and goto statements. It's an invitation to have bugs in your program's flow control, which is the worst possible place for them to be. Sometimes you need to write your own recursive function, because none of the basic recursive patterns your libraries give you can fit. Sometimes you need to implement your own foundational data structures, too. Both of these should be done with skepticism, primarily of your own code, but also of the very idea that you'd actually need to do it in the first place.
- olavk 12y agoIn Java you also need recursion, even if it is not ubiquitous as in functional languages. Say you want to traverse a tree structure - a directory hierarchy for example - you need recursion.
- Retra 12y ago> I would argue that using monads [...] is sign of bad programming Monads are a fairly common mathematical abstraction. You might as well say "Using addition is a sign of bad programming." You use monads all the time. You probably just don't call them that.