My site have some thousands of images now, and I ran into a problem: Too many image files in a single directory. With all uploaded images with all derivatives in the same directory, the site got far over 5000 files in files/images, effectively making it impossible to maintain. I mean, through FTP I can't see more than 5000 files in a directory (on that server at least), and even below 5000 all sorts of weird stuff happen (like FTP clients crashing, or having half a minute response time). I was unable to backup my site (let alone occasional file manipulations 'by-hand').

So, I need to split the files into more directories. This is basically simple: Each time the directory is getting too big, just go, and change the image directory default path in administrative settings for the Image module. Then, new images will be uploaded into fresh directory - say - images2 etc.

Unfortunately, there's an unpleasant side-effect: Once the derivatives are rebuilt for whatever reason (on 5.x the path change itself did it, 6.x is better but still there are ways to trigger it), these derivatives don't stick to the original, but are moved into the new default path. The result is, that derivatives (possibly) change paths each time I start a new folder for images, they are located ilogicaly away from originals then, and the new directory is quickly cluttered with moved derivatives of *all* older images, denying the purpose of switching directories completely.

So, I believe that derivative paths should be taken from the corresponding original file, and not from the default. This should ensure, that derivatives are always sticking to the original's location, whatever I do with the setting later.

Additionally, I like to have per-size subdirectories, splitting the pile of files further.

Attaching a patch for this. Basically it attempts to adjust paths for derivatives as described above, falling back to default in case of temporary files, or calls to _image_filename() without original path (happening quite rarely, in particular from Image Assist module). I implemented this waaay back on 5.x (as a quick hack to get out of horrible filesystem-situation on production site), and now after a year online, it works quite fine.

As a sidenote, I had several more fixes to the 5.x version, and I'm pleased to see that most of the bugs are fixed now on 6.x. Great work, thanks! This one still stands, though.

Comments

sun’s picture

Status: Needs review » Closed (duplicate)

As much as I appreciate your effort here, I have to mark this issue as duplicate of #103793: Add token support for image file directory and image names. This is a long-wanted feature and I can't await to see a proper patch for it.

joachim’s picture

Title: Derivatives paths: Splitting images into more directories » derivative paths should be taken from the corresponding original file, and not from the default
Category: feature » bug
Status: Closed (duplicate) » Needs work

Reopening and renaming.
As discussed on http://drupal.org/node/103793, this is a bug:

"derivative paths should be taken from the corresponding original file, and not from the default. This should ensure, that derivatives are always sticking to the original's location, whatever I do with the setting later."

JirkaRybka, could you reroll this patch so it just keeps derivatives in the same folder as originals? ie don't put the derivatives into subdirs.

sun’s picture

Sorry for the noise.

I agree with the separation into this issue. However, I am not entirely sure whether this is really how it should work. I wonder whether this works with all edge-cases. Because _image_filename() is invoked from a lot of places.

Also: Does this mean that users cannot alter the path for existing images?

Maybe I just need to be convinced.

In any case, this needs SimpleTest(s).

joachim’s picture

I haven't looked at the code in depth, but from what the original report says, existing images aren't moved when you change the value of the image path. (I think I saw a bug report or a forum post on that.) The image path settings doesn't say 'this is where all images ARE', it says 'this is where to PUT new images'.
Regenerated derivatives are not really new images, and it makes sense to keep them in the same folder as the original.
We could decide in future that changing the image path setting MEANS moving all images -- but that's a new feature and would be quite a bit of work. (And think of how long it could take on big sites!)

As well as tests, this could do with a preliminary patch to add more documentation to _image_filename(), listing where it is invoked from.

JirkaRybka’s picture

Status: Needs work » Needs review
StatusFileSize
new1.2 KB

Allright, patch rerolled, minus subdirectories (i.e. only bugfix-part now).

Now, that I'm less overworked and less desperate about my site's upgrade (a nightmare, really!), let me add my apologies for the initial post being an unclear mix of two issues, really. I ran this on my site so long, that I got used to understanding it as a single issue (as I added it all to address a single problem, to begin with), but now I see I can go without subdirectories, too.

About the patch and its workings:

The current state:
- The default path setting says, where to put newly uploaded original images, and is currently the *only* way to split images into multiple directories.
- Original files are never moved or renamed. Period. That's how the current version works, and any change to that goes beyond scope of this issue.
- In the other hand, image derivatives are sometimes rebuilt on-the-fly, using the currently effective default path setting, so their paths change if the setting was modified. This de facto denies usability of the default path setting (existing originals and derivatives react differently).

