10 ms·
I used to think this too, but everything you can do in VB6 you can do in powershell, and do it better. Try/Catch, windows forms.. literally anything you can th
by kjaftaedi 7y ago
I used to think this too, but everything you can do in VB6 you can do in powershell, and do it better. Try/Catch, windows forms.. literally anything you can think of.
You can even mix powershell and C# together in the same script.
Once I realized I had a better version of everything I wanted, it became my new favorite.
- lostmsu 7y ago> You can even mix powershell and C# together in the same script. What feature are you referring to?
- deleted 7y ago[deleted]
- snypox 7y agoYou can load a .NET dll in a Powershell script and invoke it. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/add-type?view=powershell-7 https://docs.microsoft.com/en-us/powershell/module/microsoft...
- lostmsu 7y agoOh, that's not exactly have C# in the same script.
- orthoxerox 7y agoDepends on whether this is allowed by your GPO or not.
- tjalfi 7y ago[0] has an example of inline C# code. [0] https://dandraka.com/2018/11/12/powershell-how-do-you-add-inline-c/ https://dandraka.com/2018/11/12/powershell-how-do-you-add-in...
- Ididntdothis 7y agoThe only problem is that Powershell as language is pretty bad. I wouldn’t want to write my vB6 projects in Powershell.
- SOLAR_FIELDS 7y agoIt’s definitely one of the ugliest languages (syntax wise) that enjoys widespread usage, at least in Microsoft land.
- Ididntdothis 7y agoThe cmdlets are super useful but the language is just really weird.
- worldsayshi 7y agoIt seems that shell scripting languages tend to be quite ugly out of necessity? I mean bash is not a looker.
- SOLAR_FIELDS 7y agoPossibly, though bash is from a much earlier time when shell scripting language design probably wasn’t a very well known topic and bash evolved more naturally from open source. Powershell is much more recent plus had much more complete control over the language to prevent the kind of syntax warts bash has. Even then I would still probably take bash over Powershell for scripting but that’s probably more because of familiarity than anything else.
- asveikau 7y agoThe first release of bash was in 1989. Shell scripting was already a thing at that time. Csh and ksh were also around for roughly a decade at that time. I think you are confusing bash with sh with this kind of statement.
- mattmanser 7y agoThey had an opportunity to make a whole new, good, scripting language. And blew it spectacularly.
- gerdesj 7y ago>but everything you can do in VB6 you can do in powershell Excel modules? OK not quite exactly the same but close. I wrote a finite capacity planner system for a factory a fair few years ago in Excel to replace a huge number of Lotus 1-2-3 thingies with a vast amount of copy n paste from text screens and random sheets and what not. I started with an automated forecast. We used an (memory may be fading) exponential fit which worked best using previous four weeks. eg last four Mondays would generate next Monday's demand. The forecast could be tweaked by Planning at any time (aaaaiiiieee - Christmas!) The forecast was then fed into prep, make, bake, wrap and then dispatch. Between each process there is a stock holding. This is food so there are quite a few constraints on time, that's why we are making to forecast and not order. The customer will generally order your forecast if you are good enough and that is the whole point in the supply chain to the multiples: you know better than they do what will sell of your product. The forecast cranks through the processes and stock points and generates a basic plan. It shows what efficiency is needed from each machine and the amount of manning etc. Oh dear you've got a Rademacher running at 170% which is a bit unlikely (110% is fine because 100% does not mean what you think it does in this industry - its a rate that is easy to achieve and not the absolute max). Oh and that machine is due 10 hours maintenance. Crap. OK, Mel off of Planning: do your thing ... a few parameters are tweaked, some production is offloaded to another member of the group and a packet of Hobnob biscuits is dispatched to a factory 200 miles away. The amended plan is run back through the model to ensure it satisfies the inputs and then when that is OK it is fixed for now. I have not given too many details here as to specifics. I used a huge number of vlookups and I had a lot of code that ran through tables looking for the word "End" to indicate the last row (but one). I basically found that VB gave me enough logic and whatever to get the job done in a reasonably safe way but without getting in the way of the business logic. I could concentrate on getting the job done. Nowadays I'm a Linux (Windows and NetWare (lol)) sysadmin who masquerades as a PHB or MD but I still have a fondness for VBA. I recall getting someone's neural network spreadsheet VBA monster working after the most unlikely helpdesk call ever. Good times.
- DonHopkins 7y agoSounds like you'd love playing Satisfactory and Factorio! https://www.youtube.com/watch?v=Qg4h1uv4o6Y https://www.youtube.com/watch?v=Qg4h1uv4o6Y https://factorio.com/ https://factorio.com/
- deleted 7y ago[deleted]
- badsectoracula 7y agoWhen it comes to classic VB (aka VB6) it isn't so much what you can do but how you do it. After all everything that was possible with VB6 was also possible with Visual C++.
- kjaftaedi 7y agoWorking in a windows environment you often end up dealing with powershell already .. which means you don't have to learn another language and ends up simplifying everything. This is the VB6 comparison in my book.
- trent_lott 7y agoQuickly and easily design and make a GUI program with n real training? VB6 got me into programming as a kid. I mostly use python for stats stuff. I sorta understand how to run up a GUI using tkinter, but it seems like a huge pain in the ass. I'm sure Visual Studio offers the ability to do whatever VB6 could with a GUI, but it isn't obvious how to get there. VB6 was one nice thing - build 'a program' as you understand them in Windows. Why the fuck is it so hard nowadays? VS isn't intuitive - it's a firehouse of information and I feel like you need training to use it. That is a bummer. I just want to Lego-assemble a cute GUI-based program that I can make into a binary and email my wife to use. But I need to dedicate 70GB and two weeks of study to get there, I guess.
- ryanmarsh 7y agoA whole lot of us got into programming as kids because of VB. What do young people have today like it?
- pedrocx486 7y agoFrom my friend's kids, apparently python is the most common to start coding.
- spikej 7y agoWinforms with C#?
- digitalnative97 7y agoModing games
- _bxg1 7y agoHTML/JavaScript. That has the shortest start-making-a-GUI story (plain JavaScript; React/Webpack/etc. absolutely do not have this level of accessibility).
- xmprt 7y agoI'd say Vue is a good stepping stone to other frameworks as well. I feel more productive using Vue than pure Javascript.
- libraryatnight 7y agoAs someone who works with Windows and Active Directory primarily, PowerShell makes my life so much easier. It's glorious. I love PowerShell.
- badrabbit 7y agoPowershell is a command interpreter like bash at the end of the day, I say use the best tool for the task. I'd hate to do gui with powershell,vb6 let me build simple UI front ends, probably the simplest ever.
- cm2187 7y agoPerhaps you can. But I don't think having to write "-lt" for "<" is particular readable or enjoyable.
- goto11 7y agoPowershell is not an alternative to VB6. The strength of VB6 was a simple and straightforward syntax and a great integrated GUI builder and IDE. Powershell has none of that. The Powershell syntax is baroque due to the (necessary) compromise between command line syntax and scripting language and there is no IDE/GUI-builder. Sure, Powershell is much more powerful in many ways, but that was not the draw to VB6 in the first place.
- 7thaccount 7y agoJust remember that parsing text files (big for me) is glacially slow in Powershell due to all the object mess. I enjoy most other things.
- mlazos 7y agoMixing c# and power shell in the same script is amazing. You can load methods from DLLs on the command line as well. I had to do this when I didn’t have permission to run unregistered exes on a server I was debugging. Luckily the admins didn’t restrict powershell and I ran my main method from a script.