phobo's std.file is completely broke!

Josphe Brigmo JospheBrigmo at gmail.com
Sat Sep 15 23:50:43 UTC 2018


On Saturday, 15 September 2018 at 23:06:57 UTC, Jonathan M Davis 
wrote:
> On Saturday, September 15, 2018 6:54:50 AM MDT Josphe Brigmo 
> via Digitalmars-d wrote:
>> On Saturday, 15 September 2018 at 12:38:41 UTC, Adam D. Ruppe
>>
>> wrote:
>> > On Saturday, 15 September 2018 at 10:57:56 UTC, Josphe Brigmo
>> >
>> > wrote:
>> >> Phobos *NEEDS* to be modified to work with these newer OS's.
>> >
>> > You need to look at the source code before posting. The code 
>> > for remove is literally
>> >
>> > DeleteFileW(name);
>> >
>> > it is a one-line wrapper, and obviously uses the unicode 
>> > version.
>> >
>> > https://github.com/dlang/phobos/blob/master/std/file.d#L1047
>>
>> It doesn't matter, the fact is that something in phobos is 
>> broke. Do you really expect me to do all the work? The fact 
>> that using executeShell or "\\?\" solves 90% of the 
>> problems(maybe all of them) proves that phobos is not up to 
>> par.
>
> Using std.file should be on par with using the Windows API from 
> C or C++. It doesn't try to fix the arguably broken behavior of 
> the Windows API with regards to long paths but requires that 
> the programmer deal with them just like they would in C/C++. 
> The main differences are that the std.file functions in 
> question use D strings rather than C strings, and they 
> translate them to the UTF-16 C strings for you rather than 
> requiring you to do it. But they don't do anything like add 
> "\\?\" for you any more than the Windows API itself does that.
>
> If you consider that to be broken, then sorry. For better or 
> worse, it was decided that it was better to let the programmer 
> deal with those intricacies rather than trying to tweak the 
> input to make it work based on the idea that that could have 
> undesirable consequences in some circumstances. On some level, 
> that does suck, but the Windows API does not make it easy to 
> make this work like it would on a *nix system without 
> introducing subtle bugs.

Do you not realize how moronic that is though?  You are expecting 
each user to know the correct behavior and to compensate for it. 
With that approach all you are doing is creating a whole mess of 
problems.

See, there is only one phobos but many users of phobos. You are 
expecting every single user to deal with it instead of dealing 
with it in one place.

Your reason is because "It's a problem with windows".

Both are "We'll just kick the can down the road cause the other 
guy kicked it to us".

Now, this is great if you want repeat customers and don't care 
about their sanity but terrible to make progress.

> If you find that the std.file functions don't work whereas 
> using the same input to the Windows API functions in C/C++ 
> would have, then there's a bug in the D code, and it needs to 
> be fixed, but if it acts the same as the C/C++ code, then it's 
> working as intended.
>

And that is precisely the problem. For some reason you don't get 
that because it is broke in windows, and you following windows, 
you are just perpetuating the "brokeness".  This is why D sucks 
the way it does, because of these types of mentalities of "It's 
not our problem".

You basically expect the customers, before eating to wash the 
dishes, cook the meal, set the table, etc. All you do is provide 
the food, and not all that great food... and when they are done 
you expect them to wash the dishes against, clean up their mess, 
and pay the bill.

I'm sure you'll never realize how wrong your mentality is, but at 
least you could do everyone a favor and think about what you are 
actually saying. Your logic might have a valid reason, but it is 
not producing the results that make the world a better place.

D won't ever get any traction with the wrong mentalities and I 
don't even know how it has made it this far.

Trust me, if you expect the user to know everything and also 
solve all the problems over and over and over and over, you will 
have very few users.

But, keep on doing what your doing, it's worked so well, we will 
see how far it gets D.

If D is as perfect as you think it is, why isn't everyone jumping 
on board? I know, you have answers for that one too!







More information about the Digitalmars-d mailing list