10 ms·
I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp
by yulaow 12y ago
I would have preferred a bash/powershell solution. Hoping no one is still writing batch files on windows... even if he is still using xp
- meowface 12y agoAgreed. Powershell has almost completely replaced batch scripts, and is actually a fairly pleasant language to work with.
- knope 12y agob a shell for the win
- 616c 12y agoAs I said in the other threads, the language is great, the performance has been abysmal in relation to batch (at least for me, having started with Powershell in its first release in Vista).
- AYBABTME 12y agoThis eludes me but why care about the performance of a shell scripting language?
- malkia 12y agoIf its part of your build system, then it matters.
- Maakuth 12y agoWith PowerShell level of slowness it starts to matter. Even very basic commands seem to sometimes take many seconds to run. In the middle of intense workflow it becomes a problem.
- ygra 12y agoCare to give examples? I know that the language isn't fast, but afaik nearly all shells are interpreted. There have been performance problems with break/continue in earlier versions as they were implemented using exceptions internally. But that doesn't really qualify as "basic commands", I guess. Cmdlets should be not much slower than running the equivalent C# code yourself.
- Maakuth 12y agoHmm, I can't seem to reproduce many such issues with this machine, except Get-Help the first time I tried it. I think it could be that the cmdlets are only slow on the first run (enough to leave me with a bad experience), or the SSD on my PC masks the problem. It's good to know that it's not always super slow.
- mtdewcmu 12y agoIf it's slow on the first run, then it might be loading a large interpreter from disk. If so, MS might have let the interpreter get a bit ungainly -- you might argue.
- brazzledazzle 12y agoI would like to see some examples as well. The only time I've seen performance issues is with third party commandlets (or very lean hosts).
- PeterisP 12y agoWhat could a shell possibly do so that a basic command would take many seconds? Currently, "many seconds" is enough time to run an interpreter on the command, connect to a remote machine in Iceland, spin up a new virtual server there, send the command there to be executed, review the execution results for possible exceptions, run a malware scan, fetch the response back, execute the command again on your computer, translate the command and results to Klingon, send them to NSA for archiving, play a quick game of chess with another instance of the shell, and play a congratulatory tune. Seriously, computers nowadays are fast enough to run a partial compile of your code at every single keystroke while you're writing it. It takes special effort to make a scripting language unusably slow - even an unoptimized interpreter that itself runs on a different interpreter should do just fine.
- meowface 12y agoI use Powershell for many administrative tasks at work, and it can be annoying if querying data from a single machine takes 5+ minutes. Which it does sometimes.
- bkeroack 12y agoTotally agree. Powershell is what you need to use on windows. It's been available on the default server install since 2008 R2. No need for batch scripts anymore.
- rmtew 12y agoThis sounds like you're saying that it suits your needs, therefore we should take that as meaning it fits our needs. Unfortunately, things are not that simple. I needed to do something and looked at using powershell, but in the end I couldn't just distribute it and have it work for whomever would be using my project. It needed to be signed or something. On the contrary, the bat script I wrote just worked and would just work for anyone who used the project. Powershell is not a magical solution that suits everyone's needs. This kind of blanket statement helps no-one.
- WickyNilliams 12y agoThere's a config switch to allow execution of scripts. I agree it's a complete pain (literally falling at the first hurdle), but it is a one-time thing change. I had mixed opinions of powershell when I tried my hand at it. The naming convention and documentation system were well designed, piping objects is an interesting concept, and IDE support was great for a terminal (step through debugger, intelligent auto complete). Despite this, there were numerous quirks and ugly spots that diminished the experience. I felt it was a missed opportunity. This was powershell 3, I can't speak for later versions
- mtdewcmu 12y agoThanks for this candid impression. I had some slight interest in learning PowerShell, but it looked like a little bit too high of a learning curve, given that I had other scripting languages I could use (including bash in Cygwin). Piped objects struck me as interesting when I read about it in a magazine, too, but somehow they aren't needed to perform all kinds of scripting in *nix, so I wonder if they might be more complex than the problem called for. I get the impression that PowerShell may suffer from having come from Microsoft -- a company with bottomless pockets to spend on developing software and probably little need to stop smallish system utilities from becoming ornate.
- dpweb 12y ago300 million machines still on XP guys..
- throwaway5752 12y agoYup, and that's the problem, not bat vs ps1. People said the same things when 98 was EOLed. XP is dead.
- deleted 12y ago[deleted]
- ams6110 12y agobash in cygwin.
- eddiegroves 12y agoFor simple use cases I still use batch files as the performance is much greater. Powershell feels too heavy when I just want to run a build with some parameters and a couple of other commands.
- klodolph 12y agoI think it's really interesting the way programmers will use phrases like, "it feels heavy", as a way to describe using programs that contain unused features. I'm guilty of the same. Powershell "feels heavy" because it is a lot more sophisticated than batch, you can do all sorts of cool things with WMI or use data structures, but in the end, what does programming in batch actually gain you? If performance is such a problem that you notice a performance penalty when switching between shells, something is seriously wrong. But I'm guessing you don't really notice the performance difference, you just feel the weight of unused features.
- GrinningFool 12y agoThe opposite effect is, IMO, how things like node.js gain in popularity - the environment "feels fast" and "feels simple" [for the simple use cases that are always at the start of things].
- innocenat 12y agoThere are still need for real pipe (no buffering) and ASCII I/O redirection. (Not sure if the latter is possible now, though)