JADE 7 Refactoring

Forums for specific tips, techniques and example code
User avatar
Dr Danyo
Posts: 56
Joined: Fri Aug 21, 2009 8:59 am

JADE 7 Refactoring

Postby Dr Danyo » Sat Jan 26, 2013 6:50 am

So how are people finding the refactoring tools in JADE 7?
I find binding the refactor (rename / change) operation to a shortcut key especially useful.

- Dr Danyo

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: JADE 7 Refactoring

Postby JohnP » Mon Jan 28, 2013 8:42 am

Very useful! I have used mostly the rename function so far.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: JADE 7 Refactoring

Postby BeeJay » Mon Jan 28, 2013 9:06 am

I'm really enjoying being able to type the name of a new variable in-line in the code, and then use the Ctrl+F2 context menu to "automatically" create it as a new local variable without losing my current context in the code. Saves having to go back up to the vars section, add the new variable, and then reposition back to the place in the code where you actually wanted to use it. :)

Cheers,
BeeJay.

User avatar
Dr Danyo
Posts: 56
Joined: Fri Aug 21, 2009 8:59 am

Re: JADE 7 Refactoring

Postby Dr Danyo » Wed Jan 30, 2013 6:03 am

I agree, that is a very useful feature, it definitely allows you to flow more when coding, the same goes for promote to parameter or class property.
I typically remap the keys to something a little easier to reach than Ctrl+F2.

Would you find an "inline" refactor useful?

- Dr Danyo


I'm really enjoying being able to type the name of a new variable in-line in the code, and then use the Ctrl+F2 context menu to "automatically" create it as a new local variable without losing my current context in the code. Saves having to go back up to the vars section, add the new variable, and then reposition back to the place in the code where you actually wanted to use it. :)

Cheers,
BeeJay.

allistar
Posts: 156
Joined: Fri Aug 14, 2009 11:02 am
Location: Mount Maunganui, Tauranga

Re: JADE 7 Refactoring

Postby allistar » Wed Jan 30, 2013 8:28 am

I agree, that is a very useful feature, it definitely allows you to flow more when coding, the same goes for promote to parameter or class property.
I typically remap the keys to something a little easier to reach than Ctrl+F2.

Would you find an "inline" refactor useful?
More useful would be a language extension that allowed us to have actual "inline" methods as you do in C++. An additional JADE method call can be an expensive affair if put in a critical piece of code, a tight loop or deeply nested recursion. So we end us sacrificing maintainability, ease of reading and ease of refactoring in favour of performance. It would be nice to not have to do that. Inline methods would be one way to have the best of both worlds (with some caveats, of course).

User avatar
Dr Danyo
Posts: 56
Joined: Fri Aug 21, 2009 8:59 am

Re: JADE 7 Refactoring

Postby Dr Danyo » Thu Jan 31, 2013 9:28 am

I agree, that is a very useful feature, it definitely allows you to flow more when coding, the same goes for promote to parameter or class property.
I typically remap the keys to something a little easier to reach than Ctrl+F2.

Would you find an "inline" refactor useful?
More useful would be a language extension that allowed us to have actual "inline" methods as you do in C++. An additional JADE method call can be an expensive affair if put in a critical piece of code, a tight loop or deeply nested recursion. So we end us sacrificing maintainability, ease of reading and ease of refactoring in favour of performance. It would be nice to not have to do that. Inline methods would be one way to have the best of both worlds (with some caveats, of course).
Hi Allistar,

Interesting, to be honest its been quite some time since I've had that sort of problem (and even then being smart about db get objects seemed to dominate), these days I tend to focus more on maintainability and cost of code change etc. But I agree sometimes it can be a tricky balance. I'm also lucky enough to have some pretty serious hardware for the db and app servers. :D

User avatar
ghosttie
Posts: 181
Joined: Sat Aug 15, 2009 1:25 am
Location: Atlanta, GA, USA
Contact:

Re: JADE 7 Refactoring

Postby ghosttie » Wed Feb 13, 2013 5:29 am

It's SO good. I also mostly use rename but they're all awesome.
I have a catapult. Give me all the money or I will fling an enormous rock at your head.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: JADE 7 Refactoring

Postby BeeJay » Wed Feb 13, 2013 8:03 am

Only slightly related to refactoring, but I'm also really enjoying when you use F4 to find a class that is inherited from a superschema that you can use the "New Browser" button so that it opens that class in a new class browser window with a schema context of the schema in which the class is actually defined!!

Very useful when your current context is say your view schema and you want to open a model schema class, or some other "base schema" class.

Cheers,
BeeJay.

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: JADE 7 Refactoring

Postby murray » Wed Feb 13, 2013 1:09 pm

Only slightly related to refactoring, but I'm also really enjoying when you use F4 to find a class that is inherited from a superschema that you can use the "New Browser" button so that it opens that class in a new class browser window with a schema context of the schema in which the class is actually defined!!

Very useful when your current context is say your view schema and you want to open a model schema class, or some other "base schema" class.

Cheers,
BeeJay.
I'm still using Jade 6.3 and always use Shift-F11 to achieve the same result, as long as the selected token resolves to a class. Shift-F11 also works for methods and other entities.
How different is the F4 function from the Shift-F11?
Murray (N.Z.)

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: JADE 7 Refactoring

Postby BeeJay » Wed Feb 13, 2013 1:38 pm

I always use Shift+F11 if I'm in code that directly references a class. However, sometimes you want to look at a class that you don't have referenced in the current method or you don't want to lose context for the current CHB, so being able to use F4, type a partial class name and then open a new browser window against the correct schema is great!!

Now, if only Shift+F11 on a global constant would open the constants browser in the correct schema context. ;)

Cheers,
BeeJay.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 7 guests

cron