Help in refactoring code

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Help in refactoring code

Post by kaveh1000 » Tue Apr 23, 2019 8:27 am

Hi all

I have a complex set of handlers calling each other. I want to refactor the code and make it simpler for me and others. I am having a hard time getting a picture of what is going on as I did not write in the most efficient way. Is there any way of visualising, say with a diagram, which handler is handling which, to help me unravel the structure?

Regards
Kaveh
Kaveh

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Help in refactoring code

Post by richmond62 » Tue Apr 23, 2019 9:02 am

Why not be old-fashioned and draw a big flowchart on a large piece of paper:
has helped me several times.

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Help in refactoring code

Post by kaveh1000 » Tue Apr 23, 2019 9:54 am

Primarily because I am lazy!!!

Yes, probably will do that. But I was wondering if there might be a script to reverse engineer the code I have and draw some kind of chart for me! That should be possible I would have thought.
Kaveh

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Help in refactoring code

Post by Thierry » Tue Apr 23, 2019 10:13 am

Hi,

Check for Mark Wieder last astonishing work !

He made a refactoring library not too long ago.

HTH,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 508
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Help in refactoring code

Post by kaveh1000 » Tue Apr 23, 2019 10:20 am

Hi Thierry

I am indeed using Mark's generous gift to the community to rename clean up, move handlers, etc.

But it is not doing what I am asking for. Perhaps Mark has a suggestion?

Regards
Kaveh
Kaveh

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: Help in refactoring code

Post by Thierry » Tue Apr 23, 2019 10:29 am

kaveh1000 wrote: I am indeed using Mark's generous gift to the community to rename clean up, move handlers, etc.
But it is not doing what I am asking for. Perhaps Mark has a suggestion?
Therefore, I kindly suggest to get in touch with Mark
who, if my memory is fine, is more active on the user's list.

and show him part of your code;
always more chance to have an answer this way :roll:

Best,

Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”