Ayende @ Rahien

Unnatural acts on source code

Things you should never do

That should be pretty high in the list, I think:

image

image

Comments

James Curran
07/06/2008 02:02 AM by
James Curran

Wow.... There's a whole bunch of things not to do there.

There's the obvious infinite loop to launching programs.

Then there's hard-coding a complex relative path,

and hard-coding a reference to a (debug) developement folder.

Sung
07/06/2008 02:24 AM by
Sung

I didn't notice right away why you should "never" do such a thing until i read James' comment.

Would you please be more specific in your post?

Please "Don't Make Me Think" (borrowed from a book-title) ;)

By the way, I can only "assume" that one should not write such code because it will create an infinite loop. But are there any reason that you think why nobody should write such a code?

Ayende Rahien
07/06/2008 03:13 AM by
Ayende Rahien

Actually, the recursive was what I referred

The hard coding is fine, those are test programs.

Ayende Rahien
07/06/2008 03:55 AM by
Ayende Rahien

Sung,

I am posting posts that should make you think.

At the very least, they should spark some conversation.

The main issue is that this will create more and more processes.

The problem with that is that there is no easy way to stop them. At worst, this can make the OS unresponsive and require a forced shutdown to fix

[ICR]
07/06/2008 11:56 AM by
[ICR]

That's assuming of course that duplication is allowed. It could be modified to only allow once instance of each to be running.

Florin
07/06/2008 12:47 PM by
Florin

Did you try to run at least one of them?...

Thomas Eyde
07/06/2008 05:07 PM by
Thomas Eyde

Isn't a Server starting its Client something like a tail wagging the dog?

Martin Murphy
07/07/2008 04:40 AM by
Martin Murphy

You can set multiple startup projects in VS if this is how you are testing

Ayende Rahien
07/07/2008 04:44 AM by
Ayende Rahien

Martin,

I didn't know that, how?

Shane Bush
07/07/2008 07:11 AM by
Shane Bush

Multiple Startup projects:

http://msdn.microsoft.com/en-us/library/ms165413.aspx

James Curran
07/07/2008 02:24 PM by
James Curran

@[ICR]

Running the same app multiple times isn't all of the problem. Even if each app merely started-up, launched the other program, and died, you'd still have a tremendous strain on the system, even though at any given time, only one instance of each program is in memory. (And stopping the cycle would probably require rebooting).

Will Shaver
07/07/2008 04:08 PM by
Will Shaver

Thanks for the good laugh this morning.

Comments have been closed on this topic.