[TriLUG] Slightly OT: Question about Reuse of Code in Web Projects

Tim Jowers via TriLUG trilug at trilug.org
Sat Jul 11 18:28:41 EDT 2015


Hi Scott,

IME code is copied. Huge jsp projects (tiles, struts, spring). Large mobile
apps (ios,Android). The standard in several hugecos. Grade of D- in my
book.

Can you setup your base code as lib? Include that. Easy in Android but
maybe messy in  web. I'm not a fan of post processing scripts/junks due to
non maintainability and even next to non debuggability.

I moved to heavy js due to this mess and others with webjunkframeworks on
server side. I jquery load htmal snippets. Go against webservices. Worked
GREAT for medium large web+mobile web app with heavy complex jquery data
tables, client side caching etc. So I can code on Linux and deploy to iis.
Huge productivity improvement. My main use of Linux is as coding platform
and moving project work to Linux regularly doubles my output.

Also, when faced with exact same sw arch challenge I try to redesign to
reuse instead of repeat. Depends on how good underlaying framework is. Most
modern designs I see all but kill good oo design. Often a total redesign
would be needed. Working on one now where 200+ loc needed to do what we did
on a very similar project with 5 loc years ago (android server requests
responses). The other designer was former smalltalk so our design was
beautiful, simple, small and mostly same code of server and client. But no
appetite to rewrite and retest this hog.

Seen some times you  see "functional reuse" where code paths support
various switches. C like but found lots of places. In your example it would
probably lean toward spaghetti but seen it recently in large Android app
done by very successful mobile consultancy. Typical where they used message
passing instead of sequential code. Lots to say there.

Might as well warn against injection and config file frameworks. By design
they suck for minimal code. Experience reveals. Not to say can't be done
but to say never seen done, if you catch my drift. Big piles of copy paste
change instead of design finesse. I know, voice of experience drowned in
the horde of neophytes; but, as an engineer had to say it nonetheless.

You could setup soft link to "framework" code if on same server. Could make
your build/deploy script pull from one common repo. Etc, obviously.

Love to know what you decide,
Sorry so long but very interesting topic,
Tim

On Saturday, July 11, 2015, Igor Partola via TriLUG <trilug at trilug.org>
wrote:

> There are a few approaches I have seen work well. First is to copy the
> files manually and then delete them.
>
> Another is to use a built-in project generator. For exams Django comes
> with one.
>
> You can also look for sample or starter projects on GitHub and start with
> those. Or if they are not available for your frameworks of choice, add them
> yourself.
>
> Lastly, you could always create your own project generator. If you create
> enough of these, this will pay off in the long run.
>
> Igor
> --
> This message was sent to: timjowers <timjowers at gmail.com <javascript:;>>
> To unsubscribe, send a blank message to trilug-leave at trilug.org
> <javascript:;> from that address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  :
> http://www.trilug.org/mailman/options/trilug/timjowers%40gmail.com
> Welcome to TriLUG: http://trilug.org/welcome


More information about the TriLUG mailing list