Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

KISS or KILL?

 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two styles in programming. One is to take a complex problem and to offer a solution so simple, so the outer observer is astounded and cannot believe his own eyes: "How did you do that? And this works?"
This is what we call an elegant solution. This is what KISS (Keep It Small and Simple) principle is about.
The opposite approach is to take a simple problem and to solve it with such enormous efforts, so the outer observer is equally astounded and cannot believe his own eyes again: "How did you do that? And all this @#^& works?" Every time I download next 40 or so MB, I am thinking what an enormously wise piece of software it must be
There was no principle for such programming style - until today. Today it was discovered it got a name: KILL principle. I would spell it as Keep it Long and Laborious, but there may be better variants
Interesting, that when I started me programming career, there were mostly KISS programs around, and now... :roll: All our XML forum is one big collection of exceptions which DOM/SAX based, sophisticated, OO oriented, multi-layered XML processing architecture spits out of its mysterious depth...
(Added April 26, 2002. And if you do not trust me, look at today's post in XML forum: XALAN error and SAX problem :roll: )
[ April 26, 2002: Message edited by: Mapraputa Is ]
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, you got a good point. I am not a guru in programming. But I do think programming today goes to KILL. When we design the system, we have to consider what's going to happen in the future, and keep potential changes minimum. That's why we use so much effort to do shema design, exceptions handling, etc.
 
Ranch Hand
Posts: 4702
9
Scala Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
map,
i think it is simpler than that. programmers are judged on lines of code it seems. therefore if you can do it in more lines of code than someone else in the same amount of time, you are more productive than they are. stupid i know but i believe it is at least one reason why programs are so big now.
[ April 26, 2002: Message edited by: Randall Twede ]
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dilbert covers the many ideas used to judge programmer productivity. My favorite is when the pointy haired boss says that from now on everyone is going to be judged by the number of bugs they fix. Wally then tells Dilbert, "I'm going to write me a new mini-van!"
 
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMHO, XML(postmature infant) and related technologies are out of control.I have seen quite a lot Web Services demo, code, and etc. And each time I couldn't stop asking myself : Why K.I.L.L ?
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
isn't KISS - keep it simple, stupid?
[ April 26, 2002: Message edited by: Jamie Robertson ]
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by ersin eser:
IMHO, XML(postmature infant) and related technologies are out of control.I have seen quite a lot Web Services demo, code, and etc. And each time I couldn't stop asking myself : Why K.I.L.L ?


Absolutely! Here is my favorite example which I borrowed from Bill Brogden post. This is SOAP, format, Web-services will supposedly be built on:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/1999/XMLSchema">;
<SOAP-ENV:Body>
<ns1:myBirthdayResponse xmlns:ns1="urn:Exercise" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">;
<return xsi:type="xsd:date">1939-10-17</return>
</ns1:myBirthdayResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Useful data here are "1939-10-17" - 10 bytes out of 445. :roll:
You will never convince me that 4000% overhead is justified!
[ April 26, 2002: Message edited by: Mapraputa Is ]
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found that VB 6 programs are all Kill. We have fired a couple of them because they try to build the Taj Mahal.
I have also been wondering this great need to write a text file? (XML, SOAP, etc) I mean that was what we did back in the 70s.
It seems like overkill to me, but I also see some of the benefits.
My Kill on this is that it makes you learn so many different technologies, that you can never be an expert in just one anymore. And you never stop reading and reading and reading. Kind of like my post, non-stop reading.
Oh I have to add one other thing here. This has been the biggest pet peeve I have had with posters in the SCJD forum, not that they are bad people, I liked every one of them. But they really want to go overboard and add the kitchen sink, and I keep trying to tell them that they only need to keep it very simple. The Kitchen Sink won't get them more points.
Mark
[ April 26, 2002: Message edited by: Mark Spritzler ]
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Jamie Robertson:
isn't KISS - keep it simple, stupid?


This must be a male version. "Keep It Small and Simple" sounds more polite, so this must be a female version. Also, I found that males generally are uncomfortable with the value of "smallness", for them "bigger" is almost always "better".
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LoL
 
High Plains Drifter
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I like Map agreeing with me in this broad context. Makes me feel funny.
When software around one premise ('web services') explodes in so many directions at once, to me it's a clear sign that a) no one out there really knows what they want from all this, and b) the drive to innovate far outstrips the need to innovate.
Among my favorite technologies to rail against is XML, of course. But while bloat of it is an obnoxious thing, the idea of hitting all targets with one arrow is worse. I generally avoid IDE's for the same reason. Do it really take 60 MB of code to help write and debug my code more efficiently? Or aren't we really trying to find ways to avoid knowing stuff through templates and pre-built macros?
 
Randall Twede
Ranch Hand
Posts: 4702
9
Scala Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mark,
maybe thats why my vb teacher marks us down if we add anything not asked for :roll:
well its actually cis class
map,
i have always seen it spelled out keep it simple, stupid. i like your version too though....same meaning
[ April 27, 2002: Message edited by: Randall Twede ]
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright enough of this XML bashing. It's time I stood up for XML and put up the good argument.
OK here is goes.
Mark
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Michael Ernest:
Do it really take 60 MB of code to help write and debug my code more efficiently? Or aren't we really trying to find ways to avoid knowing stuff through templates and pre-built macros?

Or maybe typing menu.add(menuitem56) doesn't give the same thrill that menu.add(menuitem1) did. I also find that debugging is a lot easier with an IDE. I don't find that the IDE is doing things for me that I don't know how to do. I find that the IDE does things for me that I don't want to do.
 
Ranch Hand
Posts: 2373
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then map, should i say I wanna KISS
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mark Spritzler:
Alright enough of this XML bashing. It's time I stood up for XML and put up the good argument.
OK here is goes.
Mark


I'm sorry but my parser didn't except that argument
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, well I forgot to add the link to the XSL Stylesheet, or was that XSL:FO. What do you want today? HTML or PDF?
Mark
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PDF with XSL-FO, Mark
 
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. High School/Jr.High

10 PRINT "HELLO WORLD"
20 END




2. First year in College

program Hello(input, output)
begin
writeln('Hello World')
end.




3. Senior year in College

(defun hello
(print
(cons 'Hello (list 'World))))




