NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Code Templates...Smart code templates. plus more.


Joined: 12 Nov 2006
Posts: 4
Reply with quote
Hello PhpED team,

Here's something that I would not just like to see in PhpED, I would love it to death!...and I been waiting for this a lot, every new version I check to see if it has been done so I can finally ditch ZendStudio and possibly jEdit...but unfurtunately every new version I'm disappointed to find out it hasn't been done. and back to ZS Sad

Ok I installed PhpED, it has code templates but they are pretty much useless right now... at least for me. Let me explain how I would like them to be...

If you ever used jEdit you'll definetely miss their great SuperAbbrevs plugin. and If you have seen how TextMate works then you definetely knows this feature really rocks. This is exactly what all editors are missing and I can't understand why developers simple don't see how much this enhances productivity by ALOT. As you may already know code templates are great but just able to define the cursor position don't do as much as able to define user variables in them and interact with them. So what is exaclty do I want ?...

Smart Code Templates... Textmate snippets.
What is this exactly?...
Able to define code templates with variables, such variables define tab stops of templates. What do I mean?...examples.
Note: This examples are based of SuperAbbrev plugin of jEdit, which has some limitations I explain below.

let's do a simple one...

Code:
Name: tag
code: <${1:TAG}>$end</$1>


when I type tag and press tab, I get this...
Code:
<TAG(this is highlight)></TAG(this is same $1 tag so it just references the value of what I type in other...)>


when I start typing I get this...let's say I type div...
Code:
<div></div>


If I press tab then it goes to next variable in this case there's only one var defined so it goes to $end variable which defines the position of cursor... pretty much "|" in PhpED right now.
Ok I type "Hello world", but now I don't want a div tag I might do just a P tag so I press shift+tab it goes to previous variable, type p and now I got this...
Code:
<p>Hello world</p>


NOTE: ok this is great but the plugin and even zend editor lacks some "smart" actions in it. What I mean?, well If I type p id="blah" guess what happens to closing tab ?... the same, not cool... Textmate on the other is more smart and exactly what I want in PhpED.

Ok that's great, but let's do a more advanced one...let's do javascript...

Code:
Name:fn
code: function(){ $end }
Name:st
code: setTimeout($end,${1:time});


I type... st get
Code:
setTimeout(,time[highlighted ready to type]);


ok I set time... 3000...press tab It goes to next variable in this case $2... In there I type fn press tab... now I have this...
Code:
setTimeout(function(){ [cursor here] },3000);


and done in like 3seconds I did what it could take u 10...
let's do a PHP example this time a lil more advanced template...with selections....
Code:
name: fnc
code:
function ${1:name}($2){
$str = <#=selection#>$end;
echo $str;
}


let's say I got this text highlighted... [Hello World] (without brackets)
I invoke templates command... this time is not tab u can have it assigned to shorcut I have it at ctrl+tab
and type fnc, press enter... I get...

Code:
function name(highlighted ready to type)($2){
$str = Hello World;
echo $str;
}
[/code]
type my function name, press tab I goto $2 var... there I type any $str...press tab again and I go to $end variable... Result?

Code:
function helloWorld($str){
$str = Hello World;[cursor here]
echo $str;
}

and done... in like 10secs I what it can take u more than 15...

see how much time is saved, and how fast you complete your projects?... I don't get why developers can't see that... I do. imagine having it for all your most used functions, methods, properties...defenitely a must-have feature for me. I would love to see this in PhpED.

jEdit and Zend both have it but they are Java based and both have limitations, jEdit no great support for PHP, Zend no great support for CSS,XHTML,JS,XML...

Also, superabbrev has one limitation right now. It doesnt let you use code tempaltes within code templates... so that pretty much limits you... please make sure you can use code templates within code templates, thanks!
Another thing, have it like textmate, able to trigger the template by tag or shortcut, this is a nice thing, both jEdit and Zend only offers tab triggers.

Another feature, I don't know if PhpED does this already, column select and multi-select?...
Column selection, you do a zero width column selection and type something and it types that in all columns...
Multi-select is just that allows you to have more than one selection...without this you select, paste,select paste, etc...

With these features PhpED would be closest thing to Textmate for windows! I'm sure it will draw more customers too...I know people who will even pay hundreds to have something like textmate in windows... I know I would. People just love these features... they know it enhances their productivity and they are VERY useful. There's a reason, why Textmate is widely popular. Also why us windows users envy mac users for textmate no kidding lol..., these features are the part of that I think (at least for me). Simple because no editor in windows have it exept for those Java based which not many people like to use I think we all know why...I have a good fast computer and still dont like Java editors... but they are the only ones with the best features. At least for now.

PhpED has great features but I miss this great feature, alot... I multi task many projects at once and speed is a key factor, smart code templates give me that speed boost, saving me from typing tons of repeated keystrokes.

Really, if anyone knows a great editor in windows with PHP supports like PhpED and Zend offers but also has great support for other 4 main web development languages, HTML, JS, CSS and XML and with code templates like I explained above and column select + multi select, syntax highlighting... inform me please! It's my dream editor and I'm still waiting for that "Perfect" editor Smile

I'm sure one day I will have that "Perfect" editor, I been dreaming about, might be PhpED in future Smile, maybe jEdit if one day their php plugin is much better and superabbrev is fixed... or Zend if they put more support for other 4 languages I mentioned above and enhance their templates... or maybe another one who's being developed right now and it looks promising...

Thank you very much for your time in reading this, appreciated Smile, even if the feature doesn't make it to PhpED never.