Desired state:
- Use the original image path for derivatives, to ensure they are kept together (even if the default changed later). Since originals are currently non-movable, this also means fixed (consistent) paths/URLs for derivatives.
- If we decide to make the originals movable in the future (not discussing how), the derivatives will still follow their originals (on first rebuild) wherever they went (and not somewhere else).
- If we ever decide to make some sort of configurable sub-paths for derivatives in the future (my initial patch being a hard-coded example), these are still likely to need to be derived from original path (and not from default), for the same reasons, in some configurations at least. This is beyond scope here, but thinking this way, I believe that having the original's path available at this point in the process makes sense then, too.

The role of _image_filename()
- This function have a central, full control over all image files - both filename and path are coming directly from there. So I believe, that this is the right place to do any changes to the strategy on paths and/or filenames.
- This only applies on write operations. Reads take filepaths from the DB table; guesses via _image_filename() are unlikely to ever happen for existing files (and would be bad practice, if I'm not mistaken).
- We already have the original path information available in the function. The first argument $filename (the original file) is not only needed as a source of filename for alteration, it's also always passed in the form of full filepath (speaking of Image module package, I didn't check all other possibly dependent modules), and so may serve the very same purpose for path too. (Since this information is - on existing images - naturally taken from node object and/or DB table, the path is always available to caller-code, so documenting that the whole thing should be passed in, should do no harm at all.)
- The exception: Temporary files. These are run through _image_filename() too, with a special flag, and no alteration of the (temp) path is desired. These files are later moved to final place by _image_insert() - that's always necessary to attach them to node properly - and from there _image_filename() is called again, with correct original path, and the file then moved. So this ensures consistency of final storage, however the temp files were created.
- External calls from other modules - the worst (and only) example I know about: The Image Assist module calls _image_filename() directly (although it's a private function, strictly taken), and gives only just filename (no path). Note that it's only because it does _image_filename(basename($full_original_path), ... ), otherwise the path is available there too, and might be easily fixed. That's why my patch have a sanity check, to avoid returning filenames like './image.jpg', should this happen anywhere. But however, even Image Assist can't avoid _image_insert() call to attach the new file to node properly - which then relocates the (temporary, in fact) file to correct location based on original image path. So in the end, it works like a breeze there, too, and no fix needed (I tested carefully). I believe, that this mechanism, i.e. the _image_insert() -> _image_filename() storage procedure having the final say, applies to all write operations.
- Even if, by some unbelievable magic, a different path got passed out of _image_filename() at some relevant point (i.e. the fallback in my patch triggered, somehow), we get nothing worse than the previously existing state: File just stored elsewhere (= at default path), but still accessible (DB/filesystem match) and sanitized against filename-collisions. I believe this won't happen, but even if it did, it makes no harm.
- As for statistics of _image_filename() calls, there are only just three in the Image package (yesterday's dev tarball to be exact), all inside image.module, all providing full original filepath. (5.x had four, otherwise the same applies). The only other call found on my whole testing webserver (I did a grep) is the mentioned one in Image Assist module. I can't speak of other contribs, but I think it's extremely unlikely that anything breaks.

Details of the patch:
- We capture the original path, before it gets stripped.
- The rest only happens for non-original sizes (derivatives), I emphasize that. Originals are not affected.
- The actual path replacement (original path instead of default) only happens after a set of sanity checks - otherwise the default path (pre-patch version) still stands as a fallback:
* It must not be a temporary file (we have a flag available for that)
* The path must be valid ('.' is the situation of no path passed in (just filename), as mentioned in the Image Assist example above)
* The path must not be a temporary directory ('/temp' is the directory from Image module, '/tmp' is a default from Drupal file uploads). This is just an additional sanity check, ensuring that we *never* enforce a (recognizable) temporary path over default, whichever possible bug might have caused that elsewhere. I initially needed this on 5.x, where the whole image handling was less stable, to avoid creation of subfolders under temp (yes, that was my previous mixed patch), but although it doesn't currently happen on 6.x (as far as my tests indicated), I still feel uneasy about removing it. It's cheap performance-wise after all, and adds extra safety to the alteration.

Fixed along the way:
There's the 'file had no extension - happens in really old versions' code segment just below, accessing the original file for metadata (through image_get_info()). I never saw such a file (apparently my old files, dating back to 4.7, are not old enough), and so I can't really test this, but still I'm under impression that it's affected by the same bug, too. I mean, once the default path is changed, this code segment can't access the old originals anymore, looking for old files at new path. So, I believe, that my patch would fix this too, supplying the real original path (and so keeping the full original filepath unchanged, as coming from node; unless it's a temporary file, but that never happens, as temporary files are just new uploads - or am I missing something?)

Hopefully this clarified things enough. Correct me, if I got something wrong.

sun’s picture

Status: Needs review » Needs work

Whoa! This comment almost made me push the button without reading it completely :-D Thanks! You rock.

So the remaining todos are:

- Tests to ensure this works as intended.

- Rename the function argument to $filepath.

- PHPDoc teaching that $filepath should be a full path with filename.

- Revert the placement of the "Insert the resized name in non-original images" comment.

- Rework the inline comment to exactly state the sanity checks you noted here for future reference. Remove the extra "temp" and "tmp" checks. The new tests for this should verify that the logic works properly.

- Stop bashing Image Assist ;)

