IRC Client : Where to begin

Heiko Wundram heikowu at ceosg.de
Wed Aug 22 19:43:03 EDT 2001


On Wednesday 22 August 2001 23:16, you wrote:
> [lots of tiny little (unimportant) development remarks removed]

Dear Relfx,

it is true, or does it only appear to me, that you have never programmed 
seriously (better: larger projects) in Python (or in any other language) 
before? (Your question whether it is better to partition a project into 
separate files or not)

Nor had any contact with the basic layer of TCP/IP communication (which the 
module asynchat adresses)? (Your question of where to begin with all the 
documentation that was offered)

Nor had any contact with the low layer of the IRC protocol (not that what 
mIRC offers you)? (You asked it directly)

Nor had any contact with a different OS than Windows 98-2000? (Your question 
concerning GUI vs. Non-GUI; Windows is actually always GUI, except for 
DOS-mode, which dropped out in 2000 anyway)

Sorry to have to say it that way, but you're missing on all the important 
programming principles that are the basis when trying to write a program that 
serves as a client for the Internet Relay Chat Network. <wink>

I guess that you want to start to learn programming Python, but why not try 
something smaller (and different) for a start?

What I'll try to do here is layout something I did when I started programming 
back in the 80's. (I was in primary school back then)

I had started programming an external interface I got for running my 
model-train, but I never knew what I did, I just had a big hunk of 
documentation that was with the interface and I always kept typing in 
commands they listed (used GWBasic back then).

<--- Ad 1-4: That's the situation you are facing now. People sent you lots of 
documentation info that you actually don't know how to use because you don't 
know about the basics. --->

Well, I wasn't too satisfied with that, I wanted to do something on my own. 
But as I didn't know what all those commands were doing, I realized that I 
would first have to walk my way up the ladder with something different.

I chose something that I thought would be handy in school, a little program 
that would ask me maths-questions like (200/40?) and would wait for an input 
and then compare that to the true result. If it matched, it would say 'OK!', 
otherwise it would beep and say 'Wrong...'.

Well those were (I think, I wouldn't be able to reproduce them today 
anyways... ;)) 10-20 lines of Code in GWBasic, but I knew exactly what they 
were doing.

Some days later I expanded the whole thing. I added a loop that would ask a 
question at least three times before giving up with 'Wrong...', some days 
later again I expanded the whole thing with a scoring system based on the 
time it took to answer, some days later again I expanded the whole thing with 
a system that would only give you a certain amount of time to answer a 
question, etc. etc. etc.

Then in '88 I got MS QuickBasic 4.5. I ported the whole thing (yep, Basic was 
incompatible with Basic), and tried to add some fancier text-mode graphics 
such as a text-mode banner which could only be viewed well when I put my PC 
on slow mode (I had an 80386 SX-16 back then, man was that fast ;))

When in '91 I got access to Turbo C++ 3.0 (a different programming language), 
I ported the whole thing to C++. And in time I added support for TurboVision, 
that was a text-based GUI-Interface they were shipping along. And I added 
DOS-mode sound support using direct writes to the SoundBlaster (yes, direct 
hardware programming was still in back then)

Then in '94 I got access to MS C++ 6.0 (I think it was...). And thats when I 
did my first step towards GUI-programming, still using the old Windows 
<yuckyucky> API. I didn't come far here, btw. It actually stagnated my 
programming for three years... ;)

And when in '97 I got access to MS Visual C++ 5.0 (yet a different 
programming language), I ported the whole thing and again added support for a 
GUI based on the MFC. And I added support for TTS and Voice-Control of the 
program using the stuff that they shipped with MS Visual C++ 5.0 Enterprise.

And also in '97 I started with Tcl (and esp. Linux), to which I ported the 
whole thing again (of course without all the fancy features of TTS, etc.)

... blablabla

I could continue now, but I think you get the point. Start off small (to 
learn the basics), and then always keep adding things on top. You have to 
start this way bottom up, only a true genius will succeed top down.

Why not take a small project that might come in handy for you in daily life 
(you choose one), then go and buy a good book on Python, and then learn 
Python and especially good programming practice step by step by implementing 
something like I did above?

Please, please, please, take my advice seriously!

Don't let yourself be disencouraged (and I know its a stony road), but please 
start from bottom up! For one you have an actual feeling of success when you 
have built a small project, and secondly you feel even more success when you 
manage to add a feature to the project.

On another note: I really don't understand why you still keep asking people 
in this newsgroup/mailinglist for help, as noone has so far offered help 
besides giving you references to documentation, but which you yourself say 
don't (yet) mean much to you. I'm also going to give you documentation at the 
end, but this documentation is not about anything concerning your IRC-client 
project, but rather something general about programming and Python.

And on a third note: I guess people here actually aren't all that fancied by 
the idea of having an IRC-client that is scriptable through Python (or 
written in Python). It sounds hard, but that's Usenet. People will only get 
annoyed when you continue "bugging" them in this fashion. Believe me, I've 
had this experience more than once, and it's absolutely no fun to be on 
thetarget list of a mail-loop. <wink> ;)

Don't flame me for this message; in my eyes this had to be said. And Relfx 
don't let my words discourage you, Python is a way cool programming language 
which is easy to learn, and fun to discover. (btw. I'm new to Python too, 
started looking into it about 3 Months ago after I felt angry with Perl once 
too often... ;))

And if anyone is interested, the little program that I still try to write in 
every language I move to is called "KOPF". ("Kopfrechnen" means calculating 
in your head in German... ;))

-- 
Yours sincerely,

	Heiko Wundram
	Head and founding-member of the "Celler Open Source Gemeinde"
		(Celle Open Source Community)




More information about the Python-list mailing list