P.S.: Some demos about these features.
(superabbrev plugin)
(code templates, they call it snippets)
(code templates, they call it snippets)
(code templates, they call it snippets)
(column selection I'm talking about)

[Edit] After thinking a little bit about this feature I think it should be called "Interactive Snippets" or "Dynamic Snippets" that way it will draw more attention for possible customers... Of course if you guys do add this feature it would be silly not to make a new page to highlight this great feature and a demo too, one people see this they will want to try it, once they do it they will get addicted to product . Razz
View user's profileFind all posts by n1caSend private message


Joined: 01 Mar 2006
Posts: 42
Location: Poland
Reply with quote
First word I thought about when watching those demos was WOW ! Those are great features and boost coding a lot - for sure! I'd love to see them in PhpEd.
View user's profileFind all posts by ertiusSend private message


Joined: 12 Nov 2006
Posts: 4
Reply with quote
ertius wrote:
First word I thought about when watching those demos was WOW ! Those are great features and boost coding a lot - for sure! I'd love to see them in PhpEd.

Yes and when you use them you WILL get addicted lol... Razz
I have already, main reason I'm using jEdit and Zend...
50% or more speed improvement guaranteed...depending how you type.
View user's profileFind all posts by n1caSend private message
PHPEd with ZS code completion would be DOUBLE GREAT!


Joined: 10 Dec 2006
Posts: 4
Reply with quote
I just purchased a PhpED license during the recent holiday sale to do two things:

* Express my support for NuSphere and recognize their good efforts to date, and

* To express my disgust with Zend for their Bleed You Dry policy of HIGH PRICED point upgrades!

With the announcement of Zend Studio 5.5 I thought, "Great, maybe they'll polish off some of the rough edges and make it even more useful!" WRONG. New features are meager. If you want to mix Java in with PHP, maybe it'd be worth it. But $249 bucks for what amounts to a non-essential point upgrade!? I want off the Zend train!

If you stick with your current Zend Studio version, that's it. You will never see another bug fix or feature addition until you shell out massive bucks for an upgrade to a program you already bought (a couple times over if you've been with them for a while).

So, what is it that drove me to get Zend Studio rather than PhpED in the first place. Both PhpED and Zend Studio have lots of "bells and whistles" that are nice and occassionally useful. But when it comes down to it, it is the productivity of the editor that counts most for daily use. And productivity in this case is a relatively simple measure of keystrokes and "built-in editor smarts." The more niddling details of syntax and basic code structures that the editor helps you with, the better.

I won't go into details about all the small but wonderful code completion features of Zend Studio that have me hooked. If you do a lot of PHP programming, you probably have personal experience using Zend Studio. If you used it a while back, grab a trial copy of the 5.5 release and check it out. (Check it out to see what PhpED should have as features in its editor. Think twice, however, about getting on the Zend train that will drain your wallet over time.)

PhpED code templates are a WEAK imitation of Zend Studio code completion features. The single biggest WINNING new feature for a future PhpED upgrade would be to match (then surpass) Zend Studio code completion. The PhpED developers should put a junior member of their team on the task of dissecting the Zend Studio code completion features and then create a requirements list that sets the bar for what code completion should be in PhpED. Take a couple realistic scripts and COUNT THE KEYSTROKES to duplicate the script in PhpED and Zend Studio. And ask the test coders if they felt the editor made their work easier or harder.

There are SO MANY features where PhpED shines in comparison to Zend Studio. With really good code completion PhpED would set itself apart as the most productive and full-featured PHP IDE on the market.

--Sohodojo Jim--
View user's profileFind all posts by Sohodojo_JimSend private message


Joined: 12 Nov 2006
Posts: 4
Reply with quote
I agree with you Sohodojo. Unfortunately no replies from phped staff on this topic's idea. But I am hoping is there for 5.0 Smile
View user's profileFind all posts by n1caSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
Perhaps we should be asking for the real deal: a Mac version of PhpED, with external editor support so that we could use TextMate or BBEdit for the editor Smile.

If only....
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Veteran

Joined: 24 Jan 2006
Posts: 311
Reply with quote
We do read it ofcourse and are actively soliciting the input. One of the users even promised to give us flash movies for the illustration. We are very gratefull and will of course implement code snippets. As always, I will be reluctant to give the commitment to a version or to the exact timeline. The reasons are simple: we can get something even bigger to come in a moment. For example, we delivered PhpDock, Nu-Coder and PhpExpress in the past 3 months. We are commited to delivery of code folding in 5.0. Code snippets have been included in the Product Management plan - I can tell that much. Is it in 5.0 - I honestly can't tell at the moment, but since the feature is in PM plan, I know it is short term. Short term in NuSphere really means short Smile
View user's profileFind all posts by yfaktorSend private message


Joined: 12 Nov 2006
Posts: 4
Reply with quote
yfaktor wrote:
We do read it ofcourse and are actively soliciting the input. One of the users even promised to give us flash movies for the illustration. We are very gratefull and will of course implement code snippets. As always, I will be reluctant to give the commitment to a version or to the exact timeline. The reasons are simple: we can get something even bigger to come in a moment. For example, we delivered PhpDock, Nu-Coder and PhpExpress in the past 3 months. We are commited to delivery of code folding in 5.0. Code snippets have been included in the Product Management plan - I can tell that much. Is it in 5.0 - I honestly can't tell at the moment, but since the feature is in PM plan, I know it is short term. Short term in NuSphere really means short Smile


Really glad to hear that you got me anxious now Very Happy
Thanks for the reply.
View user's profileFind all posts by n1caSend private message
Code Templates...Smart code templates. plus more.
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic