Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Microsoft vs. Perl and sloppy programming - Wildly OT

by tinman (Curate)
on Jun 22, 2001 at 00:24 UTC ( #90521=note: print w/ replies, xml ) Need Help??


in reply to Microsoft vs. Perl and sloppy programming - Wildly OT

As just a few counter points.. I agree with you on your general argument, Ovid, but I think that your examples don't really support the points you're trying to make.. (at least, to me, they do not)...please do understand that I have nothing but respect for you, and this is in no way meant to be anything like a personal attack :o)

Sure, MS software does things implicitly.. if a developer is fool enough to only test on IE (or any one browser), then they probably deserve to be flamed to a crisp by users of other browsers.. I doubt that there is *any* browser that is fully spec compliant on all the complexities that are involved in rendering content on the World Wide Web.. a weak sort of example would be CSS support.. but on the other hand, does IE make life easy for its users ? sure.. you can go to a site, even with broken HTML, and still have IE make a reasonable effort to render the page.. As a web designer, I would not want to see this happen, but from a users perspective, this is a good thing.. (non-techies just want to see the content, they don't care why it broke, they just want to see the cute web page)... MS puts usability as a high priority item, and even if its a bitter pill for me to swallow, I have to admit that their software is "usable" to a pretty low common denominator... argue as you will that this is a bad thing, but to me, reaching the masses and making software easy to use not only ensures that it is a good product, but that more peoples lives are enriched because they can use the software without a lot of bother.. My mom would probably be a good example for this one :o). But if MS doesn't do it the right way, but only in the wrong way, then everyone *does* need to complain, and complain loudly at that :o)(ie: if sending image/gif didn't display the GIF file properly)

Perl has this attitude as well, as you've noted.. the "Do What I Mean" and not necessarily what I say slogan.. just recently, I discovered that heredoc behaviour that I had never known about... Perl just took care of the messy details for me, and I got the job done, none the wiser that Perl was actually done a bit of juggling behind the scenes for me..that is part of why I think Perl is so usable for beginners.. (you don't get this compiler warning that barks out "data type mismatch on line x, I'm not going to run this for you"), Perl just does the job.. Perl isn't really going to care if you take a char value and try to add a number to it, Perl will do what you want.. (or what it thinks you want).. :o)

I would submit that if Perl were not as usable as it is, and if only stars like merlyn and Tom Christiansen and lots of monks in this site were the only ones who could actually get Perl to do cool stuff, I wouldn't be on Perlmonks right now.. I'd be pounding away at some other language, cursing at the carpal tunnel syndrome that results from typing in too much code... :o) :o).. so, in my view, the agenda that Larry Wall and Microsoft have are different.. Larry Wall (I think) wants the language to be used (even baby Perl), so does Microsoft.. but Microsoft has a profit motive, and that means that they couldn't care less about whether you become a better programmer later on or not... Larry, on the other hand, wants you to become better at Perl and a better programmer (speculation, but I suspect this to be true).. so do the monks here.. which is why -w and use strict are recommended for almost each and every post...

The point of implicit conversions and the like is simply that you aim for the common sense case. I'd probably appreciate the date conversion in VBScript, if I screwed it up.. I'd also appreciate a (optional) polite warning. To me, that is control and power. What I've found is that with MS stuff, you get power, but you do not always get control. If it doesn't work the way you want it to, too bad, call tech support, and for a price, we'll tell ya... I see no difference in Perl, to be honest. Until someone posts code to Perlmonks, we don't know if that person is using strict or not. They could be people who write excellent programs, relying on lots of behind the scenes fiddling that Perl does (I didn't write excellent programs, but I wrote a lot of stuff that worked ok, even without -w or use strict. Now that I know better, I look at my old code and shudder...) They could be lucky (or lazy!)enough to have not encountered a situation where their code could break.. Whatever.. but being allowed to write sloppy code isn't a purely MS thing, and I can think of worse things to accuse MS of...What is important to me, mostly, is that I can get the job done, albeit somewhat imperfectly, really fast.. that *does* count for something..

Disclaimer: Now, for the purposes of this posting, I forget all the reasons why I hate MS, so I am ignoring their deliberate attempts at a monopoly, their ranting, their FUD, all of that.. What I'm trying to say is that they build software that appeals to the masses, and that's not a bad thing

Observation: I seem to be writing really long posts these days.. sheez. I need to cut back on the coffee or soemthing :o)