JirkaRybka’s picture

Whoa! Your reply was way faster, than I expected :)

Mostly I see your concerns as valid ones, but it's too late night, and I'm going away for about a week tomorow. Some quick comments before I leave:

- Tests: I didn't learn about the new Drupal tests anything yet. Unable to do that in my available timeframe, sorry. So this means either a huge delay on my part, or another contributor needed here.
- Rename argument: If you say it's OK and acceptable to go as far as renaming arguments, I'm happy with that :)
- PHPdoc - yes, sure...
- Revert placement of comment: I feel really uneasy. Either the new code doesn't belong inside that block (hence the comment moved in my patch), or the comment must be reworked. The new code has nothing to do with "inserting resized name", and it'll be just below that comment?
- State sanity checks & remove some: Fine, I guess. I just didn't fully research on this one, to make absolutely sure that it gets *never* called without $temp flag, but still with a temp original file. It was happening on 5.x (due to a bug that I fixed for my site independently, but equally to the proposal at http://drupal.org/node/131589#comment-533564 ).
- Image Assist: Just wanted to give all available details about _image_filename() usage :)

(If someone steps in to do the reroll, I would be happier, given my very limited time.)

joachim’s picture

@JirkaRybka: do you still have time to work on this? If not, I can take a look at it :)
@sun: could you clarify what a test should do? My first guess would be: set the filepath to 'images1', create an image, change the filepath to 'images2', regenerate the derivatives for the image and check they remain in 'images1'. Is this what you had in mind?

I'd like to get this fixed so we can move forward with token support for original image filepaths here: http://drupal.org/node/103793

JirkaRybka’s picture

Re: #8
I'm currently flooded with other work - so, unfortunately, I can't proceed now. Feel free to take a shot. I hope to keep an eye on the discussion here, but my current situation makes even that unsure. Still, the issue is basically as simple as you've said ("what a test should do" is correct as far as I can tell), so I guess it's going to be no trouble. Good luck, and my apologies.

2noame’s picture

I'd like to help test this, but I'm new to this whole patch process. I figured out how to do the patching, went with Cygwin, and did successfully patch it, at least it said so, but then what? Do I run update.php after patching, or is it good to go?

Hetta’s picture

2noame: it's good to go. Try things out and report any new problems here.

joachim’s picture

Ok I've got part of the way with a test but I am stumped.

  /**
   * Verify derivatives take their path from the original image.
   */
  function testImageDerivativePath() {
    // Create an image.
    $edit = array(
      'title' => $this->randomName(),
      'body' => $this->randomName(),
      'files[image]' => realpath($this->image),
    );
    $this->drupalPost('node/add/image', $edit, t('Save'));
    
    $node = node_load(array('title' => $edit['title'])); 
    file_put_contents('hello_1', print_r($node,1));
    
    // Path of the thumbnail derivative.   
    $first_thumbnail = $node->images['thumbnail'];
    
    // Change the file path.
    variable_set('image_default_path', 'images_alternate');
    
    // Rebuild derivatives.
    image_operations_rebuild(array($node->nid));
    
    $node = node_load(array('title' => $edit['title']));     
    file_put_contents('hello_2', print_r($node,1));
    // ARG! Has NO IMAGES!
    
    $new_thumbnail = $node->images['thumbnail']; 
    
    $this->assertTrue($first_thumbnail == $new_thumbnail, t("$first_thumbnail == $new_thumbnail"));  
    
  } 

Just paste the above as a new function into the class in tests/image.test.
Basically, image_operations_rebuild is killing the images but not rebuilding! It seems to work when invoked from admin/content/node, but it seems when called directly the node is not getting saved.
Not sure how it's mean to work as image_update doesn't do any kind of node saving from what I can see.

Could really use a fresh pair of eyes on this!
Just try the above text code, no need to try the patch yet. The test should fail due to the two thumbnail files being different rather than the second one being absent!

JirkaRybka’s picture

On quick look - I suspect that inside image_update() the first part fires, I would try unsetting $node->new_file. Just a wild guess, might be wrong as well. Edit: Also, is there a valid image file, so that derivatives creation doesn't fail? I really don't have time to really look into this, though.

2noame’s picture

Was this included as a fix in the newest alpha 5? If not, it really needed to be.

joachim’s picture

If this issue doesn't say 'fixed' then no fix was included -- we work entirely within the issue queue.
See above comments for how far work got on this. Help is needed.

2noame’s picture

JirkaRybka, your patch works beautifully and thank you so much for it. You're a lifesaver. I too have tens of thousands of images spread across dozens of subfolders and as it stood without this bugfix, and yes I consider it a bug to be fixed, image module would have remained unusable to me and I would have been forced to dump image module in favor of imagecache/imagefield.

This really does need to be added to the next image module update because thumbnails do belong alongside their original files. Without it, anyone using multiple directories is going to get a crazy large derivatives directory and anytime that folder gets changed to a new one, all the images require being remade yet again. This patch fixes that. The only thing I needed to do other than install this patch, was to delete all former derivatives and let them all get remade properly.

Also, just a note, I use this in combo with Lightbox2 and prior to patching, the ability to do full size downloads was broken whenever the derivatives were not in the same folder as the original. So this patch corrected that too. At this point everything is working exactly the way I want it to.

Thanks again!

sp3boy’s picture

StatusFileSize
new6.79 KB

Having a long-term interest in #103793: Add token support for image file directory and image names and Image in general I took a look at the last patch and have tried to apply the changes from #6 as I understand them.

I have also put together what I think is a pretty solid test function, based on the suggestion in #12 but using form posts to change the image file path and to rebuild a node's derivatives rather than setting variables or calling functions directly.

I have also had to make a slight change to the last test function in the script as it was picking up the values of the second node created by my new test, rather than the second node created by it's own actions. This was due, I think, to cacheing. I put my new test in what I thought was a suitable position based on the general flow of the testing steps.

I also had to add some access permissions, one to support my test and the others because certain tests have I think been failing since #44057: Use core-style content permissions was committed.

I hope my offering is useful. Unfortunately I will not be around to respond to comments etc. for the next week or so.

sp3boy’s picture

Status: Needs work » Needs review

On reflection I think a status change is appropriate.

joachim’s picture

StatusFileSize
new1.57 KB
new4.69 KB

Wahey!

I've split this patch up:
- First: the fix to permissions: that's a fix to the changes in #44057: Use core-style content permissions, so I've committed it there.
- Simpletest: the changes to the test suite.
- Image: the change to the module code.

So:
- applied the simpletest patch and the new test FAILS. This is expected and good -- the new test should fail with the current code.
- applied the image patch on top of this, and the new test PASSES. A manual test drive of this confirms it works -- regenerating a node after changing the image path leaves the derivatives in the original location.

So a +1 from me, but I'd like at least one other person to test it.
Though I'd also like to get a RC released on the first day of DrupalCon at the latest, so... :)

sun’s picture

+++ tests/image.test	14 Aug 2009 08:18:45 -0000
@@ -196,6 +197,81 @@ class ImageTestCase extends DrupalWebTes
+   
...
+   

Trailing white-space (blank lines should be blank).

+++ tests/image.test	14 Aug 2009 08:18:45 -0000
@@ -196,6 +197,81 @@ class ImageTestCase extends DrupalWebTes
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'Image', '%title' => $edit['title'])),
+      t('Image node was created.'));
...
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'Image', '%title' => $second_edit['title'])),
+      t('Second image node was created.'));
...
+    $this->assertTrue(preg_match('/images_alternate/', $second_node->images['_original']),
+      t("New path {$second_node->images['_original']} used for second image."));
...
+    $this->assertRaw(t('@type %title has been updated.', array('@type' => 'Image', '%title' => $edit['title'])),
+      t('First image node was updated to rebuild derivatives.'));
...
+    $this->assertTrue($node->images['thumbnail'] == $first_node->images['thumbnail'],
+      t("Rebuilt derivatives for first image have same thumbnail path as original node: {$node->images['thumbnail']} == regenerated thumbnail path {$first_node->images['thumbnail']}")); 

