Hello everyone!

I've started a project on SF.net to create a small yet modern IRC client (µIRChat or simply µIRC). However, there one thing that I really can't decide before I start, and that is the language to use. My idea came from µTorrent, which is, as far as I know, written in C with custom libraries. Now, I don't want my client to be extremely small, but definitely under 1 MB.

I don't want any flaming, and such, or arguing about the general "C vs. C++" question, I want the discussion to be related to my requirements, please. Thank you!

So here are my thoughts:

C

  • C code is generally small and fast, although it may not have excellent readability.
  • In C I'll have to do pretty much everything myself, but this isn't a big problem.
  • I can bundle the soruce with Tiny C Compiler and have everything needed to get my program up and running from source in a simple package.
  • C tells me to go straight to the point, but the code might end up spaghetti-like, which is really bad, but with careful design it can be avoided.

C++

  • C++ is more OO and provides many more features.
  • I can use namespaces to structure everything cleanly without having name collisions.
  • Classes will help abstract all the platform-specific code in a nice black box.
  • The STL is extensive, but I'm pretty sure I won't use it because of the size requirements.
  • Overall C++ allows me to do the same thing with cleaner and more readable code.

Now you can pretty much see that I'm stuck. I need you help to pick one for my needs. Remember, it needs to be small, not necessarily fast (speed is a nice bonus too, but not a requirement). Portability will be achieved by the design of the application.

Thanks for helping!

Sincerely,
Mircea Chirea
µIRC Project Admin

>I want the discussion to be related to my requirements, please.
You didn't specify any requirements that can't be achieved with either language. Pick the one you're most comfortable with.

I'm perfectly comfortable with both, this isn't a problem at all.

How many different operating systems do you plan to support?
Is it a console only thing, or does it include a GUI?
If it's a GUI, are you going "native" on all the platforms, or using a portable toolkit such as wxWidgets.

What's so special about 1MB?
Also, is that the size of the source code distribution, or the executable.

IMO, the first challenge is going to be getting the thing to work "at all". Adjectives such as "smaller" and "faster" can only be done when you've got past "working".

I've no idea why you would mention "Tiny C". Why not bundle an OS as well while you're at it.
Everyone else seems to manage just fine with "this assumes you have GCC installed"

There seem to be a lot more "but's" in your C arguments, which leads me to suspect you've already chosen C++, but looking for someone else to reassure you that C++ is a good choice.
Yes, C++ is a good choice!

How many different operating systems do you plan to support?

Mainly, Windows and GNU/Linux are the priority, others can wait.

Is it a console only thing, or does it include a GUI?

It will be a GUI-only application (well maybe with console being used only for debugging).

If it's a GUI, are you going "native" on all the platforms, or using a portable toolkit such as wxWidgets.

I'm pretty sure I'll go fully native on all platforms, at least until FLTK 2 is actually finished.

What's so special about 1MB?

There are a LOT of IRC clients out there that it wouldn't make sense to write yet another one, but same as was done with µTorrent, I want to write this to be small and light on the system, thus being unique, at at least mostly unique. I'm not a big fan of overly big applications just to get a a few milliseconds in speed.

Also, is that the size of the source code distribution, or the executable.

The executable.

IMO, the first challenge is going to be getting the thing to work "at all". Adjectives such as "smaller" and "faster" can only be done when you've got past "working".

Yes, but what if I get it working and then realize that there's no way to make it small as originally intended? Better have everything planned then go to work.

I've no idea why you would mention "Tiny C". Why not bundle an OS as well while you're at it. Everyone else seems to manage just fine with "this assumes you have GCC installed".

Meh I didn't really know what to add for C :D

There seem to be a lot more "but's" in your C arguments, which leads me to suspect you've already chosen C++, but looking for someone else to reassure you that C++ is a good choice. Yes, C++ is a good choice!

Yes, I'm leaning a lot to C++ as it solves many problems with C.

Making the executable small can be surprisingly easier than you think, make sure all your resources are fairly small, keep the code short and simple, and you can even download an executable compressor, which can make huge differences to the size. I use this one, it has never failed me :) Its free and doesn't even require installation. LINK

Making the executable small can be surprisingly easier than you think, make sure all your resources are fairly small, keep the code short and simple, and you can even download an executable compressor, which can make huge differences to the size. I use this one, it has never failed me :) Its free and doesn't even require installation. LINK

Yea, I could get a nice plug-in interface and have all the advanced features as optional plug-ins and shaving some good size off for more important things. About the compressor, I think I'm going to use UPX just like µTorrent, I've used it before and it's pretty good, but I don't want to totally rely on it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.