Comment on Re: Microsoft vs. Perl and sloppy programming - Wildly OT
(Ovid) Re(2): Microsoft vs. Perl and sloppy programming - Wildly OT
by Ovid (Cardinal) on Jun 22, 2001 at 02:00 UTC

    tinman wrote:

    please do understand that I have nothing but respect for you, and this is in no way meant to be anything like a personal attack :o)

    tinman: no need to explain. Reasonable people can disagree and I have absolutely no issue with that. I gave your post a ++ because it was well thought out.

    I think I could almost agree with you if MS gave the programmers the option to suppress these features. If I want to send my HTML docs with a content-type of "text/plain" and not have them rendered as HTML, I should be able to do that.

    It used to bug me about Netscape that it wouldn't render a table that was missing a closing table tag. Now, however, I'm happy about that. How many designers out there are producing better tables because of that? Browsers have, for a long time, been very forgiving about bad HTML. What does that do? It encourages bad HTML. I don't claim to write perfect, W3 specs HTML, but I'm not bad. When I first started, however, my HTML was a mess. I didn't know it, though, browsers were so nice to me. Now I struggle to unlearn bad habits.

    MS, by trying to second-guess programmers has allowed them to focus on quantity, not quality. Perl, on the other hand, while it definitely has a DWIM attitude, it's fairly well documented and predictable. Here are some examples that will definitely trip up new programmers, but once you understand what's going on, you can produce code that does what you intend without tripping up (those on the beginners-cgi mailing list will recognize this from today's emails):

    my $number_of_pets = ('dog','cat','iguana'); print $number_of_pets; my @pets = ('dog','cat','iguana'); $number_of_pets = @pets; print $number_of_pets; $number_of_pets = ('dog','cat',@pets); print $number_of_pets; @number_of_pets = ('dog','cat',@pets); print scalar @number_of_pets;

    All of those examples will generate consistent, reproducible results, even though the results will be strange to some. VBScript's date functions, by contrast, will have unpredictable results depening upon your data and your locale. This is not good. I don't mind DWIM, so long as it's predictable. I can't get that with MS. As a result, many MS programmers just kind of 'slide by' and hope things work. That's what I object to.

    Cheers,
    Ovid

    Update: Hmm... twice in as many days, Abigail has come behind me and pointed out flaws in my logic. I am unused to Perl having locale dependant functions (since I've only used it in the US). On the other hand, since I programmed in VBScript in Amsterdam, locale was a much more serious issue. That's US-centric thinking for you.

    That being said, there's still the issue of VBScript silently switching the month and day if it thinks the programmer screwed up. Ditto for IE ignoring the content-type header. I am not aware of any cases where Perl munges your data without your knowledge.

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      While I sort of agree with you, I strongly object against your biasm. Both Microsoft and Perl are doing DWIM. Either you think DWIM is good, or it's bad and you prefer BSDM, but I find it silly to say that when Microsoft is doing it, it's evil, but when Perl is doing it, it's good. Same for IE and Netscape. Netscape has been second guessing document authors longer than that Bill Gates realized the internet was here to stay.

      I don't think VB produces unpredictable results. That the return value of a function depends on the data passed to it isn't strange at all. Lots of function in lots of languages do so! As for the setting of locale, well, that's a parameter as well. Does Perl also have unpredictable results because the return value of uc and lc depend on locale? sort depends on locale as well, and some regexes too. Does that make Perl unpredictable? What about binary | and ^, where it matters whether the operands are strings or numbers. Or post/pre increment, where it can matter whether something was used in numeric context or not. I'd say that's far more "unpredictable" than the date function in VB.

      The solution is of course here. I believe that DWIM is a powerful feature. But just like powertools, they aren't for everyone. They are powerful in the hands of a master, and dangerous for those who cannot deal with them.

      -- Abigail

        I don't think VB produces unpredictable results. That the return value of a function depends on the data passed to it isn't strange at all. Lots of function in lots of languages do so!

        I have to say I think Ovid's example is a good one. I recently had to debug a bit of VB code that was giving unpredictable results - It was supposed to check the date of a remote file and update the local file if it was out of date. This worked most of the time, but some users in some locations reported that they sometimes could not see updates at the beginning of the month.

        It turned out that one of the dates was using the machine locale and the other was using the US date format. Now this is a bug and clearly should not work if you are on a european locale. But VB in its infinite wisdom was not raising an error or even reporting a warning when given a US date of 13/5/2001 - it just tried out all the other date formats in the locales table until it worked!

        This is unpredictable because it depended on when the remote file was updated, when the local user last got a copy of it, whether they noticed it was out of date and whether it is currently the end of the month. This is not DWIM! A bug like this needs to be known about ASAP, not a year down the line (I wasn't the first to look for the cause of the bug!)

        The difference between a feature like this and Perl's undocumented DWIMs is the intelligence of the designer: the VB feature was never thought through: the code doesn't change but as you go through the month whether it is right or wrong does change.

        -- iakobski

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://90521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (13)
As of 2014-07-24 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls