http://nickgravgaard.com/elastictabstops/
An example in PHP of the type of code for which this would be extremely useful:
Code: Select all
class Example {
// note the way that the variables line up here, and the values, and the comments
// the idea is to NOT need physical spaces,
// but just one tab char and then have the TextPad software implement an elastic stop (see the url)
protected $myname = "whatever"; // comment
protected $data = null; // comment
public $id = 0; // comment
function __construct() {
// again, note the way the key, value, and comment all line up here
$this->data = array(
'key' => "long string", // comment
'longerkeyname' => "str", // comment
);
}
}
This idea does require some thought and research, but I know it can be done, because the author of that url has figured out at least one viable approach. If made configurable enough, this could be useful for ALL programming languages (at least the dozen+ that I know), not just PHP or Perl or Javascript or web stuff, but Python, WSH, etc. Some other settings that TextPad would need do come to mind, like a minimum width, and perhaps a maximum number of tab chars to process as elastic stops.
One of my main reasons is that I'm one who loves to code using Verdana. For some projects, though, working with other coders who use a monospace font and align things such as below, this requires hitting the right number of spaces or tabs. So, we spend all this time hitting space and tab instead of just writing coding. Aren't we paid more than enough to focus not on byte beautification, but actual processing logic? It would be very very nice.