News for hackers. Stuff that matters.
Re:Is there a software-engineering methodology for functiona... by lispm on Sunday February 06, 2011 @08:05AM (#2185534)
From the UML standard:

  The Unified Modeling Language is a visual language
  for specifying, constructing, and documenting the
  artifacts of systems. It is a general-purpose modeling
  language that can be used with all major object and
  component methods, and that can be applied to all
  application domains (e.g., health, finance, telecom,
  aerospace) and implementation platforms (e.g., J2EE, .NET).
object and component methods. The UML comes from modelling for object-oriented software.

Using UML with Functional Programming is like using a hammer to drive screws into walls.

Re:Is there a software-engineering methodology for functiona... by wglb on Sunday February 06, 2011 @10:44AM (#2185751)
I agree with the general direction that you are going, but consider at least one exception: http://en.wikipedia.org/wiki/Sequence_diagram. I find these sequence diagrams useful in whatever kind of systems that I am working with.

I feel that the disconnect is the presumption (which at one point in my career I was fully on board with) that Everything Is An Object.

Additionally, I have grown resistant to "methodology" more than anything. In my harsher moments, I argue that methodologies are insisted on by PHB who don't really understand programming and want something to insulate them from the reality of software development.

Re:Is there a software-engineering methodology for functiona... by nightski on Sunday February 06, 2011 @03:14PM (#2186335)
Sequence is only really useful when dealing with computations with side effects. So I have found the value of these diagrams much less as I try to keep the majority of the system referentially transparent.

The other huge disadvantage to sequence diagrams is that they are very poor at describing concurrency, and only work real well for simple single threaded systems.

Re:Is there a software-engineering methodology for functiona... by wglb on Sunday February 06, 2011 @05:26PM (#2186638)
Sequence is only really useful when dealing with computations with side effects

I disagree. If, for example, you are dealing with cooperating processes, then sequence diagrams are quite useful.

Re:Is there a software-engineering methodology for functiona... by DanielBMarkham on Sunday February 06, 2011 @08:49AM (#2185585)
Draw a box. Write something in the box. Draw an arrow.

There. You're using UML.

Yes, the guys who spec out UML -- and many of the practitioners -- think of it as a do-all, end-all language of goodness and OOP.

But read your quote again. It's a visual language. A purpose of a language is to communicate. Who are you communicating with? Some folks think you're communicating with the computer itself, and their UML looks that way. But the language communicates to other people. You can be as loose or as detailed as you like, as long as you are communicating. The language spec simply provides you a range of depth in formality to use depending on your circumstances.

I teach this, I use this, and I've coded both OOP and FP for years. I think I know what the hell I'm talking about. Yes, according to the authors it can be used with all major OO systems, but that's a far cry from meaning the two are inseparable. It can also be used with railroad design, or industrial lighting systems.

I get really tired of dogmatism in programming. The idea that you can quote an authority as somebody who somehow controls the everyday practical uses of a thing. It's almost like we think of standards bodies as the programmers and people as the little machines that run the standards. UML is a tool. Pick it up. Use it. Understand what the tool is used for -- in a practical sense, not in a technical one. The definition of the tool is in the hands of the wielder, not some standards group. They just write specs. No one tool can do everything, and the directions that came with the tool were probably written by folks who see the entire world in terms of their tool.

If you're not designing your functional structures in some fashion -- including just in your head -- then I don't want to be maintaining your code. Whether or not you draw pretty pictures to do that or not is only important if you need to communicate that design to somebody else or sort it out in your head. And that's not even getting into all the other uses of UML -- component modeling, network diagramming, etc -- that have nothing at all to do with programming. If you think of UML artifacts as directly relating to OOP, go talk to a business domain modeler who uses UML, or a network analyst, or a BA.

It's a modeling language, not a coding language. You use it when you need to model. Modeling can help you in all kinds of situations. Or not. Draw a box. The rest of the discussion is around whether you need to draw the box or not, and it's so dependent on particular situations it's not germane to this conversation. Simple as that.

Re:Is there a software-engineering methodology for functiona... by lispm on Sunday February 06, 2011 @10:13AM (#2185706)
If you draw a box with an arrow, then you use a drawing program and not UML.

There is a reason, while in addition to OOP (object-oriented Programming) we are talking about OOA (object-oriented analysis) and OOD (object-oriented design). It's wrong to believe that OO is only for programming - it goes right into modelling and design. UML is originally created to support OO modelling.

Re:Is there a software-engineering methodology for functiona... by pnathan on Sunday February 06, 2011 @12:29PM (#2185986)
Um, there are actually quite a few boxes and arrow modelling specifications besides UML.
Re:Is there a software-engineering methodology for functiona... by jswiente on Sunday February 06, 2011 @08:57AM (#2185593)
It depends on the level of abstraction and the view of the system that should be described. A model of the structure of a system with components, subcomponents and their relationship with each other does not include any information about the actual implementation of the components and the programming paradigm being used. Also, a data model of the business domain is not concerned with any technical detail such as the components or subcomponents the system. You can model all these artifacts using UML.

Of course, using an UML class diagram for a detailed design describing the implementation of a component does not make sense when using functional programming.

Re:Is there a software-engineering methodology for functiona... by route66 on Sunday February 06, 2011 @10:12AM (#2185704)
While the standard is obviously written with OOP in mind UML is just as well a usable tool for desribing e.g. Erlang actors (sequence diagram) or the functionality buried in lisp packages. It helps drawing boundaries and responsibilities which might be just as important in FP.

The bulk of code generation tools and diagram "helpers" might be pointless in FP, but when you sketch on a napkin boxes and arrows just do their work in a way that even OO people can understand what you are talking about.

Re:Is there a software-engineering methodology for functiona... by mdaniel on Sunday February 06, 2011 @09:04AM (#2185600)
Not necessarily: lisp has CLOS and components (if I am correctly understanding both your and their definition).

I do agree with the premise that FP feels a lot more agile to me, and thus benefits less from a big design-up-front effort.

Re:Is there a software-engineering methodology for functiona... by lispm on Sunday February 06, 2011 @10:12AM (#2185702)
Lisp with CLOS is in no way Functional Programming. CLOS is the Common Lisp Object System. But even that is already a poor fit with UML, since CLOS is sufficiently different from the message-passing OO paradigm.