Re: detab utility challenge.



On Aug 11, 10:28 am, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
spinoza1111 <spinoza1...@xxxxxxxxx> writes:

<snip>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

<snip bad example>

You know this is off-topic here, yes?  To find out what is wrong with
your C# post, post it to a C# group.

You get creepier and nastier every year, Benny Boy. My point, which is
very germane to C because it exposes how bad C is, is that the
specifications Malcolm posted are easily met in a modern platform, and
not met by C...evidence being the pre-existing discussion.

Here are Malcolm's specifications:

The specification is simple, write a utility that converts tabs to spaces in
a text file. It needs to either replace tabs with a set number of spaces or,
more commonly, take a list of tab stops. Calling syntax is up to you but
must be easy for the user to use.

This should be bread and butter work.

The code must depend on the standard library only, be portable to any
conforming implementation, and never crash or show undefined behaviour on
any user input.

My solution uses the .Net libraries. For this reason it is most
probably portable, although I have not tested it in mono or something
like that.

The purpose of .Net and Java is to avoid having "bread and butter"
programs crash on any user input, so about the only thing I needed to
do, which I did, was to check the arguments of this command line
program. Whereas C programs written for "bread and butter"
applications crash frequently because of the need for constant
reinvention of the wheel.

So, Benny Boy, if you want to participate in this thread, learn C
Sharp and use your analytic skills, which I have acknowledged, but
which, as I have said before, are unmatched by collegiality, common
sense, or any ability to see the big picture.

I'm real tired of posters who have to say "that's off-topic" when they
are not MAN enough to say "I don't understand it".

Sure, if Malcolm was going to give a prize, mine would be ineligible
for whatever he had in mind, such as a bunny or a cookie. But in a
strict sense, the problem CANNOT BE SOLVED in C because C produces
inchoate texts which are easily transformed into garbage while they
retain what Shakespeare would call "the name and title of a king", or
a C program. This transformation is NOT POSSIBLE in C Sharp or in
Java, which is why application programmers should either consent to
leave the field of programming, or use these languages.


--
Ben.

.



Relevant Pages

  • Re: Six degrees of separation
    ... John Hall ... "I don't even butter my bread; ...
    (rec.sport.cricket)
  • Re: String Formatting
    ... bread, butter, milk ...
    (comp.lang.python)
  • Re: (part 33) Han from China answers your C questions
    ... than a crash on the grounds that you can detect incorrect results. ... I don't want my program to produce incorrect results. ... If I left it in the production code, ...
    (comp.lang.c)
  • Re: Test
    ... example, is put on bread. ... Raw Minced Meat? ... I don't think I've ever had thick pieces of cooked ham. ...
    (rec.games.computer.ultima.dragons)
  • Re: Atkins news link
    ... I will try the cholesterol-reducing kind, ... >And Butter? ... I also have been trying to avoid it for years, ...
    (alt.support.diabetes)