Click here to Skip to main content
15,889,403 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Sith Interviewing Tactics [modified] Pin
ProtoBytes7-Jul-09 15:04
ProtoBytes7-Jul-09 15:04 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes7-Jul-09 15:31
ProtoBytes7-Jul-09 15:31 
GeneralRe: Sith Interviewing Tactics Pin
Vozzie28-Jul-09 0:45
Vozzie28-Jul-09 0:45 
GeneralRe: Sith Interviewing Tactics Pin
Chris Losinger14-Jul-09 12:38
professionalChris Losinger14-Jul-09 12:38 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes14-Jul-09 15:48
ProtoBytes14-Jul-09 15:48 
AnswerRe: Sith Interviewing Tactics [modified] Pin
ProtoBytes15-Jul-09 2:15
ProtoBytes15-Jul-09 2:15 
GeneralRe: Sith Interviewing Tactics Pin
Chris Losinger15-Jul-09 3:08
professionalChris Losinger15-Jul-09 3:08 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes15-Jul-09 3:42
ProtoBytes15-Jul-09 3:42 
Chris Losinger wrote:
so you only get immediate subdirs of the target dir ?


it is the full tree, if target dir = @"c:\"

The call to BaseDir is really unnecessary, if:

var TheDirectory = from dirs in thisDir.GetDirectories("*",SearchOption.AllDirectories)
                   orderby dirs.FullName
                   select dirs;

\\Where thisDir = new DirectoryInfo(@"C:\");
\\This gets the whole tree.  No recursion.


I would decompile the System.IO class but microsoft doesn't really like it when you do that. I will take thier word that the method is not recursive.

If perhaps using the search option, does make the methods recursive (don't really understand MSDN on this) they do not have the same remark for this method using this option. But it would still be possible if you used the base method which states not recursive, then used a lambda to get all the childern. I would guess this is what the search option does.

My point is yes, recursion is a natural for humans and nature. However it's not natural for computers. We simply make computers do the things we think is natural because it describs our domain.

What is natural to humans is not necessarly natural to computers. Thinking like the computer using it's imposed domain, is how 99% of performance enhancments are made.

The interviwer imposed a domain on the problem which introduces the human factor. Adding the human factor to the problem causes bad things to happen. My point to the interviewer was this is not how to do things, esp. if performance is in question. Which performance was a big factor as I was to build a server application. I thought that it was a trick question. I thought the interviewer was testing my knowlege of how to correctly design server software. I didn't want the interviewer to think I was going to do a poor design. The interviewer did give me one thing to aid the problem. I was aloud to use a prototype language of my own design to solve the problem. So I designed a language which did allow for recursive logic, but I place a constraint on the language factored out the real recursion, so the expression of recursion was removed from the compiled code.

It's weird the prototype I designed, looks alot like F#. The prototype predated F#.

The interviewer's last comment to me was that there could be no justification to hire a lead engineer who didn't not understand recursion.
GeneralRe: Sith Interviewing Tactics Pin
Chris Losinger15-Jul-09 3:57
professionalChris Losinger15-Jul-09 3:57 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes15-Jul-09 4:10
ProtoBytes15-Jul-09 4:10 
GeneralRe: Sith Interviewing Tactics Pin
Chris Losinger15-Jul-09 4:49
professionalChris Losinger15-Jul-09 4:49 
GeneralRe: Sith Interviewing Tactics [modified] Pin
_Erik_7-Jul-09 4:15
_Erik_7-Jul-09 4:15 
GeneralRe: Sith Interviewing Tactics Pin
Paulo Zemek7-Jul-09 7:27
mvaPaulo Zemek7-Jul-09 7:27 
GeneralRe: Sith Interviewing Tactics Pin
Dan Neely7-Jul-09 9:14
Dan Neely7-Jul-09 9:14 
GeneralRe: Sith Interviewing Tactics Pin
_Erik_8-Jul-09 5:43
_Erik_8-Jul-09 5:43 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes15-Jul-09 4:33
ProtoBytes15-Jul-09 4:33 
GeneralRe: Sith Interviewing Tactics Pin
Paulo Zemek16-Jul-09 14:14
mvaPaulo Zemek16-Jul-09 14:14 
GeneralRe: Sith Interviewing Tactics [modified] Pin
ProtoBytes7-Jul-09 18:04
ProtoBytes7-Jul-09 18:04 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes7-Jul-09 20:53
ProtoBytes7-Jul-09 20:53 
GeneralRe: Sith Interviewing Tactics Pin
_Erik_8-Jul-09 1:54
_Erik_8-Jul-09 1:54 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes8-Jul-09 6:29
ProtoBytes8-Jul-09 6:29 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes8-Jul-09 6:51
ProtoBytes8-Jul-09 6:51 
GeneralRe: Sith Interviewing Tactics [modified] Pin
ProtoBytes8-Jul-09 7:59
ProtoBytes8-Jul-09 7:59 
GeneralRe: Sith Interviewing Tactics Pin
_Erik_10-Jul-09 3:47
_Erik_10-Jul-09 3:47 
GeneralRe: Sith Interviewing Tactics Pin
ProtoBytes10-Jul-09 5:09
ProtoBytes10-Jul-09 5:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.