Windows is Easier - Linux

This is a discussion on Windows is Easier - Linux ; After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom: > On Sep 20, 5:59 am, Linonut wrote: >> After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom: >> >> > ...

+ Reply to Thread
Page 3 of 4 FirstFirst 1 2 3 4 LastLast
Results 41 to 60 of 76

Thread: Windows is Easier

  1. Re: Windows is Easier

    After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:

    > On Sep 20, 5:59 am, Linonut wrote:
    >> After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:
    >>
    >> > Ok. That's fine - but, don't complain that Windows still has a crappy
    >> > shell environment. MS provides a very nice one.

    >>
    >> For sufficiently new versions of Windows.

    >
    > Anything that's newer then what? Almost 8 years old.


    I can still use the Linux powershell just fine .

    Look, Tom, if Microsoft weren't incorporating **** like activation and
    DRM as they rev their OS, you'd have a point.

    But when undesirable crap like that is tied to new dev tools, it kind of
    makes me want to stick with the old stuff.

    > It does come with emacs and brief keybindings - just not vi. And vi
    > is what I want.


    Unfortunately, I can't find a hint of emacs keybindings in VS 2002.

    > Funny, I very rarely have any problems - at least any problems that
    > can be attributed to the OS. And if you want my honest oppinion - I
    > have far fewer problems with my Windows installs then I do with my
    > Gentoo installs (broken compiles, out of date dependencies, etc).
    > Most of which are fairly simple to solve, but take time. I like
    > Linux, a lot - but Windows is not nearly as most people here make it
    > sound.


    Sure it is. It may work for you, but other people do have problems with
    it, some very serious. (I'm still grumpy about losing all my
    environment variables. Finally got them back. Luckily, all the apps
    are still accessible.)

    --
    Tux rox!

  2. Re: Windows is Easier

    On Sep 20, 1:55 pm, Linonut wrote:
    > After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:
    >
    > > On Sep 20, 5:59 am, Linonut wrote:
    > >> After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:

    >
    > >> > Ok. That's fine - but, don't complain that Windows still has a crappy
    > >> > shell environment. MS provides a very nice one.

    >
    > >> For sufficiently new versions of Windows.

    >
    > > Anything that's newer then what? Almost 8 years old.

    >
    > I can still use the Linux powershell just fine .
    >


    True.

    > Look, Tom, if Microsoft weren't incorporating **** like activation and
    > DRM as they rev their OS, you'd have a point.
    >


    I'm not a big fan of activation or drm - but, you realize there was a
    lot of pressure on MS to encorporate DRM in to the OS. Just as Apple
    has been doing with OSX.

    > But when undesirable crap like that is tied to new dev tools, it kind of
    > makes me want to stick with the old stuff.
    >
    > > It does come with emacs and brief keybindings - just not vi. And vi
    > > is what I want.

    >
    > Unfortunately, I can't find a hint of emacs keybindings in VS 2002.
    >


    I'm pretty sure they are there... They are in 2003 and 2005 at least
    (and I'm almost positive they were in vs6). Just look around in the
    options, under keyboard. There should be a drop down that shows
    verious command bindings.

    > > Funny, I very rarely have any problems - at least any problems that
    > > can be attributed to the OS. And if you want my honest oppinion - I
    > > have far fewer problems with my Windows installs then I do with my
    > > Gentoo installs (broken compiles, out of date dependencies, etc).
    > > Most of which are fairly simple to solve, but take time. I like
    > > Linux, a lot - but Windows is not nearly as most people here make it
    > > sound.

    >
    > Sure it is.


    No it isn't.

    > It may work for you, but other people do have problems with
    > it, some very serious.


    You are correct, some do. Some people have serious issues with Linux
    as well? So what's your real point.

    --
    Tom Shelton


  3. Re: Windows is Easier

    On Thu, 20 Sep 2007 10:22:08 -0700, Kelsey Bjarnason wrote:

    >> PHP has had chronic security problems, and an attitude of not wanting to
    >> fix them. This was so bad their head security guy quit in disgust because
    >> nobody was serious about security.
    >>
    >> How can you complain about Microsoft and then call PHP "particularly
    >> _good_"?

    >
    > Pretty easily, as "good" is not an absolute.
    >
    > Is PHP code generally easy to write? Yes.


    That depends entirely on what you want to write. PHP's lack of any real
    structure makes it difficult to write maintainable, and problem free code.

    One of ASP.NET and to some extent JSP's great advantages is that it
    provides a structured framework for event processing.

    > Is PHP code generally easy to maintain? Yes.


    Depends on how well the code is written.

    > Is PHP code generally easy to debug? Yes.


    Umm.. What? PHP is a bitch to debug.

    > Is PHP code generally easy to "port"? Yes.


    So long as you don't rely on any platform specific code, yes.

    > Is PHP code generally easy to get running? Yes.


    Again, that depends entirely on the code. I've installed PHP programs that
    took weeks of tweaking to get to work, largely because of lack of
    documentation and reliance on specific functionality in specific versions
    of support libraries.

    > Hmm. All points arguing that PHP is good. Does PHP have failings? Sure.
    > So do perl, C, C++, and pretty much every other language, tool, OS or
    > anything else you care to name.


    Obviously, but PHP has lots of problems that could be solved easily by the
    developers if they wanted to. One simple one would fix tons of problems, a
    switch to force variables to be initialized prior to use. That way, typos
    in variable names don't make you spend hours of debugging.

    > Take C as an example. It contains two functions in the standard language
    > which _cannot_ be used safely. Does this make C a poor language? No; it
    > simply means that a good C coder will not use those functions.


    Correction. Cannot be safely used with untrusted input.

    Let's use gets as an example. Suppose you're writing something for an
    embedded device that has all forms of input sanitized and scrubbed. Gets
    will work fine.

  4. Re: Windows is Easier

    After takin' a swig o' grog, Kelsey Bjarnason belched out this bit o' wisdom:

    > On Thu, 20 Sep 2007 14:01:39 +1000, Gregory Shearman wrote:
    >
    >>> You feel free to use Perl wherever you like. I use it when I _have_ to,
    >>> and no more than that.

    >>
    >> What a wimp!

    >
    > Not hardly, I just dislike perl. Intensely.


    I don't dislike it. Some things about it are nice. It has some
    advantages over shell script.

    But, damn, it can be arcane as hell! Trying to do even things that are
    it's acclaimed strong suit (text processing) can take a lot of googling
    and reading to figure out.

    Using Perl is one reason I'm now looking at Python. And, right off the
    bat, Python seems a lot more logical.

    --
    Tux rox!

  5. Re: Windows is Easier

    After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:

    >> It may work for you, but other people do have problems with
    >> it, some very serious.

    >
    > You are correct, some do. Some people have serious issues with Linux
    > as well? So what's your real point.


    My point is this: No OS is perfect. Windows has about as many problems
    as Linux. Many of the problems Windows has are papered over by its
    popularity (at this point in time). But I can duplicate and use
    Linux-related software as much as I need to, and pass it around to
    friends and acquaintance, while knowing that I am compromising neither
    their freedom nor their pocketbooks.

    --
    Tux rox!

  6. Re: Windows is Easier

    [snips]

    On Thu, 20 Sep 2007 11:07:16 -0700, The Ghost In The Machine wrote:

    > The C/C++ API contains several issues.


    What C/C++ API? C and C++ have standard libraries - but they're somewhat
    different standard libraries.

    > gets() -- probably the most obvious failing, and the linker in fact
    > warns about usage thereof. Alternatives include fgets() and getchar()
    > within a loop of some sort.


    Note that scanf() has exactly the same potential for failure as well;
    fgets followed by a parsing block is canonical.

    > sprintf() -- buffer overflow possibilities. The linker does *NOT* warn
    > about usage.


    Nor should it - unless it's going to also warn about strcpy, strcat,
    fgets, anything that reads into or out of a buffer - and if it does,
    someone is liable to kill the implementers.

    > std::istream & operator>>(std::istream &, char *) -- buffer overflow, no
    > warning. This one's far from obvious; fortunately, it is not used that
    > often.


    I prefer getline, as a rule.

    > setbuf() -- has no buffer size, no warning.


    Huh? It does have a buffer size - BUFSIZ. Unless the buffer passed in
    NULL, in which case it sets unbuffered mode.

    > free() -- some implementations don't check the pointer carefully enough.


    What's to check? It's either something previously allocated, NULL, or a
    coding error - and no return value to report error. Could use errno, I
    suppose.

    > mktemp() -- in place edit of charbuffer; use carefully.


    strtok.

    > sizeof() -- This isn't really a function


    Not a function at all, nothing "not really" about it. It's an operator.

    > but try this sometime, to
    > illustrate several fundamental C/C++ flaws -- or perhaps features, if one
    > prefers:


    > #include


    C, not C++. In C++, use

    > static char hello1[] = "Hello world! This is a test!\n";
    > static extern char * hello2 = "Hello world! This is a test!\n";
    >
    > static void call2(char * n1, char * n2) {
    > printf("%d %d\n", sizeof(n1), sizeof(n2)); printf("%d %d\n",
    > sizeof(*n1), sizeof(*n2));


    Ick. %d and sizeof? No. sizeof returns an unsigned integer value. In
    C99, there's actually a format specifier for this, in C90 there isn't, so
    canonical is to cast to unsigned long and use %lu. However, that aside...
    > }
    >
    > int main(void)
    > {
    > printf("%d %d\n", sizeof(hello1), sizeof(hello2)); printf("%d
    > %d\n", sizeof(*hello1), sizeof(*hello2));
    > call2(hello1, hello2);
    > return 0;
    > }
    >
    > The printout of this program is
    >
    > 31 4


    31 - size of hello1, which is an array.

    4 - size of hello2, which is a pointer.

    > 1 1


    1, which is *hello1, which is a char, hence size 1.

    And again, for *hello2.

    (calls call2 function)

    > 4 4


    4, the size of parameter n1, which is a pointer.
    And again, for parameter n2.

    > 1 1


    And one for *n1, which is a char
    And again for *n2, which is a char.

    Which is exactly as we expect.

    > which is not really what it should be but never mind; sizeof(char *) is
    > 4 on my system (some might have 8 if they're 64-bit) so it's what one
    > should expect in C/C++.


    No, it is what one expects for certain implementations.

    > Pascal makes a careful distinction between ^char
    > and ^array[1..10] of char, but C is a little sloppy -- which makes for
    > easier coding in spots but can be dangerous.


    C isn't sloppy at all:

    char array[100];

    This is an array. Period. No discussion or debate. However, the
    _symbol_ "array", in a pointer context, decays to a pointer value.

    That is, if you pass array to a function, for example, where the function
    expects a pointer, you get... a pointer. Contrast that to sizeof(), which
    does not expect a pointer, isn't operating in a pointer context - array is
    treated _as_ an array. Hence the evaluation as 31 with sizeof in main,
    but as 4 in the function, where array has been passed as a pointer.

  7. Re: Windows is Easier

    [snips]

    On Thu, 20 Sep 2007 17:16:18 -0500, Erik Funkenbusch wrote:

    > Let's use gets as an example. Suppose you're writing something for an
    > embedded device that has all forms of input sanitized and scrubbed. Gets
    > will work fine.


    Until the sanitizer fails, or someone points the code at a new version of
    the data grabber, or any of a thousand other things, at which point gets
    pukes, your code is clobbered and your life support system kills you, your
    nuke plant melts down, or you bill Mr. Zabowski $113 trillion for last
    month's dental work. Whichever.

    It's a very simple thing to remember: gets *cannot* be used safely. Ever.
    Period. Nor is there ever a reason to try, since fgets has all the
    functionality without the failings of gets.

  8. Re: Windows is Easier

    On Thu, 20 Sep 2007 22:18:55 GMT, Linonut wrote:

    > After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:
    >
    >>> It may work for you, but other people do have problems with
    >>> it, some very serious.

    >>
    >> You are correct, some do. Some people have serious issues with Linux
    >> as well? So what's your real point.

    >
    > My point is this: No OS is perfect. Windows has about as many problems
    > as Linux. Many of the problems Windows has are papered over by its
    > popularity (at this point in time). But I can duplicate and use
    > Linux-related software as much as I need to, and pass it around to
    > friends and acquaintance, while knowing that I am compromising neither
    > their freedom nor their pocketbooks.


    How many friends and acquaintances of yours run Linux? I mean, besides
    people you might have because of your Linux affiliation?

  9. Re: Windows is Easier

    [snips]

    On Thu, 20 Sep 2007 19:12:12 -0500, Erik Funkenbusch wrote:

    > How many friends and acquaintances of yours run Linux? I mean, besides
    > people you might have because of your Linux affiliation?


    Dunno about him, but for myself, several.

    Rob and his wife.
    About six people I know through them.
    Clayton and his wife.
    My lady.
    Her sister.
    At least three people from work, on an at least occasional basis.
    Roddy.

    Okay, that's a bakers dozen regular users, and three or four occasional
    users, plus me, and I've probably overlooked several.

  10. Re: Windows is Easier


    "Erik Funkenbusch" wrote in message
    news:1ud81iujuc29f.dlg@funkenbusch.com...
    > On Thu, 20 Sep 2007 22:18:55 GMT, Linonut wrote:
    >
    >> After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:
    >>
    >>>> It may work for you, but other people do have problems with
    >>>> it, some very serious.
    >>>
    >>> You are correct, some do. Some people have serious issues with Linux
    >>> as well? So what's your real point.

    >>
    >> My point is this: No OS is perfect. Windows has about as many problems
    >> as Linux. Many of the problems Windows has are papered over by its
    >> popularity (at this point in time). But I can duplicate and use
    >> Linux-related software as much as I need to, and pass it around to
    >> friends and acquaintance, while knowing that I am compromising neither
    >> their freedom nor their pocketbooks.

    >
    > How many friends and acquaintances of yours run Linux? I mean, besides
    > people you might have because of your Linux affiliation?


    Last I heard his wife and daughter are Windows users who refuse to use
    linux. Doesn't say much for linux if his own family refuses to try it.



    --
    Posted via a free Usenet account from http://www.teranews.com


  11. Re: Windows is Easier

    On Thu, 20 Sep 2007 17:24:05 -0700, Kelsey Bjarnason wrote:

    > [snips]
    >
    > On Thu, 20 Sep 2007 19:12:12 -0500, Erik Funkenbusch wrote:
    >
    >> How many friends and acquaintances of yours run Linux? I mean, besides
    >> people you might have because of your Linux affiliation?

    >
    > Dunno about him, but for myself, several.
    >
    > Rob and his wife.
    > About six people I know through them.
    > Clayton and his wife.
    > My lady.
    > Her sister.
    > At least three people from work, on an at least occasional basis.
    > Roddy.
    >
    > Okay, that's a bakers dozen regular users, and three or four occasional
    > users, plus me, and I've probably overlooked several.


    Ok. How many of those were not converted by you? That's not me moving the
    goalposts, I'm just curious.

  12. Re: Windows is Easier

    On Sep 20, 1:23 pm, Kelsey Bjarnason wrote:
    > [snips]
    >
    > On Wed, 19 Sep 2007 20:29:42 +0000, cc wrote:
    > > A) The installer was created incorrectly and put the files in the
    > > wrong path. This has nothing to do with Windows, and everything to do
    > > with the creators of the software. It's possible to have the same
    > > problem in Linux.

    >
    > Pretty much what happened, yes.
    >
    > > So, assuming we're not in Rex Ballard fantasy land, the problem you
    > > had has nothing to do with Windows.

    >
    > Didn't say it did. In fact, I *explicitly* said it didn't. You *did*
    > read that bit before responding, right?


    I did, but you contradict yourself when you say:

    "It is, however, a handy refutation of the nonsense view than Windows
    is universally better, simpler, friendlier."

    It is a refutation of none of that. Not that there aren't good
    examples that refute that view, but your problem has absolutely
    nothing to do with Windows, as you admit. So why the sarcastic
    "Windows is easier" subject, and your last sentence?


  13. Re: Windows is Easier

    Kelsey Bjarnason wrote:

    > On Thu, 20 Sep 2007 14:01:39 +1000, Gregory Shearman wrote:
    >
    >> Kelsey Bjarnason wrote:
    >>
    >>> On Wed, 19 Sep 2007 03:30:53 +0000, Tim Smith wrote:
    >>>
    >>>> On 2007-09-19, DFS wrote:
    >>>>> There's about 100% chance you screwed something up, or you're reading
    >>>>> from
    >>>>
    >>>> Well, I'd say the first screwup was using PHP instead of Perl for this.
    >>>> :-)
    >>>
    >>> You feel free to use Perl wherever you like. I use it when I _have_ to,
    >>> and no more than that.

    >>
    >> What a wimp!

    >
    > Not hardly, I just dislike perl. Intensely.


    Personal choice, eh?

    I love it. After using PHP and absolutely hating it I'm now using perl for
    all dynamic http content. It works wonderfully and is far more versatile.

    --
    Regards,

    Gregory.
    Gentoo Linux - Penguin Power

  14. Re: Windows is Easier

    Linonut wrote:

    > After takin' a swig o' grog, Kelsey Bjarnason belched out this bit o'
    > wisdom:
    >
    >> On Thu, 20 Sep 2007 14:01:39 +1000, Gregory Shearman wrote:
    >>
    >>>> You feel free to use Perl wherever you like. I use it when I _have_
    >>>> to, and no more than that.
    >>>
    >>> What a wimp!

    >>
    >> Not hardly, I just dislike perl. Intensely.

    >
    > I don't dislike it. Some things about it are nice. It has some
    > advantages over shell script.


    I'd NEVER use it where a shell script would do. I LOVE bash! Among other
    things I've written a most elegant backup script in it. Works a treat!

    > But, damn, it can be arcane as hell! Trying to do even things that are
    > it's acclaimed strong suit (text processing) can take a lot of googling
    > and reading to figure out.


    Never had to google anything on Perl. Its comprehensive man pages are all
    I've ever needed. It took me a LONG time to get used to its pointer (or
    reference) syntax (being so different from C) but I got there... and I've
    never looked back.

    > Using Perl is one reason I'm now looking at Python. And, right off the
    > bat, Python seems a lot more logical.


    Never used it... but I'm going to learn. A lot of the portage system for
    Gentoo is handled by python.

    --
    Regards,

    Gregory.
    Gentoo Linux - Penguin Power

  15. Re: Windows is Easier

    The Ghost In The Machine wrote:

    > In comp.os.linux.advocacy, Gregory Shearman
    >
    > wrote
    > on Thu, 20 Sep 2007 14:00:56 +1000


    >> I use the Apache mod_perl handler and use perl to build dynamic pages. It
    >> works better than php and isn't the security nightmare that is php. You
    >> can preload all the perl modules you want to use.
    >>
    >> Perl CAN be written is such a way as to make it easily maintainable.
    >> There are many ways to skin a penguin.
    >>

    >
    > Ah yes...I'd forgotten about that module. Perl can be a
    > joy or a nightmare, but it is a robust solution if used
    > properly. The problems, however, are similar to PHP's.


    Similar? PHP's problems stem mainly from its ease of use. A lot of people
    think they can write dynamic web pages when they really cannot. I don't
    think there are too many novices using perl to write dynamic http content.

    Perl a nightmare? It has a beautiful debugger (perl -d foobar)... what more
    do you need?

    I've got perl scripts more than 5 years old, still running, still
    maintainable on my machines.... can't be all bad.

    --
    Regards,

    Gregory.
    Gentoo Linux - Penguin Power

  16. Re: Windows is Easier

    On 2007-09-21, Gregory Shearman wrote:
    > I'd NEVER use it where a shell script would do. I LOVE bash! Among other
    > things I've written a most elegant backup script in it. Works a treat!


    Bash can be amusing. You might enjoy this script:

    > alive.$$

    while read cells
    do
    echo $cells >> alive.$$
    set x $cells
    x=$2
    y=$3
    echo $x $((y-1))
    echo $x $((y+1))
    echo $((x-1)) $((y-1))
    echo $((x-1)) $y
    echo $((x-1)) $((y+1))
    echo $((x+1)) $((y-1))
    echo $((x+1)) $y
    echo $((x+1)) $((y+1))
    done | sort | uniq -c > neighbors.$$
    grep '^ *3' < neighbors.$$ | sed -e 's/^ *[0-9].//'
    grep '^ *2' < neighbors.$$ | sed -e 's/^ *[0-9].//' > has2.$$
    sort alive.$$ -o alive.$$
    comm -12 has2.$$ alive.$$
    rm has2.$$ neighbors.$$ alive.$$

    It implements on generation of Conway's "Life". Input consists of one
    line per live cell, given the X and Y position of the cell, separated
    by spaces. Output is in the same format:

    $ cat in
    -10 100
    -10 101
    -10 102
    1000 5
    1001 5
    1002 5
    $ bash life.sh < in
    1001 4
    1001 6
    -11 101
    -9 101
    1001 5
    -10 101

    >> But, damn, it can be arcane as hell! Trying to do even things that are
    >> it's acclaimed strong suit (text processing) can take a lot of googling
    >> and reading to figure out.

    >
    > Never had to google anything on Perl. Its comprehensive man pages are all
    > I've ever needed. It took me a LONG time to get used to its pointer (or
    > reference) syntax (being so different from C) but I got there... and I've
    > never looked back.


    I suspect that Linonut is not heeding Brian Kernighan's advice:

    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it.

    Perl has many ways to be very clever indeed. But there is no
    requirement that you have to be overly clever, cute, or arcane.

    The same can be said for C++. You can go insane, say, with templates.
    Hell, the C++ template system is Turing-complete, which means you could
    actually make the compiler do all your computing for you at compile
    time, with sufficiently arcane templates! See this example:



    (And hey, according to Peter Kohlman, the guy who did that must be a
    moron, as he is a Mac user. Imagine what someone *smart* could do!).

    But you aren't required to actually do things like that. You can take a
    C++ compiler, and just use it as a slightly souped up C. Just use the
    std::string class, constructors and destructors in your structs, and
    maybe the STL. Limit yourself to that, and you'll have no more
    difficulty than with C, but be much more productive.

  17. Re: Windows is Easier

    After takin' a swig o' grog, Gregory Shearman belched out this bit o' wisdom:

    > Never had to google anything on Perl. Its comprehensive man pages are all
    > I've ever needed. It took me a LONG time to get used to its pointer (or
    > reference) syntax (being so different from C) but I got there... and I've
    > never looked back.


    I've found Google gets me quicker to the particular specific solution
    I'm looking for.

    >> Using Perl is one reason I'm now looking at Python. And, right off the
    >> bat, Python seems a lot more logical.

    >
    > Never used it... but I'm going to learn. A lot of the portage system for
    > Gentoo is handled by python.


    So are some of the big OSS source-code control systems (Mercurial for
    one, IIRC).

    --
    Tux rox!

  18. Re: Windows is Easier

    After takin' a swig o' grog, Erik Funkenbusch belched out this bit o' wisdom:

    > On Thu, 20 Sep 2007 22:18:55 GMT, Linonut wrote:
    >
    >> After takin' a swig o' grog, Tom Shelton belched out this bit o' wisdom:
    >>
    >>>> It may work for you, but other people do have problems with
    >>>> it, some very serious.
    >>>
    >>> You are correct, some do. Some people have serious issues with Linux
    >>> as well? So what's your real point.

    >>
    >> My point is this: No OS is perfect. Windows has about as many problems
    >> as Linux. Many of the problems Windows has are papered over by its
    >> popularity (at this point in time). But I can duplicate and use
    >> Linux-related software as much as I need to, and pass it around to
    >> friends and acquaintance, while knowing that I am compromising neither
    >> their freedom nor their pocketbooks.

    >
    > How many friends and acquaintances of yours run Linux? I mean, besides
    > people you might have because of your Linux affiliation?


    Unknown. At work, in our building, about 7 out of 14 people use it at
    work or at home. Only one of them uses it only at work, but that person
    almost never brings their laptop home.

    I know two other people outside the group that use it for sure, and I
    know there is at least one Linux-based project out there.

    Amongst my soccer acquaintances, I've known a couple using Linux, but
    I don't routinely survey people for Linux usage.

    I've been helping my next-door neighbor (a 70+ year-old man) use it, and
    he's sticking to it pretty well.

    This is in stark contrast to the situation a few years ago, where I was
    close to the only one I knew using it, at home or work.

    And this is in a relatively low-tech area.

    Sure, it's just a survey of my local area, but I see Linux usage as
    booming, and I think Microsoft is right to be very afraid of it.
    Luckily for them, they're the default OEM install. Otherwise, they'd
    be in a world of hurt already.

    --
    Tux rox!

  19. Re: Windows is Easier

    In comp.os.linux.advocacy, Kelsey Bjarnason

    wrote
    on Thu, 20 Sep 2007 16:47:30 -0700
    :
    > [snips]
    >
    > On Thu, 20 Sep 2007 11:07:16 -0700, The Ghost In The Machine wrote:
    >
    >> The C/C++ API contains several issues.

    >
    > What C/C++ API? C and C++ have standard libraries - but they're somewhat
    > different standard libraries.
    >
    >> gets() -- probably the most obvious failing, and the linker in fact
    >> warns about usage thereof. Alternatives include fgets() and getchar()
    >> within a loop of some sort.

    >
    > Note that scanf() has exactly the same potential for failure as well;
    > fgets followed by a parsing block is canonical.
    >
    >> sprintf() -- buffer overflow possibilities. The linker does *NOT* warn
    >> about usage.

    >
    > Nor should it - unless it's going to also warn about strcpy, strcat,
    > fgets, anything that reads into or out of a buffer - and if it does,
    > someone is liable to kill the implementers.
    >
    >> std::istream & operator>>(std::istream &, char *) -- buffer overflow, no
    >> warning. This one's far from obvious; fortunately, it is not used that
    >> often.

    >
    > I prefer getline, as a rule.


    Ditto, although
    std::istream & operator >> (std::istream&, std::string &))
    can occasionally be useful.

    >
    >> setbuf() -- has no buffer size, no warning.

    >
    > Huh? It does have a buffer size - BUFSIZ. Unless the buffer passed in
    > NULL, in which case it sets unbuffered mode.


    True.

    >
    >> free() -- some implementations don't check the pointer carefully enough.

    >
    > What's to check? It's either something previously allocated, NULL, or a
    > coding error - and no return value to report error. Could use errno, I
    > suppose.


    AIUI, some old implementations bombed in interesting ways when passed a
    pointer not previously returned by malloc()/calloc(). Presumably
    the spec for this function assumes "undefined behavior" in that case.

    >
    >> mktemp() -- in place edit of charbuffer; use carefully.

    >
    > strtok.


    Oh yes. Forgot about him. :-)

    >
    >> sizeof() -- This isn't really a function

    >
    > Not a function at all, nothing "not really" about it. It's an operator.
    >
    >> but try this sometime, to
    >> illustrate several fundamental C/C++ flaws -- or perhaps features, if one
    >> prefers:

    >
    >> #include

    >
    > C, not C++. In C++, use


    True.

    >
    >> static char hello1[] = "Hello world! This is a test!\n";
    >> static extern char * hello2 = "Hello world! This is a test!\n";
    >>
    >> static void call2(char * n1, char * n2) {
    >> printf("%d %d\n", sizeof(n1), sizeof(n2)); printf("%d %d\n",
    >> sizeof(*n1), sizeof(*n2));

    >
    > Ick. %d and sizeof? No. sizeof returns an unsigned integer value. In
    > C99, there's actually a format specifier for this, in C90 there isn't, so
    > canonical is to cast to unsigned long and use %lu. However, that aside...


    Well, I can certainly replace it with %u if you like. :-)

    >> }
    >>
    >> int main(void)
    >> {
    >> printf("%d %d\n", sizeof(hello1), sizeof(hello2)); printf("%d
    >> %d\n", sizeof(*hello1), sizeof(*hello2));
    >> call2(hello1, hello2);
    >> return 0;
    >> }
    >>
    >> The printout of this program is
    >>
    >> 31 4

    >
    > 31 - size of hello1, which is an array.
    >
    > 4 - size of hello2, which is a pointer.


    Of course.

    >
    >> 1 1

    >
    > 1, which is *hello1, which is a char, hence size 1.
    >
    > And again, for *hello2.
    >
    > (calls call2 function)
    >
    >> 4 4

    >
    > 4, the size of parameter n1, which is a pointer.
    > And again, for parameter n2.
    >
    >> 1 1

    >
    > And one for *n1, which is a char
    > And again for *n2, which is a char.
    >
    > Which is exactly as we expect.
    >
    >> which is not really what it should be but never mind; sizeof(char *) is
    >> 4 on my system (some might have 8 if they're 64-bit) so it's what one
    >> should expect in C/C++.

    >
    > No, it is what one expects for certain implementations.


    Well, the reason is why it shouldn't be what it is returning is mostly
    because the third line should arguably be 31 4, with the compiler
    issuing a diagnostic about a type mismatch. However, there's little
    hope (or real need) to fixing it at this very late date.

    >
    >> Pascal makes a careful distinction between ^char
    >> and ^array[1..10] of char, but C is a little sloppy -- which makes for
    >> easier coding in spots but can be dangerous.

    >
    > C isn't sloppy at all:
    >
    > char array[100];
    >
    > This is an array. Period. No discussion or debate. However, the
    > _symbol_ "array", in a pointer context, decays to a pointer value.
    >
    > That is, if you pass array to a function, for example, where the function
    > expects a pointer, you get... a pointer. Contrast that to sizeof(), which
    > does not expect a pointer, isn't operating in a pointer context - array is
    > treated _as_ an array. Hence the evaluation as 31 with sizeof in main,
    > but as 4 in the function, where array has been passed as a pointer.


    OK. So how does a function determine whether *++p is a valid operation,
    if p is passed in?

    [1] Punt!
    [2] A hidden parameter is added to indicate the bounds of the pointer.

    C/C++ takes the first route, Pascal the second.

    --
    #191, ewill3@earthlink.net
    Q: "Why is my computer doing that?"
    A: "Don't do that and you'll be fine."

    --
    Posted via a free Usenet account from http://www.teranews.com


  20. Re: Windows is Easier

    Tim Smith wrote:

    > I suspect that Linonut is not heeding Brian Kernighan's advice:
    >
    > Debugging is twice as hard as writing the code in the first place.
    > Therefore, if you write the code as cleverly as possible, you are,
    > by definition, not smart enough to debug it.


    I prefer "elegant and readable" to clever. It makes debugging and
    maintaining a breeze.

    > Perl has many ways to be very clever indeed. *But there is no
    > requirement that you have to be overly clever, cute, or arcane.


    I'd suggest never being cute using perl. You'll just end up with
    unmaintainable scripts.

    > The same can be said for C++. *You can go insane, say, with templates.
    > Hell, the C++ template system is Turing-complete, which means you could
    > actually make the compiler do all your computing for you at compile
    > time, with sufficiently arcane templates! *See this example:
    >
    >
    >
    > (And hey, according to Peter Kohlman, the guy who did that must be a
    > moron, as he is a Mac user. *Imagine what someone smart could do!).
    >
    > But you aren't required to actually do things like that. *You can take a
    > C++ compiler, and just use it as a slightly souped up C. *Just use the
    > std::string class, constructors and destructors in your structs, and
    > maybe the STL. *Limit yourself to that, and you'll have no more
    > difficulty than with C, but be much more productive.


    Ewww... the STL... I always end up bogged down with it. I really prefer C.

    --
    Regards,

    Gregory.
    Gentoo Linux - Penguin Power

+ Reply to Thread
Page 3 of 4 FirstFirst 1 2 3 4 LastLast