Spaces in file names
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Spaces in file names
Bit of an odd one... a colleague who I consider to be normally technically highly astute is adamant that people shouldn't use spaces in file names, ever, and the justification was that "spaces use more memory". This is in the context of 'advice to students' along with lists of basic keyboard shortcuts, how to zip a folder, etc. To me, this is fundamentally flawed. Sure, there are specific situations where spaces in filename and paths *can* cause hiccups, but software creators should build safeguards against this kind of problem anyway. In UX terms this kind of 'cure' is far worse than the perceived problem – not to mention being inappropriate to bother media-industry students about this.
Anyway, apologies for venting... any reactions to the "spaces use more memory" comment? Ignore the fact that we're not working with early 1980s-level memory limits so it would be utterly irrelevant in any normal situation – is it even true?
k
Anyway, apologies for venting... any reactions to the "spaces use more memory" comment? Ignore the fact that we're not working with early 1980s-level memory limits so it would be utterly irrelevant in any normal situation – is it even true?
k
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: Spaces in file names
Hi thatkeith,
I believe that "memory argument" is not relevant and " any normal situation " should allows import files contents created by the users without garanties to respect this rule.
best regards
Jean-Marc
I believe that "memory argument" is not relevant and " any normal situation " should allows import files contents created by the users without garanties to respect this rule.
best regards
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 9837
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Spaces in file names
An argument for leaner memory is (and certainly greater performance) might apply with case-sensitive file systems, but I can't think of any reason why a space character (or any other single-byte entity) would require more memory than any other character of the same size.
This may present an opportunity for the organization to review policies related to workplace drug and alcohol use.
This may present an opportunity for the organization to review policies related to workplace drug and alcohol use.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Spaces in file names
Mmm, quite.FourthWorld wrote:I can't think of any reason why a space character (or any other single-byte entity) would require more memory than any other character of the same size.
Heh. Well, considering there's a subsidised Student Union bar in the building...FourthWorld wrote:This may present an opportunity for the organization to review policies related to workplace drug and alcohol use.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Spaces in file names
LOLThis may present an opportunity for the organization to review policies related to workplace drug and alcohol use.
Well, look... if I put a space in a filename, that uses up more memory than not putting in a space, no? And if I put in ten spaces, that's an order of magnitude more memory than if I hadn't done that in the first place. And it uses more time to do all that typing as well, so it's a waste of both space *and* time. Pretty soon we'll be opening up wormholes to who knows where and the aliens will be able to come through and we'll have to put on those tinfoil hats for protection and you see where this is going all because of spaces in filenames?
On a different note, I do usually try not to use spaces in filenames because of the need to quote paths from a commandline. And that goes double for folder names. And yes, you do have to script things carefully when dealing with file paths because whether you use spaces or not, your users will do this all the time, and if you haven't coded properly for this things will break.
A long time ago Ken Ray posted a function that I use all the time for quoting. I don't think I have released a single app that doesn't incorporate it:
Code: Select all
function q pText
return quote & pText & quote
end q
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Spaces in file names
I had obviously (somehow) missed this thread, even though it occurred after my join date (go figure)
However, since I didn't miss it when it was given a new post this time around, I thought what the heck
By the way, I don't like spaces in filenames either, but it is not because of some throwback to an earlier time when a few bytes mattered
tmFile.txt
would take less memory than
tm File.txt
if you see what I'm saying. Not by a huge amount, by any means, but still some amount depending on what your using to encode the character. For instance, consider this nice breakdown I found on Stack overflow -
However, since I didn't miss it when it was given a new post this time around, I thought what the heck
Although not as important since, say, 1994 or so, this was indeed the norm before that when having +/- some huge KB of ram was a luxury.
By the way, I don't like spaces in filenames either, but it is not because of some throwback to an earlier time when a few bytes mattered
His friend isn't suggesting substituting another character for a space the way I read it, he is talking about eliminating spaces altogether. Arguably,FourthWorld wrote: ↑Wed Jul 05, 2017 3:04 pmAn argument for leaner memory is (and certainly greater performance) might apply with case-sensitive file systems, but I can't think of any reason why a space character (or any other single-byte entity) would require more memory than any other character of the same size.
tmFile.txt
would take less memory than
tm File.txt
if you see what I'm saying. Not by a huge amount, by any means, but still some amount depending on what your using to encode the character. For instance, consider this nice breakdown I found on Stack overflow -
An ASCII character in 8-bit ASCII encoding is 8 bits (1 byte), though it can fit in 7 bits.
An ISO-8895-1 character in ISO-8859-1 encoding is 8 bits (1 byte).
A Unicode character in UTF-8 encoding is between 8 bits (1 byte) and 32 bits (4 bytes).
A Unicode character in UTF-16 encoding is between 16 (2 bytes) and 32 bits (4 bytes), though most of the common characters take 16 bits. This is the encoding used by Windows internally.
A Unicode character in UTF-32 encoding is always 32 bits (4 bytes).
An ASCII character in UTF-8 is 8 bits (1 byte), and in UTF-16 - 16 bits.
The additional (non-ASCII) characters in ISO-8895-1 (0xA0-0xFF) would take 16 bits in UTF-8 and UTF-16.
-
- VIP Livecode Opensource Backer
- Posts: 346
- Joined: Mon Mar 01, 2010 7:13 pm
- Location: London, UK
- Contact:
Re: Spaces in file names
I should have added that their answer to my challenge was to advise underscores instead of spaces. Which entirely invalidated even a hint of logic in their argument.
Technical Writer, Meta
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
University Lecturer
Technical Editor, MacUser (1996-2015)
360 VR media specialist
Re: Spaces in file names
Well, I feel I was denied critical, most needful to know information !
Richard's interpretation was the more accurate one then. Bad on your friend
Richard's interpretation was the more accurate one then. Bad on your friend
Re: Spaces in file names
Of course SpectateSwamp is a spammer, but reawakened an curious thread. I mean... "my file name.txt" takes up more memory than "myfilename.txt" but "myfilename.txt" still takes up a lot more memory than "f.txt". Why not have a naming convention to shorten all names to the barest minumum length?
And what of the contents of the file? Chances are that would take vastly more memory usage than anything that a space or two in the filename could conceivably make a difference.
Now, spaces in filenames cause some issues in unquoted paths. But if that isn't featuring in the "logic" then I have to wonder... was this a delayed response to an original April Fool's prank?
And what of the contents of the file? Chances are that would take vastly more memory usage than anything that a space or two in the filename could conceivably make a difference.
Now, spaces in filenames cause some issues in unquoted paths. But if that isn't featuring in the "logic" then I have to wonder... was this a delayed response to an original April Fool's prank?
Re: Spaces in file names
Ihavenoideawhatistheproblemwithbeingmoreefficientbyeliminatingspacesbeingjustnaturallywhatmanyprogrammerswouldthinktoimprovetheworld.
Re: Spaces in file names
I think you have forgotten a few caMels in your [case]
IHaveNoIdeaWhatIsTheProblemWithBeingMoreEfficientByEliminatingSpacesBeingJustNaturallyWhatManyProgrammersWouldThinkToImproveTheWorld.text
Re: Spaces in file names
OhNoWhatAboutWhenYouGetACasesensitiveoperatingSYstemLIKEAndroid.txt ?
Typo nightmares!
It's bad enough with specialFolderPath("Documents") failing.
Typo nightmares!
It's bad enough with specialFolderPath("Documents") failing.