• Civilization 7 has been announced. For more info please check the forum here .

Important advice for programmers! Please read!!!

Aya, you show a stunning knowledge, even superior than mine. To say one, I knew of Intercal, but i had never heard of Befunge and Unlambda... i did also a google search, just to be sure :D (yes, they exist). I found them and some other "psychotic languages", like the Brainf*ck described by Sabrewolf. There is also a language called False:
See http://wouter.fov120.com/false/ for real fun!

You have taken my points and explained them deeply and clearly, far better than i was able to do (although you have an advantage: you're born english...). I hope these arguments will finally reach some recalcitrant ears... at least, some system-happy, registry-happy programmers are now aware that their programs may have significant side-effects and the final user may not like them (for valid reasons).

Another thing to say about the registry: i'm not sure of Windoze2K/XP, but in Windoze98 the registry is loaded into RAM at the start and there it stays until the PC is rebooted. Thus, a hogged registry may permanently hinder the performance of the PC, which must deal with less ram, although a PC with 512MB ram or more will hardly notice the difference.

About that:
aya said:
...
Suit programmer: Hmm. Just finished this new program that corrupts all your system files so that you have to reinstall Windows. I'm gonna call it "The .NET Framework (tm)"....
...
the best way i can comment it is: :lol: :lol: :lol: :thumbsup:
[off topic]
I love british humour - probably you know very well The Register and The Inquirer, they are my favorite IT magazines. They mock their targets with an unique style. When they bash at MPAA/RIAA, M$, British Telecom and others, they do not simply bash at them; at the end of the article the reader is left with the opinion that they are complete asses...
[/off topic]
But even in an humorous tone, you've said an important thing. The registry is like a big, big ini file shared by everyone. This alone should be a good reason not to hog it up unnecessary. Respect the others! ;)

And about registry-happy-crappy programs, a few advice: stay away of Ulead DVD video editing/player suite. First, it has an annoying quasi-viral behaviour. You click the 'x' willing to close everything immediately and other windows appear instead - it remind me of that old game made as an exercise by a bloke at the university: are you sure you want to exit the game? (y/n) - you click 'y', then: no, you can't exit the game. :lol:
But second, and more important, it poops hundreds (if not thousands!) of keys in the registry! Yeah, they are so much that at some point i got bored to count them... and poops an incredibly number of "shared dlls" in the common files folder, and they are registered, re-registered, re-re-registered - i don't know why, but you find their path in those ununderstandable class ids once, twice, thrice...

Another program to stay alert is "mame32" (yeah, the emulator). I don't know if in the new versions the programmers have got rid of that pesky stuff, but 2 years ago i tried the mame32 and the initial impression was good, albeit i notice some performance drop from the dos version of mame. But then, i found in the registry a key called "Freeware" with almost 3000 subkeys, one for every game rom supported by MAME!!!!! An every one of them had several subkeys... imagine.
The most annoying part was that, if you deleted all that crap, the next time you runned mame32 it rebuilded the whole index from scratch, wasting several minutes only to hog up your registry... if you have that default configuration already memorized in your data files, wtf is the point to copy it in the registry, damnit :cringe:

(Cyber, don't feel ashamed: there are programs around with a far more pesky behaviour than yours, and in some cases we also pay for them!!! :D )

Changing argument...
aya said:
This sound like a great idea to me. I could certainly contribute... an INI file parser. Question is, are the people who wrote BIQ parsers likely to share their source? It'd only take a couple of minutes to set up a project on Sourceforge.
You're the first to reply positively to my suggestion. With the exception of a polite "no, thanks", this idea has apparently fallen upon deaf ears... what language would you use for such a project? I could suggest sun's java, there is the avantage to have a completely cross platform project - yeah, there are enthusiasts who run Civ3 on Linux, me included, albeit now i've switched back to native Windoze98 mode - but using standard C (there is a gcc for Windoze, although i know little about it, what libraries use etc.) may be a viable option too.

About the "holy wars" stuff, i cannot refrain from stating that vi rocks, while emacs SUX horribly.

Finally, a curiosity: how do you perform on Civ3?
 
IbnSina said:
As an old Unix programmer (who has written a few tens of thousands of lines of C++ for M$ out of necessity) I've always been annoyed at the very concept of the registry. I don't want somebody else's software messing with mine, and I don't want my program accidentally to be responsible for disabling someone else's. I prefer to keep away from the registry as much as I can - using it only encourages them.

I can sympathize. Anyone who's tried to develop software on both Unix and Windows will start to notice the fundamental differences between the two systems. Personally, I'd prefer people only used Unix. In my opinion, it provides the more stable environment when running the sort of unstable processes that will occur during the development cycle, although Windows has improved noticeably since the exclusive adoptation by Microsoft of the NT kernel, which was co-written by an OS veteran who worked on the VAX VMS OS (still considered by most as being THE most stable and secure OS still in active use), but Windows does have the advantage of being a good target platform for developers, since it significantly widens the possible userbase capable of running the software.

Back to the registry. I don't really see how it's any less safe and secure than using text files. For most practical purposes, neither provide much in the way of protection from being clobbered by other processes.

IbnSina said:
I'd like to add my vote for text .ini files. It may be that microsoft has debugged their parsing tools by now, but a few years ago the MFC tools for binary read/writes were terrible. I finally found that if I wanted to save time, I needed to stick with ascii text for my configuration files. On the other hand, that is probably just the old Unix programmer in me talking now...

I've never had the misfortune of feeling the need to use MFC that much. Since I'm a fan of both Windows and Unix, I always try to write cross-platform C++. That way I can use the best debugging and diagnostic tools available on both systems, on the same piece of code.

I too stuck to the use of ASCII files for most things, since Unix doesn't have a Windows-style registry, it's not portable, but I have been meaning to write a cross-platform configuration library, that would use the same API to access the registry on Windows, while defaulting to using plain text config files on Unix, but I haven't felt the need to use the registry as of yet.

sabrewolf said:
i must admit that this is the by far MOST impressive 1st post i have EVER seen! my civ3-home is actually apolyton, but i spend quite some time reading here. but you.... absolutely incredible

Ta. Actually there was a really useful clue there. I've been hunting for the BI{C,X,Q} file format for a while now, and I just found a great post on Apolyton containing exactly what I need. I'm gonna have a play with writing some sort of tool to make mod-writing a bit easier. I found the C3C editor particularly awkward to use, and, although there are some great tools out there, none are quite what I'm after.

This is the sort of thing that bugged me: I was trying to write a new mod using the editor that comes with C3C and as I prefer smaller maps with less civs (large maps take me ages to play). Anyways, I figured I'd delete most of the redundant civs, but every time I tried, after deleting about 6 or 7 of them, the editor would crash. Useful. Futhermore, when I thought about adding a new tech to the tree, I had to not only redesign the tech-tree backdrop graphic, adjust the X/Y coordinates in the editor, then add an entry to another text file for civilopedia text. Grr.

So I'm thinking about some sort of tool to make the process easier. One that can generate the BIQ and any supplementary files automagically. Now, perhaps a tool already exists, in which case I'd appreciate any pointers to that sort of thing, or indeed any other program which makes mod-writing easier.

sabrewolf said:
afaik registries are not only compressed large INI-files (although exports produce that).

Yeah. I tried to keep it simple to emphasize the humor, rather than go into detail. I have a pretty good idea as to how the registry works. It's "compressed" in the sense that the actual files storing the registry data are smaller than they would be if a bunch of text files were used instead.

sabrewolf said:
btw: i found this psycho programming language too called brainfück

Yeah. I was thinking of posting that too, but as a minimalist-syntax language, Unlambda was the most extreme example. Also wasn't sure if I'd get flamed/banned for using "bad language".

Writing a comedy programming language has always been on my "to do" list, but never got around to it.

tR1cKy said:
Aya, you show a stunning knowledge, even superior than mine.

Ta. My original plan was merely to post a rant about DLL files, but it seemed to expand into a historical perspective of software development.

tR1cKy said:
You're the first to reply positively to my suggestion. With the exception of a polite "no, thanks", this idea has apparently fallen upon deaf ears... what language would you use for such a project?

I guess it depends what sort of projects other people have in mind. I'm only just getting into Civ3 hacking, so I'll probably use the same language that the game itself is most likely written in (C[++]). My first task is to generate BIQ files, and from my brief glance at the file format, it looks suspiciously like a bunch of concatenated C structs, so I'll start with that. I already have a pile of library code I wrote ages ago to make things easier (and any programs using it are automatically cross-platform for Windows, Unix and MacOS X). A problem will arise if I decide to do a proper UI for the tool, but being an old Unix hacker, I may leave it as something which parses some textual source file, and generates some other file. I think most people are comfortable with editing text files, and you have to do it for the civilopedia anyway.

tR1cKy said:
I could suggest sun's java, there is the avantage to have a completely cross platform project

I had considered Java, but until I decide on the scope of the project, I'd rather keep it simple. Another reason is that if I spend a year on it, Civ4 will probably be out, and there may no longer be a need for such a tool to exist.

By the sounds of it (XML/Python), Civ4 should be easily moddable. I'm expecting it to come with something like the scenario editor in something like Rise of Nations, only with a proper object-oriented programming language, and (hopefully) a better thought-out API. I've used Python extensively, and it's pretty good.

tR1cKy said:
yeah, there are enthusiasts who run Civ3 on Linux, me included, albeit now i've switched back to native Windoze98 mode - but using standard C (there is a gcc for Windoze, although i know little about it, what libraries use etc.) may be a viable option too.

Didn't know you could get Civ3 for Linux, but I generally only use Linux for running servers and software development.

I'll see what happens. It's quite possible I won't have the time to write the tool I'm currently considering, but I'll be sure to post anything I deem worthy of public scrutiny. Can't ignore a bunch of free beta-testers. :)

tR1cKy said:
About the "holy wars" stuff, i cannot refrain from stating that vi rocks, while emacs SUX horribly.

Agreed. vi has a fairly evil learning-curve, but once you get used to it, you can never go back to notepad.

tR1cKy said:
Finally, a curiosity: how do you perform on Civ3?

Difficult to say. I've never played against real people, and the AI is a bit sucky. I've been trying out quite a few mods that others have written, and consequenly start out on the easier skill settings until I figure out a good strategy.

Thing is that the game is not that different from vanilla Civ1, which took over my life for a while when it first came out. So I had some of the strategy worked out already.

Anyways. That should do. Need to get on with coding...
 
I used to program in Unix in one Computer Science II course. The instructor just assumed we all knew we all programmed in Unix before. CompSci I used Borland C++ for Windows. :)
 
@Aya: Ha! You have two posts. Does that mean we can flame you now? ;)

In any case, I see one significant difference between the registry and the .ini files. If someone messes up your .ini file, then your application is hosed until you fix it. If someone messes up the registry, the entire operating system might be hosed. For a file that is so critical to the well being of the computer, it makes no sense to allow every application off the street to modify it.
 
Just to let you know c3mt v1.11.4 tryes to not put anything but the VB runtimes in the system directory. It's partly OS dependent if it will work, but in most cases it will.
 
Top Bottom