[OT] Sharp Regrets: Top 10 Worst C# Features

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 23 19:58:05 PDT 2015


On Sat, Aug 22, 2015 at 10:25:11PM -0700, Walter Bright via Digitalmars-d wrote:
> On 8/22/2015 8:32 PM, H. S. Teoh via Digitalmars-d wrote:
> >	People who are more than casually interested in computers should
> >	have at least some idea of what the underlying hardware is like.
> >	Otherwise the programs they write will be pretty weird.
> >	-- D. Knuth
> 
> A good friend of mine in college decided to learn Fortran, having
> never programmed before. Being a practical sort, he got a copy of the
> Fortran-10 reference manual, read it, and wrote a program. Being an
> amazingly smart man, his program worked.
> 
> But it ran awfully slowly. He was quite mystified, and finally asked
> for help from someone who knew Fortran. It was quickly discovered that
> the program wrote a file by opening the file, appending a character,
> then closing the file, for each byte in the file. (You can imagine how
> slow that is!)
> 
> My friend defended himself with the fact that the Fortran reference
> manual made no mention about how to do file I/O for performance -
> knowledge of this sort of thing was just assumed. He was quite right.

Reminds me of my first job where somebody wrote a report generation
script in bash, using awk, grep, cut, etc., to extract fields from the
input file. It worked, but was painfully slow on large input files.
Once, my manager ran it on a particularly large input file, and after 2
*days* it was still running.

I rewrote the script in Perl, and it finished in less than 2 minutes.
:-P

(Had I known D in those days, I might've been able to write a D program
that finished in 2 seconds. Perhaps. :-P)


T

-- 
"I suspect the best way to deal with procrastination is to put off the procrastination itself until later. I've been meaning to try this, but haven't gotten around to it yet. " -- swr


More information about the Digitalmars-d mailing list