Page 1 of 2

JADE 7 Refactoring

Posted: Sat Jan 26, 2013 6:50 am
by Dr Danyo
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

Re: JADE 7 Refactoring

Posted: Mon Jan 28, 2013 8:42 am
by JohnP
Very useful! I have used mostly the rename function so far.

Re: JADE 7 Refactoring

Posted: Mon Jan 28, 2013 9:06 am
by BeeJay
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.

Re: JADE 7 Refactoring

Posted: Wed Jan 30, 2013 6:03 am
by Dr Danyo
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.

Re: JADE 7 Refactoring

Posted: Wed Jan 30, 2013 8:28 am
by allistar
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).

Re: JADE 7 Refactoring

Posted: Thu Jan 31, 2013 9:28 am
by Dr Danyo
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

Re: JADE 7 Refactoring

Posted: Wed Feb 13, 2013 5:29 am
by ghosttie
It's SO good. I also mostly use rename but they're all awesome.

Re: JADE 7 Refactoring

Posted: Wed Feb 13, 2013 8:03 am
by BeeJay
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.

Re: JADE 7 Refactoring

Posted: Wed Feb 13, 2013 1:09 pm
by murray
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?

Re: JADE 7 Refactoring

Posted: Wed Feb 13, 2013 1:38 pm
by BeeJay
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.