Strange wrapping here. Let's just keep it on one line. ;)

This review is powered by Dreditor.

+++ tests/image.test	14 Aug 2009 08:18:45 -0000
@@ -196,6 +197,81 @@ class ImageTestCase extends DrupalWebTes
+   
...
+   

Trailing white-space (blank lines should be blank).

+++ tests/image.test	14 Aug 2009 08:18:45 -0000
@@ -196,6 +197,81 @@ class ImageTestCase extends DrupalWebTes
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'Image', '%title' => $edit['title'])),
+      t('Image node was created.'));
...
+    $this->assertRaw(t('@type %title has been created.', array('@type' => 'Image', '%title' => $second_edit['title'])),
+      t('Second image node was created.'));
...
+    $this->assertTrue(preg_match('/images_alternate/', $second_node->images['_original']),
+      t("New path {$second_node->images['_original']} used for second image."));
...
+    $this->assertRaw(t('@type %title has been updated.', array('@type' => 'Image', '%title' => $edit['title'])),
+      t('First image node was updated to rebuild derivatives.'));
...
+    $this->assertTrue($node->images['thumbnail'] == $first_node->images['thumbnail'],
+      t("Rebuilt derivatives for first image have same thumbnail path as original node: {$node->images['thumbnail']} == regenerated thumbnail path {$first_node->images['thumbnail']}")); 

Strange wrapping here. Let's just keep it on one line. ;)

+++ image.module	13 Aug 2009 20:45:52 -0000
@@ -861,17 +861,29 @@ function _image_build_derivatives($node,
+ * @param $filepath
+ *   The full path and filename of the original image file.
...
-function _image_filename($filename, $label = IMAGE_ORIGINAL, $temp = FALSE) {
+function _image_filename($filepath, $label = IMAGE_ORIGINAL, $temp = FALSE) {

The remaining arguments are not covered.

I didn't look this up, but is it ensured that all functions really pass a filepath here (instead of a filename)?

This review is powered by Dreditor.

joachim’s picture

One other point now I see your review:

+ * The full path and filename of the original image file.

I always get very confused with paths -- are they relative or absolute?
I've found working on module builder that you can use a path relative to Drupal root or an absolute one in most cases for PHP functions.
But it's worth saying in the function comment header, just to be clear. Eg:

+ * The full path and filename of the original image file, relative to Drupal root, eg 'sites/default/files/images/myimage.jpg

> The remaining arguments are not covered.

It was like that before though -- patch creep kills kittehs! ;)

> I didn't look this up, but is it ensured that all functions really pass a filepath here (instead of a filename)?

$ grep -r _image_filename *
image.module:    $destination = _image_filename($original_path, $key, $temp);
image.module:function _image_filename($filepath, $label = IMAGE_ORIGINAL, $temp = FALSE) {
image.module:  if (file_move($image_path, _image_filename($original_path, $size))) {
image.module:  if (!file_copy($filepath, _image_filename($filepath, IMAGE_ORIGINAL, TRUE))) {

Looks ok :)

Since the tweaks are all stylistic, I'll make them once we get another test review.

joachim’s picture

This patch is essential to a 1.0 release of image module.
I intend to commit it while at DrupalCon Paris, regardless of its status, prior to making a 1.0 release
If you care about the quality of image module, please try to test it before then.

sp3boy’s picture

I tested the new patches in #19 as suggested:

  • Install new D6.13, Image HEAD etc.
  • Apply testing patch
  • Run Simpletest for Image - test fails as expected
  • Apply image patch
  • Run Simpletest for Image again - test succeeds as expected.

I also did a manual test, changing the Image path after uploading an image and rebuilding the image node derivatives. The derivatives were rebuilt as expected.

It all checks out as far as I can see.

joachim’s picture

Status: Needs review » Fixed

> Strange wrapping here. Let's just keep it on one line. ;)

FWIW, why is it ok to have lines of code that wrap horrendously, but not lines of doxygen comments?
The former are hard to read, the latter a pig to write and update.
I've changed it as requested but I for one rather like to cut up long function calls into one parameter per line.

Anyway.... :)
Changes as detailed above made, committed patches.

Thank you for coding and testing sp3boy! :D

sun’s picture

Thanks! :)

To my knowledge, there are two ways to write lengthy lines without looking strange:

1) Single line.

$this->assertTrue($node->images['thumbnail'] == $first_node->images['thumbnail'], t("Rebuilt derivatives for first image have same thumbnail path as original node: {$node->images['thumbnail']} == regenerated thumbnail path {$first_node->images['thumbnail']}"));

2) Multi-line.

