1.

Solve : Renaming all files so they have file size and filename?

Answer»

Quote from: JavaHater on January 01, 2011, 11:21:06 PM

there is only 1 question i have for you.
Are you trying to say that I should not post any more Java solutions in future?

I guess that question was directed at BC_P but here's my answer: nobody can say you must not post Java solutions. Post freely. It is always interesting, and can be instructive, to see different methods of solving (or attempting to) a problem. However be prepared for discussion about it.
Quote from: Salmon Trout on January 02, 2011, 02:14:37 AM
I guess that question was directed at BC_P but here's my answer: nobody can say you must not post Java solutions.
Good then. comments on program bugs or logic errors are welcome on the solutions I post, other than that, useless discussions like whether Java is appropriate or not, or "using a cannon to shoot down sparrows" or "using a sledgehammer to crack a nut" will be strictly ignored by me in future.Quote from: JavaHater on January 02, 2011, 02:37:40 AM
Good then. comments on program bugs or logic errors are welcome on the solutions I post, other than that, useless discussions like whether Java is appropriate or not, or "using a cannon to shoot down sparrows" or "using a sledgehammer to crack a nut" will be strictly ignored by me in future.

Then you may find robust disagreement from some people. You are exhibiting a curiously short-sighted and narrowly focussed attitude. The perceived merit of any particular solution is not merely a question of whether it contains any bugs or errors of logic or syntax. There are external considerations too, which are often ignored. Many people on here asking for a batch solution are doing so for a work related reason. They are not at home on their own PC where they can download and install whatever they like. Very, very often indeed they are prevented from installing "better" tools than batch or Visual Basic Script such as Java, Awk, Perl, Ruby, SED, grep, or whatever. One reason may be that the system admins won't let them. Another may be that the solution may be for wide deployment and it may be impractical to install 3rd party tools on every desired workstation. Yet another may be that for reasons to do with confidence the person asking the question wants a solution that they can understand now, not later when they have learned a new tool, no matter how desirable or easy you may think that would be. This illustrates a problem that seems to arise often -- forgive me if it does not apply to you, I am remarking generally -- when teenage or introverted adult "code warriors" who know plenty about coding but nothing about people and workplace issues fire up their tools and provide a classroom type solution.

In general I would proceed thus: if somebody shows a batch script or a fragment of one, and says "how can I make this work better/at all?" I would answer that question directly because they clearly have already chosen their METHOD and just need a pointer or two. If they show no code at all but explicitly ask for a batch solution I would still answer in that way. If they want to do something which is impossible in batch (and there are surprisingly few things that fit that definition) I would think about Visual Basic Script. (With your Java skills you COULD look at Jscript). If the problem is more suited to a programming language I would say so. I would not impose a different method just because I happened to admire it more than the built-in tools.
Posting a java, C#, C, C++, or other compiled language source as a solution to a problem in a forum quite clearly labelled "Microsoft DOS" is in a large part due to hubris. Also, I've FOUND that doing so never has the "OMG you are a genius" effect that one might expect. I learned that in this thread.

Generally I don't usually offer batch-based solutions in this section, because I'm less than familiar with most of the extended syntax that the NT interpreter has; when somebody actually posts a request for a pure DOS solution or if their requirements allow the use of the less versatile older DOS style batches I might help out. I mean, I write a short C, C++, C#, Scala, Haskell or F# solution that would "solve their problem" but really, that's sort of the point; it doesn't solve the problem so much as it presents the illusion of solving the problem- it doesn't ADDRESS any issues that may arise, or the possibility that they may in fact be using the original code for a reason. For example- it may be a small part of a larger batch file. In that case now that segment would be calling into a java class file. Not so bad, but what about if they want to change the logic in that class file, and nobody knows how to work with java? or they lose the original source? Then they have to reimplement it in batch again anyway.


Discussion

No Comment Found