4 ms·
– It’s built in. – The IDE is built in. – The syntax is beginner-friendly. – It’s stable and doesn’t change every six month. – It’s well-documented. – No b
by layer8 3y ago
– It’s built in.
– The IDE is built in.
– The syntax is beginner-friendly.
– It’s stable and doesn’t change every six month.
– It’s well-documented.
– No build steps, it just runs, and fast.
– It’s resource-efficient (CPU, RAM).
– You can easily create dialogs and forms using the built-in visual GUI builder.
– You can break into the built-in debugger from your Office document.
– If you want to get fancy, it has interfaces and classes.
– You can call any win32 function and use any COM object.
- lnxg33k1 3y agoI think I just read the best reply ever
- ncjcuccy6 3y agoBut typescript has "using" now? How can VBA still be so popular?
- layer8 3y agoVBA supports automatic cleanup via Class_Terminate. :)
- nulbyte 3y agoAll valid points, but I think the biggest reason is: - It's what's available. There is a bit baked into this statement which the article breaks down further: - Companies won't approve anything else in the hands of ordinary users - Companies' developers are too busy with too high priority items And some things not mentioned in the article are also baked in: - Even when developers get around to a project that could replace VBA, they don't understand the project, underestimate the time and resources required, and deliver a subpar product as a result - Companies lay off people doing work IT and developers can't be bothered to support with no real plan other than overburdening the remaining ordinary users with extraordinary problems
- 7thaccount 3y agoVBA serves an awesome niche. I once built an awesome simulator that did some pretty complex optimization stuff. The main sheet had input cells for the user, a couple of radio buttons for toggling certain features, and a button to fire off the built-in Excel solver plugin and pull certain values from that process and display it all on a GUI on the first sheet. It took me just a couple of days despite zero VBA experience and most importantly I could send it to all of our customers who then had a full simulator that they could play with alongside their engineers. They didn't have to install anything (just click a button within excel to add a plug-in). Simple simple.
- dabeeeenster 3y agoIt might be niche for HN, but in muggle world its enormously popular.
- jimbokun 3y agoHeh, muggle world is the niche, but that niche is arguably bigger than all of the dedicated software engineer niches.
- kitd 3y agoI read a stat somewhere that there are at least an order of magnitude more Excel "programmers" in the world than all pro developers in other languages combined.
- steve1977 3y agoAnd looking at how much work is involved in even just setting up a JavaScript frontend, I’m pretty sure the Excel programmers are yet another order of magnitude more productive than the latter. Which is kinda sad actually.
- gold7777 3y agoI agree. I worked as an analyst where due to security policies we only had VBA. There was application which consisted of an Access DB for a "front end" (containing an interface to input data, generate reports in ppt/excel, etc) which connected to another access database as the "back end" and an admin console to pull in data from a SQL database. I had a lot of fun maintaining it.
- omneity 3y agoWhat would have happened if VBScript had won the DHTML wars?
- layer8 3y agoWe’d have VBTypeScript now. ;)
- markphip 3y agoIt seems like the bigger concern would be all the important data they have in Lotus Notes, as well as some of the other systems mentioned. VBA seems like a solid choice compared to where they have their data being stored.
- isilofi 3y ago- It allows a user to easily extend their current work environment (i.e. MS Office applications). Other languages and IDEs could do that, too, but not so easily. This allows users to somewhat more gracefully extend their documents/data and knowledge instead of starting all over again with a "proper" programming language/environment. - I would not call it fast or resource-efficient, but fast enough and efficient enough for most unsophisticated purposes. - No red tape for installation, IT cannot (easily) disable it, isn't an extra line item on any bill
- layer8 3y agoIt’s fast and resource-efficient in that it doesn’t need to start up a comprehensive extra runtime environment like the CLR, and doesn’t need double the memory like GC languages tend to do, and is faster than many interpreted languages due to its P-code and its tight native integration, not needing an additional interop layer to communicate with its environment.
- meragrin_ 3y ago> – No build steps, it just runs, and fast. Huh, fast? Sure, it's fast enough for its use cases, but it is not fast.
- bertil 3y agoIs it still something you can code with your mouse? I remember having to deal with it on my first job because the team knew nothing about coding. They had “recorded” macros by clicking around and never seeing a line of code. It was incredibly brittle: any change to the table, even adding a comment, would break it, but it allowed them to automate a task.
- layer8 3y agoYou can still record VBA macros in MS Office.
- sumtechguy 3y agoThis sort of programming is very powerful. It lets people who have no idea what big O is or how to make a fully automated CI/CD system with testing and all of the bells and whistles just get something done. Just to make a dialog and automate something. That type of programing is very powerful. Many times a huge mess to clean up but very powerful and gets things done. We sometimes lose sight of that. Computers are to get things done. Getting rid of the moat we have build could be very powerful.
- jimbokun 3y agoYes. In an ideal world this is how first draft of software would be done. And professional software engineers only come in when it's time to make it secure, fast, less brittle, scalable, available to more users, etc. Like finding the screen that takes forever to load because there's a hidden O(n^2) in there and replacing it with an O(n log n), etc.
- jncfhnb 3y agoIt’s also the ultimate discoverability tool. People struggle with not knowing how to describe a task they can do but not with code. The record gets you very close very quickly. If you’re fluent in adjusting selection logic you’re usually going to have it pretty easy.
- mrweasel 3y agoWe used some weird testing tool from HP I think. It could record you clicking around in an application and generate a VBScript. You could then go in a modify the generated code, add parameters and fix the brittleness. It meant that you could get a ton of coding done in a very short about of time.
- hardlianotion 3y agoAnd it's absolutely baked into Microsoft Excel.
- jimbokun 3y agoAll true, but the fascinating thing about the article is that it's the Subject Matter Experts demanding to use something other than VBA to be more productive, and the IT people saying no VBA is the only thing allowed because...reasons.
- c0nsumer 3y agoOften those SMEs are data folks, and if they are allowed to develop in $TOOL_DU_JOUR, and that app becomes business critical, the IT folks will be stuck supporting it. And if that thing doesn't become well supported, or it isn't easy to find someone who can support it, that's a problem. I've run into this quite a bit at my workplace. Some business group writes an app in Excel using VBA + an add-in and it becomes the core part of some workflow. But IT didn't know about it, nor did they know about the (for example) 32-bit ancient Excel add-in that it requires, which then breaks when an Office upgrade happens... Now IT is stuck where a routine upgrade broke some weird edge case thing and needs to maintain a downlevel version of Office for a small group until they can re-develop their business-critical tool in something else. Use-known-stuff rules up front -- in this case which may well be VBA -- alleviate a lot of these long-term problems.
- jimbokun 3y agoOr just make it known that if you want support, here are the languages our IT staff know and can help you with. Otherwise, you're on your own.
- c0nsumer 3y agoThat's a great way to go, but unfortunately the reality is often the folks go off and write stuff in the non-supported way. The business gets dependent on it, and then years later -- because IT is there to support the company overall -- IT gets stuck supporting it even if long ago they said they wouldn't. Sure, you can have an internal political fight, but it only goes so far when everyone there is supposed to be working for the company. So while there'll be strong incentive to move to something else, there's still a need to keep it working in the mean time. If you can prevent this up front it's better all around.
- specialist 3y agoYes and: - embedded database via Access Data Objects (ADO). There's still no modern equivalent. The ADO notion was lost in the transition from workgroup (file sharing) to client/server (ODBC). ORMs, ActiveRecords, builders (eg JOOQ), templates, etc. are all partial solutions. Abstractions with sharp edges and traps. (Yes, I'm working on it.)
- cm2187 3y agoBut unfortunately microsoft didn’t invest into VBA in 20 years, other than keeping the light on. And it lacks so many modern features. There was an attempt at a .net version of VBA (would have worked the same way, with a mini visual studio embedded in Office), called VSTA. But it was killed. So the cattle (business users) is stuck with 1990s technology.
- steve1977 3y agoMaybe that turned out to be more of a strength than a weakness?
- cm2187 3y agoA strength for whom? Not the end user.
- mcbishop 3y agoIt depends on the user. I use the basic VBA components to build my own features (exactly how I want them). I'm happy that Microsoft isn't meddling.
- cm2187 3y agoThe lack of basic functionalities like generics, sort functions, lambdas, is a hinderance if you got a taste of .net.
- mst 3y agoIt's a hindrance to -us- but I suspect for code that's designed to be passed from SME to SME that -not- having access to features so you have to write things the ugly stupid way ... may actually be an advantage, since the next SME along only has to have a sufficient tolerance for 'ugly' rather than an understanding of the features you and I would both want.
- mcbishop 3y ago
- tiahura 3y agoHere’s another: - ChatGPT is well-trained on VBA.
- NoMoreNicksLeft 3y agoI feel a strong urge to suggest that it may in fact stem primarily from a deliberate and maniacal worship of Nurgle, the Chaos God of despair, disease, and destruction.
- deleted 3y ago[deleted]