4. New professional

< #include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;

for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("
");
}




5. Seasoned professional

#include <iostream.h>
#include <string.h>

class string
{
private:
int size;
char *ptr;

public:
string() : size(0), ptr(new char('')) {}

string(const string &s) : size(s.size)
{
ptr = new char[size + 1];
strcpy(ptr, s.ptr);
}

~string()
{
delete [] ptr;
}

friend ostream &operator <<(ostream &, const string &);
string &operator=(const char *);
};

ostream &operator<<(ostream &stream, const string &s)
{
return(stream << s.ptr);
}

string &string: perator=(const char *chrs)
{
if (this != &chrs)
{
delete [] ptr;
size = strlen(chrs);
ptr = new char[size + 1];
strcpy(ptr, chrs);
}
return(*this);
}

int main()
{
string str;

str = "Hello World";
cout << str << endl;
return(0);
}




6. Master Programmer

[
uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");

// bring in my interfaces
#include "pshlo.idl"

[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
]
cotype THello
{
interface IHello;
interface IPersistFile;
};
};



[
exe,
uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
]
module CHelloLib
{

// some code related header files
importheader(<windows.h>);
importheader(<ole2.h>);
importheader(<except.hxx>);
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");

// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");

[
uuid(2573F891-CFEE-101A-9A9F-00AA00342820),>

#include "ipfix.hxx"

extern HANDLE hEvent;

class CHello : public CHelloBase
{
public:
IPFIX(CLSID_CHello);

CHello(IUnknown *pUnk);
~CHello();

HRESULT __stdcall PrintSz(LPWSTR pwszString);

aggregatable
]
coclass CHello
{
cotype THello;
};
};
private:
static int cObjRef;
};



