Word Wrap and indented lines |
|
|
||||||||||||
|
Re: Word Wrap annoyance |
|
My previous editor was TextPad (textpad.com) which also had that feature. I switched to PHPED a few months ago and love it, but I REALLY MISS that feature. I can't stand how word-wrapped lines wrap all the way to the left, ignoring that line's initial indentation. It makes viewing the code so much easier when wrapping indented code. Hopefully this is something the devs can add in the near future. |
||||||||||||||
|
|
Hi, thanks for your replies guys.
Maybe I wasn't clear, I do know about the wordwrap but it is just annoying that the wrapped lines start at the very far left. I too hope this is something that will be added at a later date. John |
||||||||||||
|
|
Having code in lines that are that long that they need to be wrapped is considered bad programming style. PHP will still execute the code fine when you spread it over multiple lines. For example this:
works fine. Typically, make sure lines do not get longer than 80 characters. I am not that strict, but take the 80 chars as a guide. I won't break my neck over forcing an 83 character line into two lines. Just as a note, the white spacing that I have in my code doesn't show in the above example. I make it so that the " line up with the " of the first line. AFAIK the 80 chars/line come from the maximum characters per line viewable in terminals and printable on printers using flat ASCII. |
||||||||||||||
|
Site Admin
|
btw:
is the same as
and is the same as
|
||||||||||||||||||
_________________ The PHP IDE team |
|
Agreed, I should have picked an example where variables and arrays are used so that the proper string concatenation makes more sense. The last example is probably the best as it does not require the PHP interpreter and thus is about 0.2754 microseconds faster, which doesn't sound much, but can add up. That's what we got the profiler for.
|
||||||||||||
|
Veteran
|
In general, that's true. But as with most other programming rules, this one isn't absolute. For one thing, there are times when having a line break can break the function of the text; this is pretty uncommon in PHP, but it comes up more often in other files that PhpED can edit, such as HTML. And even when it can be done, it's bad practice to edit existing code for such a silly reason, since there's a good chance that a small mistake in the edits will go unnoticed. Also, there are rare times when one visual line is much easier to follow, even if it means scrolling. Also, the old rule of thumb about 70-80 characters is just silly in this day and age. No longer are we all programming on similarly sized text-only displays - now we're programming on screens of all different sizes and resolutions, using fonts of all different sizes inside of windows of all different sizes. I've seen programmers who can only get about 30 characters across at once, and I've seen some who can get a few hundred. Most programmers I work with nowadays who don't have some sort of visual disability prefer to work at right around 140, which is easily done on most modern screens (at least those that you'll find programmers typically using). Add in the fact that we may want to resize the editing window for whatever reason, and you quickly see how having the IDE properly maintain indentation on soft-wrapped text is an incredibly useful option. |
||||||||||||||
|
Word Wrap and indented lines |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by