$this->assertTrue(
  $node->images['thumbnail'] == $first_node->images['thumbnail'],
  t("Rebuilt derivatives for first image have same thumbnail path as original node: {$node->images['thumbnail']} == regenerated thumbnail path {$first_node->images['thumbnail']}")
);

2) is most often used for arrays. But Drupal HEAD uses it also in some other places for function arguments, so it seems to have become a valid coding standard for better readability, for example:

http://api.drupal.org/api/function/node_delete_confirm/7

Apparently, it looks like all invocations of confirm_form() have been converted to multi-line syntax.

The difference to partially wrapping arguments/array-elements is that the code follows a consistent standard. That means, a script like coder_format (which we still need to apply on all image module files) is able to properly figure out, which standard has been applied, to reformat the code accordingly. The same machine-made assumptions done by coder_format are also done by all humans.

JirkaRybka’s picture

The more we split lines, the less code fits onto one screen, eventually hiding context from the developer and enforcing some kind of scrolling madness. Just saying my years-long growing feeling, as I see the style evolving from compact&entangled to logical&sprawled. Each option have its pros and cons, and I don't really dare to advocate any of them (as that would be a nasty discussion, challenging common taboos and the like). So I just throw it in as a sidenote here.

2noame’s picture

Well done getting this one fixed everyone! Now to get token support.... :D

joachim’s picture

dman’s picture

@JirkaRybka ...
Off-topic, perhaps it deserves its own discussion elsewhere, but...

The more we split lines, the less code fits onto one screen, eventually hiding context

If we don't split lines, actual code is actually hidden by being invisible off-screen.
Done with sane indenting, IMO it preserves context a lot better than minifying it does.

I split my lines overmuch, because I like to be able to read them at a glance, and I have a scrollwheel on my mouse. And an IDE that makes jumping through files a non-issue. Were I using vi, I would reconsider.

I most often do it inside a t() function (twice for the nested array) so I can see the values on-screen.
It may not be concise, but it makes it a lot more approachable when looking at someone elses code and groking it, knowing that you haven't missed something off-screen, or had to weed out and count the commas in one big string.

Which of the following is more obvious in intent, and easier to spot a problem in?

      return '<p>'. t("[meta_descriptionfile.module] If there is a %descriptionfile available in the import directory, that may be used to easily provide captions for the found images. <a href='!help'>About %descriptionfile</a>", array('%descriptionfile' => DESCRIPTIONFILE_METADATA_FILENAME, '!help' => url('admin/help/meta_descriptionfile'))) .'</p>';
      return "<p>". t("[meta_descriptionfile.module] 
        If there is a %descriptionfile available in the import directory, 
        that may be used to easily provide captions for the found images. 
        <a href='!help'>About %descriptionfile</a>", 
        array(
          '%descriptionfile' => DESCRIPTIONFILE_METADATA_FILENAME, 
          '!help' => url('admin/help/meta_descriptionfile')
        )) ."</p>";

... I'm not going to advocate that splitting my strings just for readability is a great idea ... but it helps me keep my embedded documentation up to date.

JirkaRybka’s picture

If we don't split lines, actual code is actually hidden by being invisible off-screen.

I thought that every sane text editor splits lines (mine does, at least, and every one I worked with did). If lines run off-screen today, then the world got completely insane already, denying any chance to have benefit from larger (in width) monitors, as that would indeed require the formatting to be hard-coded in the source file. Sometimes I really feel like the whole world deliberately moves AWAY from anything usable.

But that's OT indeed, so we better don't continue the discussion, which is pointless in this place anyway. Let me conclude, that it's a habit, and matter of taste, and one can get used to anything. It's just a pain if one is forced to throw all away and get used to something else, seen as less usable by the person in question (which is my case, partially). Changes hurt, if you don't see a point in them. This my rant, perhaps, just illustrates that.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.