#include <windows.h>
#include <ole2.h>
#include <stdio.h>
#include <stdlib.h>
#include "thlo.h"
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"

int CHello::cObjRef = 0;

CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
{
cObjRef++;
return;
}

HRESULT __stdcall CHello: rintSz(LPWSTR pwszString)
{
printf("%ws
", pwszString);
return(ResultFromScode(S_OK));
}



CHello::~CHello(void)
{

// when the object count goes to zero, stop the server
cObjRef--;
if( cObjRef == 0 )
PulseEvent(hEvent);

return;
}

#include <windows.h>
#include <ole2.h>
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"

HANDLE hEvent;

int _cdecl main(
int argc,
char * argv[]
) {
ULONG ulRef;
DWORD dwRegistration;
CHelloCF *pCF = new CHelloCF();
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);

// Initialize the OLE libraries
CoInitializeEx(NULL, COINIT_MULTITHREADED);

CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE, &dwRegistration);

// wait on an event to stop
WaitForSingleObject(hEvent, INFINITE);

// revoke and release the class object
CoRevokeClassObject(dwRegistration);
ulRef = pCF->Release();

// Tell OLE we are going away.
CoUninitialize();

return(0); }



extern CLSID CLSID_CHello;
extern UUID LIBID_CHelloLib;

CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
0x2573F891,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};

UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{ 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
};

#include <windows.h>
#include <ole2.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "pshlo.h"
#include "shlo.hxx"
#include "clsid.h"

int _cdecl main(
int argc,
char * argv[]
) {
HRESULT hRslt;
IHello *pHello;
ULONG ulCnt;
IMoniker * pmk;
WCHAR wcsT[_MAX_PATH];
WCHAR wcsPath[2 * _MAX_PATH];

// get object path
wcsPath[0] = '';
wcsT[0] = '';
if( argc > 1) {
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
else {
fprintf(stderr, "Object path must be specified
");
return(1);
}

// get print string
if(argc > 2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
else
wcscpy(wcsT, L"Hello World");

printf("Linking to object %ws
", wcsPath);
printf("Text String %ws
", wcsT);

// Initialize the OLE libraries

hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);

if(SUCCEEDED(hRslt)) {



hRslt = CreateFileMoniker(wcsPath, &pmk);
if(SUCCEEDED(hRslt))
hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);

if(SUCCEEDED(hRslt)) {

// print a string out
pHello->PrintSz(wcsT);
Sleep(2000);
ulCnt = pHello->Release();
}
else
printf("Failure to connect, status: %lx", hRslt);

// Tell OLE we are going away.
CoUninitialize();
}

return(0);
}




7. Apprentice Hacker

#!/usr/local/bin/perl
$msg="Hello, world.
";
if ($#ARGV >= 0) {
while(defined($arg=shift(@ARGV))) {
$outfilename = $arg;
open(FILE, ">" . $outfilename) || die "Can't write $arg: $!
";
print (FILE $msg);
close(FILE) || die "Can't close $arg: $!
";
}
} else {
print ($msg);
}
1;




8. Experienced Hacker

#include <stdio.h>
#define S "Hello, World
"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}




9. Seasoned Hacker

% cc -o a.out ~/src/misc/hw/hw.c
% a.out




10. Guru Hacker

% cat
Hello, world.
^D




11. New Manager

10 PRINT "HELLO WORLD"
20 END



12. Middle Manager

mail -s "Hello, world." bob@b12
Bob, could you please write me a program that prints "Hello,
world."?
I need it by tomorrow.
^D




13. Senior Manager

% zmail jim
I need a "Hello, world." program by this afternoon.




14. Chief Executive

% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

There are two styles in programming. One is to take a complex problem and to offer a solution so simple, so the outer observer is astounded and cannot believe his own eyes: "How did you do that? And this works?"


Good thread, you'd be amazed at how many people are doing KILL out there, (and they wonder why companies are burnt out on spending money on IT).
 
Forget Steve. Look at this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!