News for hackers. Stuff that matters.
Re:Too scared to write a line of code by laumars on Friday May 24, 2013 @06:32PM (#5765563)
I'm by no means a pure functional programmer, but I've found some of the mantra from that paradigm helps when building the early blocks of a program as it allows you to break down your application into core problems which can be tackled individually. Plus it allows your application to scale easier and makes it easier to rip out and replace code as you start to add complexity.

But of course, before starting any major project, the first thing any developer should do is map out at least a basic mental design of the program - even if that map isn't written in pseudo-code or in a form of a flow chart.

Re:Too scared to write a line of code by chousuke on Friday May 24, 2013 @07:41PM (#5765808)
The reason pure functional programming is good for "ripping out and replacing" code is because your code units necessarily have fewer interdependencies.

a pure functional language is really good for writing dumb code that "just works" in the sense that it does what you need it to do even if it isn't very pretty or fast, while at the same time keeping it reasonably maintainable because the code will not be rife with accidental complexity and assumptions about global state.

Re:Too scared to write a line of code by laumars on Friday May 24, 2013 @08:07PM (#5765876)
I know. That's why I raised the topic of functional programming to begin with :p
Re:Too scared to write a line of code by dustingetz on Friday May 24, 2013 @06:47PM (#5765633)
in other words, FP evolved to solve hard problems. You don't need to understand monads to model a cash register. You probably do need monads if you want to write a bug free distributed asynchronous system.
Re:Too scared to write a line of code by pseut on Friday May 24, 2013 @06:55PM (#5765671)
I don't know that you need monads, but a lot of recent languages seem designed to guide programmers to certain types of good design. You don't need the language to emulate the design ideas.
Re:Too scared to write a line of code by prollyignored on Friday May 24, 2013 @07:11PM (#5765726)
> bug free distributed asynchronous system

Have to add bugs to haskell code ?

gosh it seems impossible.

Re:Too scared to write a line of code by ww520 on Friday May 24, 2013 @11:08PM (#5766216)
Be careful going overboard with pure functional programming. It could become one of the immobilizing factors the blog was talking about. Is the code pure FP? Can I get rid of the states? Am I doing correct FP? Should I write generic function for more abstraction? Am I doing DRY enough?
Re:Too scared to write a line of code by laumars on Saturday May 25, 2013 @05:11AM (#5766760)
Indeed. It's about knowing what tools are best to use when. My comment was more about how some (albeit not all) of the concepts of functional programming can help tackle the first few stages of larger projects and can often help to lower the chances of spaghetti code.