4 ms·
You are making the system more complicated for everyone because of features that only a few users know about. This is how code bloat starts its life cycle. If
by coliveira 15y ago
You are making the system more complicated for everyone because of features that only a few users know about. This is how code bloat starts its life cycle.
If you need more features from a basic utility like echo or cat you should create your own version, maybe with a slightly different name, and leave the original as it is.
- Duff 15y agoThat's exactly what happened. Those crazy kids at Berkeley cooked up BSD, which was written to meet their needs and subsequently forked into a few variants. The GNU people made a GNU collection of core utilities that met their particular needs and desires. The Unix nerds at my University felt as you did, and ran a Unix System 5 variant into the late 90's.
- Confusion 15y agoYou are making the system more complicated for everyone because of a program that only a few users know about. That is how code bloat starts its life cycle. If you need a basic utility like echo or cat, you should create your own version and don't bother others with it.
- xilun0 15y agoNot a very good strategy to avoid bloat... Not even mentioning you will end up with 100 times the number of tools you have now. I would not call such a system more simple, indeed it would be inferior on all possible points. In a real system, even basic utilities rarely looks like a CS101 homework result. This is perfectly fine, especially in this case the amount of feature in gnu echo is perfectly reasonable, and the size of the executable will likely depends on various header than code size when the code is so small anyway.
- bdonlan 15y ago/bin/echo on debian sid (x86): 13 .text 000028dc 08048b90 08048b90 00000b90 24 CONTENTS, ALLOC, LOAD, READONLY, CODE /bin/cat on debian sid (x86): 13 .text 0000775c 080491b0 080491b0 000011b0 24 CONTENTS, ALLOC, LOAD, READONLY, CODE That's 12kb and 32kb, respectively. It may have been a lot back in the day, but it's plenty small enough on today's systems.
- dkarl 15y agoAnyone can find those features in the man page. I guarantee that the number of people who use those features is much larger than the number of people who read the source before today. The UNIX style promoted in the "cat -v Considered Harmful" paper may have made sense at one time, but it doesn't make sense anymore. For example: It seems that UNIX has become the victim of cancerous growth at the hands of organizations such as UCB. 4.2BSD is an order of magnitude larger than Version 5, but, Pike claims, not ten times better. This logic gives the same consideration to people who are digging in the source code for these utilities as to people who actually use them. When you consider the relative numbers, that's a very elitist attitude (for some value of "elite"). Also consider the explanation given in another comment for why "cat -n" is unnecessary: If you want to number a file's lines, 'echo ,n | ed file | sed 1d' or 'awk ''{ print NR " " $0 }''' will do just fine. Munging text like that is a pretty common skill for Unix users, but by no means universal. If the man page for cat is pretty simple and readable, and the feature doesn't bloat the code to the point of causing maintenance problems, and there's somebody who's willing to write the code, then enabling "cat -n" a win for users.