Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28917

Re: are lambdas a way to bring functional programming to java?

From Wanja Gayk <brixomatic@yahoo.com>
Newsgroups comp.lang.java.programmer
Subject Re: are lambdas a way to bring functional programming to java?
Date 2014-07-02 22:55 +0200
Organization Netfront http://www.netfront.net/
Message-ID <MPG.2e1e8fd797b626c026@202.177.16.121> (permalink)
References (1 earlier) <53ae08d5$0$304$14726298@news.sunsite.dk> <53ae0af4$0$302$14726298@news.sunsite.dk> <MPG.2e18d6e192455b131e@202.177.16.121> <53b36e09$0$293$14726298@news.sunsite.dk> <ZrOdnS5GKZ-PEi7OnZ2dnUVZ8hudnZ2d@giganews.com>

Show all headers | View raw


In article <ZrOdnS5GKZ-PEi7OnZ2dnUVZ8hudnZ2d@giganews.com>, Leif Roar 
Moldskred (leif.roar@invalid.com) says...
> 
> Arne Vajhøj <arne@vajhoej.dk> wrote:
> > 
> > I look at it a bit differently: the introduction of lambda
> > makes the benefits of reusing close to zero and we only like
> > reuse when it actually has benefits, so I do not see it as
> > a problem.
> > 
> 
> Personally, I've reached the point where I often consciously _avoid_
> reusing code in some instances, both to avoid adding more dependencies
> to a project but also in order to keep the program logic "close"
> instead of spread throughout umpteen files and over multiple levels of
> abstraction.

I happened to work for a project where the architect urged us to copy 
and paste the code for every view, as he said: "if something breaks in 
one view, then it won't affect the others" and he had stability in mind, 
obviously. Wanted to keep everything seperated as much as possible.
I told him that was a wrong approach, but he wouldn't listen. He had to 
learn it the hard way: Whenever something failed in one view, we had to 
find the same patterns in all the other views and fix them too - and 
ocasionally we forgot one, which causes more havoc than necessary (the 
customer was not amused).

And of course as code evolved all of these views drifted apart, so 
finding and fixing these bugs was becoming ever more difficult.
It took some time to him to see that I was right and why I was right: 
The parts where I (ignoring him) made heavy reuse were better to 
maintain. Sure, a bug in a resused part affected every view, but that 
meant the bug also surfaced faster, so it could be fixed. And fixing it 
once instead of 30 times was reasonably faster as well. 

When he finally changed his mind and started embracing heavy code reuse, 
it was practically too late for comfort. Refactoring became 
unnecessarily hard and while I was there, we never arrived at a point 
that I thought was halfway where we wanted to be.

Of course I do tend to copy-paste-modify too, but only until I see a 
clear pattern emerge and I'm confident enough I won't not missing 
something important or lock myself in, when I start weeding out the 
duplications. You must not wait too long, or it'll be too late.

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

are lambdas a way to bring functional programming to java? gdotone@gmail.com - 2014-06-27 16:50 -0700
  Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-06-27 20:14 -0400
    Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-06-27 20:23 -0400
      Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-06-28 14:43 +0200
        Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-01 14:34 -0700
          Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-07-01 22:01 -0400
          Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-02 20:52 +0200
            Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-02 13:08 -0700
              Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-03 03:13 +0200
              Re: are lambdas a way to bring functional programming to java? Joerg Meier <joergmmeier@arcor.de> - 2014-07-06 14:42 +0200
        Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-07-01 22:27 -0400
          Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-07-01 22:32 -0400
            Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-01 19:58 -0700
            Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-02 22:55 +0200
              Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-02 15:32 -0700
                Re: are lambdas a way to bring functional programming to java? Gene Wirchenko <genew@telus.net> - 2014-07-03 09:45 -0700
          Re: are lambdas a way to bring functional programming to java? leif.roar@invalid.com (Leif Roar Moldskred) - 2014-07-01 23:48 -0500
            Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-02 22:55 +0200
              Re: are lambdas a way to bring functional programming to java? Gene Wirchenko <genew@telus.net> - 2014-07-03 09:49 -0700
                Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-03 10:25 -0700
                Re: are lambdas a way to bring functional programming to java? Gene Wirchenko <genew@telus.net> - 2014-07-04 11:03 -0700
          Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-02 21:23 +0200
      Re: are lambdas a way to bring functional programming to java? Roedy Green <see_website@mindprod.com.invalid> - 2014-06-30 09:08 -0700
        Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-07-01 21:56 -0400
  Re: are lambdas a way to bring functional programming to java? Joerg Meier <joergmmeier@arcor.de> - 2014-06-28 12:11 +0200
    Re: are lambdas a way to bring functional programming to java? Roedy Green <see_website@mindprod.com.invalid> - 2014-06-30 08:50 -0700
      Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-06-30 09:09 -0700
      Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-01 19:27 +0200
        Re: are lambdas a way to bring functional programming to java? Wanja Gayk <brixomatic@yahoo.com> - 2014-07-01 20:46 +0200
          Re: are lambdas a way to bring functional programming to java? Sebastian <news@seyweiler.dyndns.org> - 2014-07-01 21:52 +0200
            Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-01 14:11 -0700
              Re: are lambdas a way to bring functional programming to java? Jan Burse <janburse@fastmail.fm> - 2014-07-22 14:37 +0200
                Re: are lambdas a way to bring functional programming to java? markspace <markspace@nospam.nospam> - 2014-07-22 10:39 -0700
                Sidetrack on generics (WAS: Re: are lambdas a way to bring functional programming to java?) Daniele Futtorovic <da.futt.news@laposte.net> - 2014-07-22 20:48 +0200
                Re: Sidetrack on generics (WAS: Re: are lambdas a way to bring functional   programming to java?) Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2014-07-23 12:01 -0500
      Re: are lambdas a way to bring functional programming to java? Arne Vajhøj <arne@vajhoej.dk> - 2014-07-01 21:50 -0400
  Re: are lambdas a way to bring functional programming to java? Roedy Green <see_website@mindprod.com.invalid> - 2014-07-22 04:40 -0700
  Re: are lambdas a way to bring functional programming to java? Roedy Green <see_website@mindprod.com.invalid> - 2014-07-28 09:45 -0700

csiph-web