Why do people still use VBA?
sancarn.github.io
sancarn.github.io
From that end-user direction, solutions emerge. And they're in VBA.
ISE does occasionally hang / crash, but it's quite rare compared to how VSCode behaves across every machine I've used it with. It really seems to be just a Powershell problem, haven't had the same issue in any other language.
When I'm really making great progress on something, having to fart around with killing and restarting the shell constantly is really disruptive. Yes, Code has better and more features, but for me the extra productivity does not overcome the crashy shell.
I don't like vscode for powershell development and I find the pycharm experience for powershell (lol) much better.
C:\Windows\Microsoft.NET\Framework64\ has both MSBuild.exe and csc.exe, but only for .NET Framework up to 4.0. I was under the impression that 4.8 was installed on Win 10 machines via Windows Update.
$code = @'
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace Background
{
public class Setter {
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern int SystemParametersInfo(int uAction, int uParm, string lpvParam, int fuWinIni);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError =true)]
private static extern int SetSysColors(int cElements, int[] lpaElements, int[] lpRgbValues);
public const int UpdateIniFile = 0x01;
public const int SendWinIniChange = 0x02;
public const int SetDesktopBackground = 0x0014;
public const int COLOR_DESKTOP = 1;
public int[] first = {COLOR_DESKTOP};
public static void RemoveWallPaper() {
SystemParametersInfo( SetDesktopBackground, 0, "", SendWinIniChange | UpdateIniFile );
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
key.SetValue(@"WallPaper", 0);
key.Close();
}
public static void SetBackground(byte r, byte g, byte b) {
RemoveWallPaper();
System.Drawing.Color color= System.Drawing.Color.FromArgb(r,g,b);
int[] elements = {COLOR_DESKTOP};
int[] colors = { System.Drawing.ColorTranslator.ToWin32(color) };
SetSysColors(elements.Length, elements, colors);
RegistryKey key = Registry.CurrentUser.OpenSubKey("Control Panel\\Colors", true);
key.SetValue(@"Background", string.Format("{0} {1} {2}", color.R, color.G, color.B));
key.Close();
}
}
}
'@
$null = Add-Type -TypeDefinition $code -ReferencedAssemblies System.Drawing.dll -PassThru
Function Set-OSDesktopColor {
param (
$r,$g,$b
)
$null = [Background.Setter]::SetBackground($r,$g,$b)
} $Csc = gci "$env:windir\Microsoft.NET\Framework64\*\csc.exe" -ea silent | select -last 1
if ($Csc) {
Set-Alias -Name csc -Value $Csc
$Csc = $null
}
It makes the csc that comes with .NET available out of the box on pretty much any Windows system. I'm not sure how good it is at building serious programs, but it's good enough for little static void Main thingys. I doubt it's useful for the same demographic that would be using VBA, though. if ($Csc = gci "$env:windir\Microsoft.NET\Framework64\*\csc.exe" -ea silent | select -last 1) {
Set-Alias -Name csc -Value $Csc
Remove-Variable Csc
}
Or even: gci "$env:windir\Microsoft.NET\Framework64\*\csc.exe" -ea silent | % {
Set-Alias -Name csc -Value $_
}JScript is deprecated, and is likely to be removed at some point too...
CMD is often blocked on many people's machines due to group policy.
PowerShell is really the only other option other than VBA, as discussed in the article. Only reason I haven't used PowerShell til now is the version was hidiously outdated and didn't even support classes... Of course with PowerShell you can evaluate C# code.
Can you access raw memory from it?
If the answer to either of those is no, then that’s a big difference.
Here's a ransomware incident report from someone opening an Excel document with macros enabled:
https://thedfirreport.com/2023/05/22/icedid-macro-ends-in-no...
A better diffentiating factor would be who developed the macro. If it's built in house by someone merely using it to make their lives easier it's doubtful they inserted malicious code. I guess ideally IT should review the code.
He supposedly can do a days work in fifteen minutes and then just hang out. Their computers are super locked down, can’t install anything, can’t go to any non-whitelisted sites, but they have Excel.
There are two reasons: 1. They have a specific job with a specific set of duties (think sysadmins, or administrative duties) in a large company or in a state beurocracy. 2. They would rather go home or do something more but they are not permitted: they have metered time in the office and other people would and do shut them down on any initiatives.
To me, a workplace like that is like a kafkaesque nightmare but they seem to be fine with it, or rather, have accepted it. It lets them focus on other things in life outside of work.
i mean, i would imagine some people want to see purpose in their jobs, while others are just treating it as a job and whatever happens with the output of the job is of no consequence. And this is esp. true of gov't jobs, but by no means do the gov't have a monopoly on such inefficiencies.
But my opinion is that there's something systemic that is preventing these jobs from being competed on and efficiencies eked out.
The problem is actually in the work culture, where other coworkers would prevent another worker from becoming too efficient and proactive. So, nothing changes.
Although I wasn't in the condition of automating the time required down to N minutes, I can see how this dynamic plays - essentially, BigCo with dysfunctional management, where efficiency doesn't really matter.
There are also the other stories we don't hear: One of my first jobs involved a very repetitive software task that got boring quickly. I spent four weeks trying to automate it, but eventually had to declare failure[1] and then I had to explain to my boss why I was a month behind on my work that was due in a couple of weeks[2].
I imagine that for every "automated my job and now I can do it in 15 minutes" story there are 15 stories of "I automated my job and now I work just as hard maintaining the automation" and another 50 stories of the "I tried automating my job but failed" kind. Only the first one gets re-told.
[1]: Mainly due to hardware quirks I didn't have the experience and skill to work around.
[2]: This is not a story about how automating something is bad; it's a story about the bad decisions one makes when one is inexperienced!
A few weeks into the job I completely automated these in python and all I had to do was turn my laptop on in the morning, then off in the evening, and I was done.
They were slower, but they also chit chatted with half the office, went to lunch, etc.
Their jobs consisted of pulling some data from here or there, entering it into excel, sending a few emails, entering some data into another system, printing some checks. All stuff that's easy to automate (you'd probably need more than Excel in this case)
In one of his memoirs, the science fiction author Arthur C. Clarke recalled his days as a young man working for the British bureaucracy (something to do with teacher pensions, as I recall). His particular job involved consolidating huge lists of figures into reports. He observed that the numbers in the reports were rounded to two significant figures, well within the accuracy of his slide rule, and started using the slide rule to do all his work.
He could finish his daily quota before lunch and take every afternoon off.
We both worked at a tox lab and there are masses of numbers to be reviewed. He strung together 8-10 steps to transform, massage, etc. the data for presentation to mgmt, accounting, etc.
What he found was that most of the time, it all ran fine, but when it didn't he had to spend some of that saved time troubleshooting an issue.
They also added more to his plate, since he no longer needed XX hours to accomplish the data push.
In the end, he was more clever than the last person, but didn't have the 7.75 hours of free time that's often touted.
It may exist, but it's rarer.
This is quite reminiscent of the good old "emacs operating system" paradigm just applied to a different context!
But then, the next phase starts: that scripts gets copied over (because Jim wanted to run it too) and modified (Jane has a different VBA version) and expanded (now it does "THIS!" too).
Now it's a 1500 line kludge and they want to unload it, ie pass it over to development for maintenance.
... and THAT should be considered a GOOD THING!
It means you've got a tried and true business case for the application, the requirements capture has already been done, you've got an instant user-base and a very clear bar to jump over. Of course, the application must be able to outperform the old application in every way, or else questions will be raised.
I think it's important to point out that the inception of these excel VBA monstrosities is innocent and pragmatic. An SME has a job to do, they're doing their job, but have a need for a custom tool to help do their job.
It is ALMOST NEVER the case that they should drop what they're doing and engage a SW development team to go through a lengthy VERY expensive process with uncertain outcomes-- all the while still having to do their job. It's much more pragmatic, in many cases, to tackle the problem piece by piece, as need arises, with little spreadsheets, scripts and little databases.
I think complaining about VBA monstrosities is wrong-headed. They should be, in a way, embraced as a starting point for devs-- hopefully BEFORE they become mission-critical to the company, however.
There is no way for the IT customer to negotiate this "correctly". It always leads to the same result.
The problem is IT exists to administer computer systems, not to help business people create or maintain software. This brings the wrong mentality and skillset.
They embedded a technical developer into a business team, and had that individual write the "kludgy" business apps that needed quick automation for throwaway tasks or for data processing standup. The dev has access to more than VBA, specifically, Python, GitHub, the ability to spin up what amounts to VPS's in the cloud with access to all of the database infra. All tools are shared with the rest of the company through a tech sharing program that is being heavily promoted across teams, and of course hosted in a repo, often with docs or a website if possible.
This "fills the gap" of dev latency for small dev tasks that don't necessitate pulling in an entire IT team. I don't really understand why this isn't more popular. The business team this individual was hired onto was over-the-moon when this occurred because they were doing absurd things like copy-pasting and hand-modifying JSON payloads many times a day and simply lacked the skillset to fix the problem, due to the issues you described. These issues were immediately resolved in under a month for hundreds of man-hours saved.
Just give business teams a tech resource that's well-trained and understands proper dev for on-demand work that doesn't justify the agile scrum whatever nonsense, and you won't end up with a forest of Excel macros.
The Software People get called in when it becomes difficult to maintain the ad hoc solution.
One of them had Excel, Access and played with VBA, and in a couple of weekends had come up with a monstrosity that did just what they wanted. It lasted for years as a major part of their work toolbox until someone wrote a proper app for them in C#.
Back in the dark ages, we had a horrible reporting engine in Word VBA that pulled report definitions off a fileshare and cut and pasted bits of templates together and then printed them. Literally there was a computer in the office the IT team hadn't taken back because the guy had quit and we logged it in as one of us and ran that .doc all day to do numerous engineering reports. This was quicker and cheaper than filing a PO for the reporting option on the CAD/CAM software which would have taken at least 18 months, involved consultants and eaten at the project budget.
So when everyone bitches about Excel VBA being used for horrible things, the cause is probably further up the stack.
The other cause is what I call monkey hammer. If you give a monkey a hammer he's going to hit things. Everything looks like a VBA solution when you're a monkey and the only hammer you have is VBA. I am a slightly more evolved primate these days.
I think there's even a Lazarus IDE available for every company user who wants to create reliable RAD based software bound to corporateware.
As a developer who hates installing programs that might be one offs, I hate the idea of it, but I can't deny the benefits.
--
[0] - Except those creating high-security environments with airgaps and whatnot, but that's a special case.
The problem is, cybersecurity insurances nowadays have that limitation as mandatory for coverage... and for good reason.
Been at a company that was like this to developers. We couldn't approval to get anything installed, and IT was just plain hostile. They also demanded six months notice for us to get a server that was a copy of an existing computer (we wanted to use it for staging).
I also once built an exe for our internal app in Visual Studio, got a call from IT, they said I had a virus on the computer, requested screen share access, and I watched them navigate to the bin folder and delete the .exe I just built (and just the .exe file).
Had to go through a nice long process to get them to stop doing that. Also they didn't seem to understand that I'm a developer and I develop software for the company.
It's really no surprise that VBA remains invaluable to businesses. I've worked with product managers that use VBA to perform absolutely jaw dropping levels of complicated business analysis, even in environments where they have access to other tools and languages, mature build processes etc, because it's the right tool for the job they have at hand.
Not entirely correct
https://www.encomputers.com/2018/05/disable-macros-in-micros...
Generally I update them with client-ran JavaScript. I love sharepoint lists for their ease of use to users, but the limitations are pretty rubbish if ever you want to do anything programatically, unless you can figure out how to authenticate (and/or use a library which handles that for you).
One example: a couple years ago I was working with a big hedge fund and one of their data analysts sent me an Excel model he had built and I was tickled to see the .xlsm extension (i.e., VBA code on board).
"Ahh ha", I thought, "Let's see what these macro-recording cowboys have been up to."
There was a lot of VBA inside, all written by this Caltech comp sci data analyst who was a Python superstar. The VBA was for pulling data from a database, putting it on a sheet, building some formulas, and some pretty formatting. There were even a few userforms!
I teased him, "VBA? What else are you guys using over there? A cotton gin and a steam shovel?"
I was startled to hear him heap praise upon Excel and VBA instead of the usual complaints.
He said something that stuck with me, "Excel makes it easy to understand the dependency structure that is implied by computations. If I had done this in Python, I'd be answering questions about it all day long."
VB6 has a pretty big community, and https://twinbasic.com/ has really helped unify VBA and VB6 communities as of late. So it might have a little of a resergence in the dev community.
Just look at the effort and knowhow that went into this VBA function that resolves the local file system path from the https url of workbooks synced to OneDrive/SharePoint:
https://gist.github.com/guwidoe/038398b6be1b16c458365716a921...
Lots of awesome stuff still in the VBA/VB6 community!
VBA is powerful and quick at prototyping/iteration.
I would even venture to say that VB6 was the zenith of CRUD apps
Years ago, I heard that JP Morgan had +20k access databases on their network. The data analysts that make up companies far and wide one day discovered that they hate what they’re doing every day. They investigate the “record macro” button. Some might even find it nifty. They use it again and again. Some may even try to get smart and investigate and get curious of the code that it spat out. Some might even go further and attempt to learn enough to change some things around.
A handful might just learn data structures and algorithms to build out a auth / permission system that mimics Django. Might rebuild the UserForm UI from scratch. Implement markdown, sax parsing, custom scroll bar, logging, games.
The answer is because a data analyst probably got bored of what they’re doing every day.
I don't see it ending anytime soon simply because it is easier to build something somewhat complex inside of Excel and put it on a network share than go through IT to install IDE, build something, and then go through security to deploy it. Not every problem requires a jira project and overly complicated solution.
That said, I am wholeheartedly against large things being built in VBA. A few little scripts to query a cube in one system and combine with data from a table in another based on changing values in a few cells is fine but there is a point where you have to go elsewhere.
Ultimately I am a huge fan of of the Alteryx+Tableau/PowerBI stack for the vast majority of projects, so long as you have the server licenses where things can be automated.
The immediate problems I faced was:
1) The analysts wanted every (CRUD) step to happen within excel - excel was indeed going to be their interface, so I needed something which I could launch from within excel.
2) The IT department refused me to grant command line access
3) The IT department refused me to install non-approved dev tools. To get them approved, would potentially take months.
4) The DB admins weren't too keen on letting me add a new DB to the existing Oracle DB. The IT department weren't too keen on me doing my own DB (see step 3)
Hell, just getting new add-ins to excel requires me to BEG the IT folks. And if I'm lucky, the add-ins will just suddenly appear. Will it take a day? a week? a month? Who knows.
So keeping all those things in mind, my only real alternative was VBA.
In the end I managed to get some permatemp solution up and running, which the analysts use once every two weeks.
Therefore I was stuck with Office too, even though I'm a Linux guy. I got a fair amount of kudos building some real frankensteins for them purely in VBA.
At least partly it was due to being in an environment where other people I worked with were already using VBA. They suggested VBA for the task, and they were able to help me get up to speed with it fairly quickly. And at that point in time I was still young enough to be open to trying new things just for the sake of it, my own opinions were not fully encrusted yet :)
I did dabble in javascript for a simple webapp for one small project, but that was kind of a tangent to what we usually worked on.
I really had to lough when I read the following description of the IBM BPM but this sums up a good part of the issue:
"...while IBM BPM does come with a REST API, this REST API is borderline useless to Technology teams and SMEs
Some REST calls use javascript encoded as strings Others require html embedded in json embedded in xml
Database tables aren’t queried by name but by GUID.
There’s no documentation of which GUID relates to which table/process.*"
Quite a lot of things became so outragedly complex no one outside of the IT bothers to handle these, and sometimes not even inside IT. It started with AJAX where suddenly half of the development effort went into designing frontend code and backend services, which honestly does not even touch the end users automation problem. And it went further downhill afterwards. UIs nowadays look modern but are generally as user hostile as the technology stack used to produce these.In Excel my UI is just "there", I have a nice code generator aka as macro recorder, no IT department questioning my authorization to do something nor does not have time or budget to help me with my business problem.
So VBA is the workaround for users around the IT department. Not perfect, but better than what you would get else.
Because it is the only programming language Corporate can’t choose not to install.
The wonders of ‘Enterprise’, it amazes me when people bring it up as if it’s any kind of advantage or excuse.
Who wouldn't want to spend a tiny fraction of the effort to get 80% of the outcome?
> It is supposedly “Against the technology strategic vision of the company” to allow “end-users” access to high level programming languages.
This is where the idea of "a computer as a bicycle for the mind" died.
A project I work on has some processes that I need to run that can only be initiated through the Azure DevOps Pipeline interface, and these need a "worker agent" on a VM or something, and there is only one worker agent, and some of the jobs take half an hour or more.
So the effective outcome is that despite every member of the team having a full multi-tasking computer on our desk (A multi-tasking computer each! Sometimes more than one each! Plus loads of cloud VMs), we can only run a single task at a time between us and we have to coordinate scheduling manually.
Is this the future?
It is like this because the process involves "secrets" that are meant to be hidden from the team but are accessible to the program when running inside the Pipeline. If it weren't for this secret-hiding, I could just run the process manually on whatever computer I want.
And the secret-hiding doesn't even really work, because I can freely commit code to personal branches on the repository that the Pipeline runs from, and I can run the Pipeline on whatever branch I want, so I could commit a program that prints out the secrets. Ah, but Microsoft has thought of this: if any of the secrets appears in the output, they get replaced with "***".
(Let's skip the part where this accidentally leaks a "secret" username, where I know a particular piece of text that should be output but instead all I see is stars...)
The secret-hiding doesn't work because I can just make the program output base64 of the secret. I don't do this because I don't want to start pasting secrets around in places they shouldn't be available, but it is sometimes tempting.
Anyway, welcome to the future of computing. Thanks for listening to my TED talk.
Github Actions at least allows restricting secrets to be exposed only to specific branches, and in Gitlab you can enforce that pipeline steps using critical secrets can only run in protected branches, so you'd need to fool a maintainer with a malware-laden pipeline change in a merge request first.
I work in security and can't relate to banning Python & replacing it with Microsoft crap either.
Imagine for a moment that someone in accounting built a system in lisp to automate part of his job. As time goes on, he takes on more responsibility, which he writes more lisp for.
One day, he gets hit by a bus.
The lisp program he wrote is now an integral part of the running of the accounting department simply by accumulation and momentum, with tons of business logic baked in. Where do you look to find a replacement?
With VBA, there's a much higher chance of an accountant being familiar with the language, and a much smaller surface area for what they can do.
IMO, companies should have a language of choice which is actively encouraged to be used by everyone for all automation needs. Different departments build libraries to automate aspects of their jobs and other departments can use them if needed. I.E. it becomes yet another tool, just like Excel.
Nothing has changed. In the last century this also happened and it was called islands of automation. In my bubble back then it was considered a good strategy, let departments first play around, and if they are on to something integrate it.
Funny how with computerized process, IT departments are effectively central planners. The lowly workers get to only do what the IT secretariat allows. It is this way because national^Wcorporate security!
Modern IT is more like if your water utility had final say over which faucet you installed and how you used it.
Authorizing use would be akin to the pre-Carterphone ATT model where only pre-approved uses would be allowed ('you can't attach your equipment to our network').
Thankfully, we eventually realized that was a dumb decision and moved to something closer to user freedom + network protects itself + zero trust.
Better to just guide behavior at the pricing level, and let people make their own decisions about use.
If we had to make some sort of water use analogy, I’d go with something like; the corporate network is a somewhat protected environment that needs to be maintained to be useful. So it it is more like a reservoir than a faucet.
It would actually be OK for a couple people to go swimming and even pee in the reservoir. Some people could even boat in the reservoir, if they went out of their way to make sure that their boats are clean, safe, no pollution, etc. But lots of places just have a general “don’t go in the reservoir” rule. Not because a person would damage it, but because everybody doing it would.
It is hard as a residential user to use enough water to damage the reservoir, but hypothetically if you managed to, somebody would check in. Even if you are paying, the town doesn’t want to run dry. If there is a drought, residential users might be asked to use less water.
Price doesn’t work as a signal in corporate IT for individual workers, because it is expected that the company will “subsidize” the worker to the extent needed to do their job. If we want to make the analogy work—at least in some areas, landlords are required to provide water to their customers. In that case, you can use as much water as you want for free, but your landlord will get curious and might find some way to get you on the hook if you pass some reasonable threshold.
You can also do some things as a user like dump toxic waste down your toilet. This would be sort of like running a publicly visible unpatched XP system on the network. It would damage the system, and why do you have that in the first place?
Anyway, that was fun to write, but I don’t know that it is particularly useful. In order to make the analogy fit, we need to bring in as much complexity from the water management system as the IT system has.
Sure you can have all of these. They're just not offered as part of normal utilities. Nobody will care if you build yourself some, except maybe for petrol pipes due to fire/explosion risk.
If there's an xls which has been in regular use for more than 18 months, and it contains macros, then it can be assumed it performs some important role and should be properly documented and checked and could also be rewritten in a "real" language and officially supported. Set up a meeting with whoever made it, and whoever's touched it most. Approach it more like "we're improving your cool thing" than "we're taking away your toys".
Many years ago a company I worked for used to send out a spreadsheet to its suppliers which they would complete with the products they offered and then when it was received back there was a button in the spreadsheet that would automatically upload the data to a central database.
When I first saw this I was curious how it worked and did a bit of investigation - turns out there was VBA behind the button that established the database connection and uploaded the data. What was amusing was that the user had hardcoded the database connection string including username and password. Of course this wouldn't work outside of the firewall - but I'd be careful about letting people get too crazy.
The reality of the situation is with proper IT support, there could be compiled Excel Addins which provide API connections to core systems such that proper authentication also takes place. But that requires a first step by IT. Either that or authentication via a web server to get a temporary connection string. Either way, it requires prior infrastructure.
They exist because they work. You want UX or business analysis? You literally just got that done for you for free if you run into a Excel/VBA application. The hardest part of dev is figuring out requirements, so stop looking at these as toys and start realizing that shadow IT exists because of a gap in development. Full stop. You can argue all day long that you're working your assess off, and you do great products, but the existence of these apps is empirical proof that IT has missed the boat on developing something of importance.
Use that.
The moment IT touches your stuff, your job transforms from solving problems to writing emails and having meetings.
Any change, no matter how trivial, takes dozens of emails, dozens of meetings, and half a year to orchestrate.
If IT wants to help solve more business problems, it needs to fundamentally change its self-concept and purpose away from "prevent hypothetical bad things from happening at all costs" and move it towards "solve more business problems".
You might as well become an immigration lawyer and spend all day begging the government to explain why your latest M-10582-9DJVA-V isn't being processed in the normal time frame, even though it was stamped in triplicate and sent by Certified Mail with a full-color copy of every identification document you own.
The best way to deal with IT is to avoid depending on it ever in the slightest way. If you give it an inch, it will take a mile.
Example: Imagine a CI/CD pipelines using notebooks.
I hate Jenkins/Hudson style build systems so much I could just spit. I just want to run a shell script.
(Alas, I haven't had the gumption to try this idea out yet. Soon.)
These are probably not impossible to solve for notebook-style, but there are not many efforts to solve them or they are not even acknowledged as problems.
Edit: There is Pluto for Julia that attempts to solve the state-problem. I have not used it in practice though; I've given up on Julia, in large part because Julia community tends to be even actively hostile towards "stateless" development.
By "stateless", I'm assuming you mean functional programming paradigms of immutable, idpotent, and no side effects.
FWIW, for build pipelines, my quarter-baked notion is to use ZFS snapshots (or equiv).
I'll check out Pluto for Julia.
As you know, state is a challenge for "serverless" too.
I've been reacquainting w/ RDBMS tools. There are a few new strategies (implementions) for change tracking. Back in the day, we just banged the rocks together (ook, ook), so I'm very eager to learn the new hotness.
Immutability and idempotencency are good, and related, ideals too, although I think these can get too "unergonomic" if taken too dogmatically (like in Haskell or Redux), they should be used with almost goto-level discretion.
Of course there's the clear (short term) usability benefit of maintaining the memory state in that stuff doesn't have to be recomputed. But we can have that benefit and be stateless with pure functions and memoization. I quite often whip up a buggy and brittle ad-hoc solution to do so. There was also the IncPy project [1] that did this more rigorously, but it hasn't been updated in 13 years.
In general I'm a bit baffled why pure function memoization is so rarely used or proposed. Despite the old adage, cache invalidation is not actually half of the three hard problems in CS. With pure functions it's trivial.
Another baffle is why snapshotting/change tracking (and compressing) file systems haven't caught on. Instead these tend to get implemented badly in any sufficiently complicated application.
Also the "higher-level side effects" apply more or less identically to REPL development.
I wasn't even thinking about REPL style work. Mea culpa: I don't actually know how jupyter et al work, so I'm talking out my hat.
Your explanation reminded me of "prevalent" persistence (vs full orthogonal persistence). I guess I assumed something like that was happening between cells.
I suppose it's analogous to the transition of UI frameworks.
Bad: Mutant components directly.
Good: Mutate thru event queue. Get undo/redo for free. Debugging still sucks.
Better: Pretend it's a simulation and use an entity component system. I think this is what the kids are calling "reactive".
> pure function memoization
Answering just for me: because I'm just a simple bear.
I've been imperative for so long, continuations, currying, and lazy eval break my brain. Yup, a fully functional world would be a lot more simple. Maybe it's time for me to revisit clojure.
Thanks again. This is fun to think about.
But this may not be good for anybody in the long run. For example it tends to lead many students to not understand basic concepts, like variables. Which is understandable because variables don't behave like variables in notebooks (e.g. the same variable in the same notebook may refer to different values in different cells depending on how they are run). For many students this can cause almost insurmountably wrong mental models (which they will of course carry to "production" later on).
But as I argued in another thread here, it doesn't have to be this way. E.g. Pluto does notebooks in a more rigorous manner.
Almost all "software engineering" languages and tools makes getting started and actually getting something done quickly needlessly difficult. Probably uncontroversial that git UI is a total mess, and things are getting even worse with more build tools, dogmatic static typing and general pointless ceremony.
Even though it's a visual environment, everything is strongly text based, from HTML to CSS to JSON payloads.
Don't get me wrong: I'm not bothered at all when a couple analysts get together and hack away at their own little tools in VBA. Kudos to them for getting into the spirit of things, and maybe they will understand my day to day better as a result.
What does bother me, is when these analysts suddenly expect my systems architecture to somehow accomodate their private projects in whatever capacity. When I ask for documentation (there isn't any), an architectural overview (nope), or even access to the repo for that abomination (access to a what now?).
Because, why shouldn't their spreadsheet inject data into my processing pipeline? Why shouldn't I write a controller that accomodates whatever tidbits of REST they bothered to watch half a youtube video about? When suddenly I get asked this in a meeting: "What do you mean we need authentication? Why does IT always have to make things so complicated?!?".
So yeah, please, people should absolutely build their VBA, lowcode or whatever tools. I do the same thing, the only difference is, I call them shellscripts, and they live in git repo.
But same as I don't let my CLI tools lose on the production server, I won't let it happen with things that have never even been through one code review.
Did someone give the analysts access to a repo?
Because I'd hazard ~80% of the companies I've seen don't allow "non-development" users access to the corporate version control system.
And not to make too big a deal out of it, but using github, gitlab or anything along these lines, is mostly free, not exactly rocket science, and private repos exist.
No doubt. But that requires them knowing you exist, and what to ask you for.
The companies I've seen do this well (1) make it self-serve (anyone can click a link, without knowing who to reach out to) & (2) remove as many dumb organizational roadblocks as possible (e.g. company-wide repo visibility and search, no job role filtering to who can use tools, etc).
> but using github, gitlab or anything along these lines, is mostly free, not exactly rocket science, and private repos exist.
Putting internal files on an external third-party service under a personal account?
It solves the technical issue, but it creates some security/data issues.
As if any of those were present in the average web project lol. I complained about those points in sprint review this morning, and this is a big project made by IT companies.
That is very true. And part of that service is to ensure that things run smoothly, securely and according to industry standards.
How well would an IT guy provide that service if he were to let some unvetted, undocumented script hacked together by someone who isn't a professional software engineer, run its merry way across the production database?
Businesses - and jobs - only exist to solve economic problems in the real world. Everything else, including traditional accounting, IT, legal, and HR functions are just there to make the real work easier, not harder.
You come off as condescending and remind me of why I (ex dev who joined our business department) dislike our IT so much and do my best to encourage shadow IT where I can, while keeping sane best practices around CI/CD, security and testing.
I'm so fed up seeing working Excel solutions cobbled together over 2 weeks, that served business well over years with 0 incidents, get replaced by shitty cloud apps that cost millions to build.
Happy to. Problem is, that API has to be built, and tested, and vetted, and maintained, and who's going to do all that work? Because I know a lot of software devs, and none of them lack for tasks.
A lot of people pushing shadow IT "solutions" wildly overestimate their own ability, while maintaining garbage-tier information security standards. That doesn't sound like you, but it's the far more common situation those of us in "IT" are forced to protect the wider organisation against.
The "Circle of IT" is real. Small companies start out nimble, but then stuff gets crazy and someone decides to standardize it all under one department. This works for awhile, but eventually this organization becomes so useless that it can't serve any functions of the business anymore, so a shadow IT group is built that the business SMEs love as they just "get stuff done". This works for several years, but the executives in IT hate this "rogue" group as it is a constant reminder of their incompetence. Eventually they re-absorb this group and crush them with beauracracy until it all starts again.
I am not here to talk about management-bureaucracy, of which IT depts; same as all other branches one can find in established corporate culture, have more than enough.
I am talking about the perceived "bureaucracy" of us tech guys here, aka. following established procedures to ensure smooth running of mission critical systems.
Yes, I want things to run through code reviews. Why? Because these things go to a production system that our customers (and thus the companies income) depend on. Yes, I want authentication standards. Why? Because there are a gazillion cryptolockers, and worse, out there, who would love nothing more than to run rampant on a nice and juicy production database.
If yes to the first, you’re a unicorn in an ocean of IT departments that do nothing but block.
Indeed I have a customer focus.
My customers are the people and businesses who rely on the fact that the production servers run smoothly. And I serve their legitimate business needs, among other things, by not allowing some gung-ho hacked-together unvetted magic spreadsheet to kill runtime performance by performing a blocking query with deep joins that forces the DB server into running a full scan over 10E9's of records.
Again, as I said elsewhere, I have nothing against non-IT departments building their own private software. I do the same. But as soon as this software wants to touch the prod-server, or any other part of the infrastructure I am responsible for, it is my job to ensure they meet the same standards as everything else in the stack.
And yes, saying "No." when it is appropriate, is part of that job.
And look, i have nothing to go off but the justifications and choice of words in your replies. But in my experience this attitude of "high priest protecting the gates of production from barbarians(company staff)" is strongly correlated with obstructionist IT departments that everyone resents and tries to work around, and chokes the company. Resulting in the creation of the shadow IT mentioned in many other replies - because IT doesnt serve the customer needs of the employees. You might not care , or see that as your job, but thats exactly the problem that so many threads on this post are discussing.
That's the answer that I give immediately after the "No."
Look, I get what you are saying. I am not trying to keep people away from the capabilities they need to improve how the whole show works. The problem is, what people in my business "guard" are often complex, critical systems, which themselves don't always meet the standards that their "guardians" would like to implement (just ask about legacy software :D). We have to say "No." and we have to enforce standards and procedures.
Because there are a lot of really clever people around in tech, and clever people love to tinker. And that's wonderful! That's the entire spirit that got me into this biz! Take a problem, and build a solution.
But things have to work. And they have to work tomorrow, and 2 years from now. And they have to be safe, they have to be compliant with a gazillion regulations, they have to pass audits. They have to be patched, they have to be maintained. And all that still needs to happen even after the guy who built them leaves the company. And they have to work for many many many people who are not tinkerers, who just want to click a button on their phones, and rightfully expect the whole shebang behind that button to "just work".
That's why there have to be people who say "No." from time to time.
If that happens indiscriminately, and without a care about why these clever people tinker up their solutions, then that's not good, I fully agree.
They're talking about those that play all the management games and add little if any value. Those that have a title like Senior Developer who can't write basic code. Those that can't understand the basics of their jobs and can't support the systems they're supposed to. Sure they might make the overall company more secure as a result of their behavior, but it's a byproduct and not the intent. It makes being a business SME a living hell as there is always so much friction to just doing anything on your computer. We're probably all venting a bit collectively.
I can't count the number of integrations/projects I've already dropped because I asked a few follow-up questions and never got a response. Any business that actually wants to follow the law and reduce the risk of massive data loss or other embarrassing cyber event needs to screen things, ask questions, and sometimes prevent one very smart person from setting up an undocumented rube goldberg machine that will drag down an entire team if they leave and it breaks.
Not saying that isn't normal (been there, done that... thanks FINRA), but that's the reason.
The core data should sit behind some kind of service that enforces legal, compliance, and security policies.
Then tools that access the data in a compliant way should be given a lot of flexibility for what tech stacks they use to process the data.
Without shadowing it, I couldn't get anything done. I have to install new (open source) software or packages more or less every day, but IT would expect me to wait for a week for some bureaucracy for each package. IT fights me getting a computer with a specific GPU although it is required to use a library that I need. IT forces a reboot of my laptop in a middle of a conference presentation. IT blocks me from sending Python source code files over email. IT makes my computer boot to take ten minutes. IT forces me to use OneDrive that often simply doesn't work.
Maybe the abomination is not the private projects? Maybe it's the systems architecture?
This happens in physical security as well. It's rather common to have door accesses set up so that a person may not have access to go through a door, but can access both sides of the door from other routes. But there was a door-based access policy so nobody is to blame.
Sadly the main concern in many/most organizations is to avoid getting blamed for bad things, so rather than actually trying to prevent bad things, a lot of effort is used to just dissipate the responsibility away.
Also happens to me. OneDrive sucks. It can't even generate proper zip files. Any zip files over 2GB or so I download from it shows as corrupted when I try to extract under linux. IIRC is because OneDrive puts some invalid flags in the files.
OneDrive sucks and organizational structures that buy OneDrive sucks and the company that produces it really sucks.
You wouldn’t ignore an excel produced by a competent ceo or cfo (those that know all the shortcuts), so why, instead of helping ppl refactor and release their work properly, you gaslight them as incompetent just because they are not IT?
If they want to play with whatever tech tools to get their job done, have at it. They can ask for help when they really need it.
But if they are taking short cuts with the security of the data, that needs to be cracked down on immediately, as they are putting the entire company in jeopardy.
Securing some data is very important. Some data indeed shouldn't exist in the first place. But for a lot of data it matters very little. Most security breaches have rather mild consequences.
Treating all data as megatopsecret and all security breaches as end of the company produces not only unproductive systems, but bad security.
It shouldn't be a spreadsheet. The IT departments should democratise the tools which devs use, so even end-users can use modern tools for the job at hand. Then popping a user-made tool into your processing pipeline would be fair enough, and code can be collaboratively maintained. In the end, just as IT wouldn't want SMEs making changes without their knowledge, SMEs wouldn't want IT changing their core system without their knowledge either.
In my opinion, the more people who know and understand the core systems, the better.
Edit: for what it's worth, I do use github (https://github.com/sancarn/stdVBA), but you won't see nearly any versions of any corporate codebases, why? Git doesn't work great with VBA spreadsheets at all. I'm not going through a 10 step process to upload the updated file to the github repo every time I update a macro in a spreadsheet. This is why on-board git is important.
Then we can write programs in Go/Rust/etc and run them in office or wherever.
VBA is to corporate environments what JavaScript is to the web.
I have already built my own code interpreter in VBA to make Lambda syntax possible: https://github.com/sancarn/stdVBA/blob/master/src/stdLambda.... so I know it's definitely possible, just haven't figured out WASM yet...
I was hired by the head of Market Risk Management, whose job was to make sure the bank didn't lose too much money on any given day. He hired me because he did not trust the officially approved IT department to write the code to implement his algorithms. One example: they got something wrong because they did not understand mathematical precedence operations, like multiplication over addition.
So one need was to get all the trades as input to the market risk calculations. This was early 2000s, and I installed Apache with Perl CGI on a PC under the desk, and created a little app for the traders to enter trades and track their positions. The traders started favoring this to the official IT solution because it was easier to use and see their positions.
All of this to say, yes, figuring out how to bypass IT is an important function in a lot of corporate environments.
And back to Excel: the traders used it for all of their calculations and simulations. We tried to work with them by giving them tools that plugged into Excel so they could leverage it along with what they were already doing.
This is probably one of the best ideas out there. If companies built a bunch of Excel Addins to leverage business systems, that would be revolutionary for many businesses.
My main issue is that unlike VBA, I can't program it from right there in Excel. Sometimes I don't want to start up a full-fledged add-in project that's meant to be reused. I just want to run a quick-and-dirty script once to fix something right now. I discovered Script Lab (https://learn.microsoft.com/en-us/office/dev/add-ins/overvie...) while writing this, so maybe that'd help.
Microsoft Script-lab will allow you to do just that. https://www.microsoft.com/en-us/garage/profiles/script-lab/
The other issue: it is not trivial to share an addin to end users. You need to publish it to marketplace or sharepoint. Sideloading requires SMB server and GPO. However there is an option that is not mentioned anywhere: it is possible to embed it in a document and it will install when it is open for the first time (after user confirmation).
Yeah, that's pretty much a deal-breaker. On top of the obvious thing: can "add-ins" be installed by unprivileged users, without involving the IT department? Can they be embedded in the spreadsheets? A "no" to the former is a real deal-breaker, but a "no" to the latter also hurts adoption. Nice thing about Macros and VBA is that, security settings notwithstanding, every instance of Excel is capable of running them out-of-the-box, without making the user install anything extra.
Edit: Another big issue with OfficeJS is you need to be able to host a web server. That's not usually something most end users have access to...
Any tool with a good ecosystem (tools/libraries/integrations) which allows you to get real work done is useful.
Visual Basic as a desktop app development system (or MS Access which added DB benefits) was very useful in a large number of scenarios. And when you outgrew that, you must have had enough money to pay to scale up to a "real" solution.
Without a doubt, a HUGE TON of money has been made using VBA based systems.
From my own experience (as a mostly-outsider finance dev), my biggest Excel/VBA rewrite was for a company that made $$$$ before, during, and after 2008 doing credit default swaps. Sure the Excel workbook took 5 minutes to open (before I rebuilt it), but VBA was doing a lot of heavy lifting. And the people with the knowledge were making big bucks for the company and themselves with bonuses.
This is really a lesson. Whether the tools are ideal or not, what matters more is if they are accessible to people not specifically trained to use such tools. Again, that's why Python has become #1 outside the client web browser. It doesn't mean the tools are the best, but it means they do the job and are accessible.
Python is pretty and I say using spaces beats using curly brackets, begin/end or if/else or other block marking strategies
Experience is also knowing that pretty or not has some subjective component to it
VBA evolved in "harsh" conditions, which kind of explains some of its weirdness though.
But even that isn't why it's popular. It has the most robust data science tools available which has created a steamroller effect and decent web frameworks in Django and Flask.
Python has also replaced Java as "the first learning language" at many universities.
So there are many reasons for it's rise in popularity. VBA not so much.
VBA gives users options. If you want a straitjacketed 1990s predeclared OOP language, you can use Option Strict and Option Explicit and forbid Goto statements and On Error statement. If you can deal with ambiguity, you don't need to.
And of course even a a language with misfeatures is better than the VP of the IT Dev Silo giving you the choice of spending $2m and a year or doing your work by hand.
It's full of bizarre quirks, like <i>control characters in code</i> that are localized.[1][2] Want your code to run on non-English installations? Better dynamically build all of the strings that are passed to that type of function using placeholders like Application.International(xlDecimalSeparator), making your code much less readable. When code breaks for this reason, it does so with incredibly unhelpful errors, and it is literally impossible for the developer to reproduce unless they know it's a potential problem with VBA, and then they have to switch their interface language to one they potentially don't even know to reproduce the problem.
In Word, at least, probably half of the most useful functions (insert a paragraph after the current one, etc.) will break if you use them on the last paragraph in a table cell, requiring tons of spaghetti-code workarounds.
Want to pass around a string of text that contains multiple formats, the equivalent of referring to the innerHtml property of a DOM element? Good luck with that, unless you want to do it all using hacky scripted-select and copy/paste.
Someone in a parallel thread compared it to Bash, and I actually agree with that. No one should be writing anything complicated in either language.
[1] https://stackoverflow.com/questions/20652409/using-vba-to-de...
[2] https://stackoverflow.com/questions/29832281/vba-range-funct...
VBA in my experience has too many quirks that can't be wrapped in a less-quirky general purpose function. For example, I was just working in Word and was reminded that as soon as tables come into the mix, the order of text in the document is no longer linear in terms of numeric range values. E.g. text might have a greater numeric offset value in the document than text that visually appears after it, if the first text is inside a table. I've had Word VBA get confused about this, and extend a search loop outside the range I gave it to search within and start returning content in other parts of the document. Why would I trust a language like that for anything important?
MS should really have just gone forward with a .NET replacement, IMO. C# is one of the best things they've ever invented.
Also so many people fail to understand why the spreadsheet is so convenient to end users, and as a result of this failure - provide sub-par UIs which actually make thing more difficult, not easier.
Sometimes one has to make a step back and understand that grannies did things right, even though they didn't have graphical UI - business was still running back in these early days, and actually what businesses need for most of the time is tabular view with options to do reactive functional calculations on top of it. Ask your SME friend and he'll confirm it.
I looked it up -- VBA=Visual Basic for Applications.
And speaking of HTML, there was also VBScript, which for me is inextricably linked to classic ASP.
- you have to buy it and justify the expense, but your company already pays for Excel - if it's FOSS, then your cybersecurity will want to scan it and demand you fix every single "critical" CVE, but they don't dare block the use of Excel - you have to run it on a server, so you need to buy a server as well, but Excel runs on desktop machines and you probably already have a network share, too - the server will probably be locked down tight and have no access to other servers, while Excel running on desktop machines has the level of access of the user running it - the IT will try to lock down the server-side installation and grant you as little rights as possible (please submit an enhancement ticket if you need to change the data type of the column), but they can't tell you what you can't do in VBA
I'm not an SME, I work in IT myself, but the amount of self-inflicted hurdles in modern enterprises is staggering. I run a large team that develops ETL jobs, and I needed a database to cross-reference tickets vs jobs vs source systems vs releases vs subteams, because of course no existing system knows all this. Ended up running this in Excel with some Powershell scripts: one to scrape JIRA, another to scrape Airflow, the other to access the target database under my personal account and download the list of tables. Still easier that doing it by the book.
a) I'd be forced to complete a painstaking task "manually", and likely committing the occasional error in the process, not to mention all the time I'd have "wasted"
b) In the case of "optional" tasks (whatever that may mean) I'd have had to give up on whatever functionality/feature VBA enables and some level of detail/sophistication/speed would thereby be lost.
To get a bit more concrete in terms of use cases, any spreadsheet task involving a bill of materials or having to do with stock management is probably ripe for some VBA enhancement. I am aware that it is looked down upon by some, but advising against VBA in favor of Python or some other "proper" tool that calls for an IDE is a bit like telling someone who wants to take up home cooking to get a fancy Japanese chef's knife set plus a sharpener instead of the good old all-purpose knife he is certain to have lying around.
I work in a role that develops air gapped custom communications system, my title is engineer - and to that end I have a broad cross domain knowledge - including traditional system administration tasks. I have to go thru special justification to get local admin to install software our company makes. T
here appears to be a future that will prevent me from using a thumb drive to move our software and configurations from my work PC to our systems - when we ask IT for a solution, they tell us "us the approved file sharing mechanisms" - which are basically limited to OneDrive. On top of all of that, per the written policy, we regularly violate written policy - for example distributing software requires LOB executive permission - which in the context of our larger company would be CEO level - and this is just one glaring example.
IT is either clueless or doesn't care and no one outside of my LOB cares - or is aware - and nothing will change until security policy prevents a major project from delivering on time.
From a job security perspective it makes a lot of sense.
That's the “Nobody ever gets fired for buying IBM” idea.
We're doing 'the cloud' wrong, rather than it being a way to leverage BYOD and easier access to information, we're going the opposite way.
And I know that feeling. I had a job once where if you wanted to install a text editor, not only did you need permission, but someone from IT dept had to come to your desk and install it themselves. And this was at an ordinary mid-sized private company manufacturing nothing special.
All you can do is starve these companies of support, by leaving as soon as you discover such attitudes, and encourage any other devs there to do the same.
But, no, because I otherwise love my job, also where would I go?
I work in a tech company and the IT department is like that. The worst part is that IT/security is separate from the operational branch, and they don't care if it impacts our projects. Even though we are the same company, it seems they only care about their own profits (we get billed), we probably would have better service going to competitors, but we can't (obviously). We lost contracts because of it.
I have a ticket open about MX Resolution failures on outbound email to a certain subset of customers - IT keeps blaming unspecified configuration errors on the customer side, not a misconfiguration in our infrastructure. If they gave me a RCA and told me what was wrong, I'd be happy to go to the customer and tell them what's wrong. They won't do that though, nor will they open up a ticket with our vendor to resolve or investigate the issue on our end.
That's exactly the problem.
Here is a personal anecdote.
Our customer wanted us to setup a development/test machine. Because the software had some real-time constraints, we had to use a CPU with enough physical cores and a customized Linux distribution, accessible through SSH with a remote desktop, it didn't need direct access to neither our corporate network nor the customer network. Essentially, what we needed was a computer with an internet connection and root access for at least one member of the team.
So we setup to talk with the customer to decide on the various requirements. We forwarded them to our an IT security department, and they essentially replied with "this is not a standard configuration, do it yourself". I ended up making the plan myself, had it checked with some guy at the IT security that happened to be cooperative and after a few back-and-forth on some details to make sure it was fine, I started to set up the server. At the same time, my manager made sure we had a spot to put the computer in the server room, all good. We essentially did it all by ourselves, and the customer was ok, I wouldn't say "happy" because all these exchanges with IT security took way too much time. All that was needed was for the IT guy to plug in the machine and configure the network.
Then it went downhill. They first stated that they couldn't let us have our own computers in the server room, only VMs. It was not only completely inadequate due to the real-time requirements, but the price was absurdly high, like hundreds of euros a month. Plus, it is not what they told us earlier.
So, we insisted. They then sent us someone who was probably an architect of some kind and started to suggest some ridiculously complex architectures with a dedicated router, firewalls, etc... when all we really needed was an internet connection with no special privileges (something the customer has already agreed with). Not only it would have cost thousands just for the study, and who knows how much for the actual setup and maintenance, but it came with annoying restrictions.
In the end, we told the customer we couldn't do it, so they did it themselves and we did the dev and tests we had to do on the customer machine. Needless to say, the customer didn't really appreciate the whole affair, and we got dumped.
What we probably should have done, and I have seen it many times is to get a regular consumer-grade DSL/fiber plan just to work around the IT department.
Later, I used to be Django developer, and I think it would be even harder to deploy and maintain.
The only inconvenience I recall was some functions had tedious API, arrays/lists were hard, had to be created like kinda Collection.new(...).
Imagine what people would do if VBA was a better language and had a better IDE that wouldn't scream at you every time it found a syntax error in your code-in-progress.
VBA is built in. That is the reason.
Its the same reason emacs users use elisp.
Good article.
What it doesn't mention is the versatility and value the combination of VBA and the various MS Office applications brings to the table for small and medium businesses.
Translation: VBA, as a tools for SMB's, can make them money.
VBA is often discusses in terms of Excel. However, it is available --and very useful-- across the entire MS Office suite.
Over the years we have used VBA for applications ranging from engineering to business. From automated code generation (generate Verilog FPGA code based on easy-to-maintain data entered into Excel) to financial analysis and projections (example, Bass Diffusion Model product evaluation).
One of the most fun applications I remember was using VBA to create a training application for dealers and customers using PowerPoint. We created a full simulation of this device (control panel with buttons and an LCD display), using VBA to run the show. This was super easy to distribute to our dealers, required no installation and everyone could run it. Of course, today it would make more sense to build such a thing as a web app.
Still, VBA makes such things accessible to lots of people. You can use it with Excel, Word, Access, PowerPoint, etc. As a tool, it is useful and convenient. Most people could not care less about the, often pedantic, opinion us engineering types can have about such things.
As a software engineer I wish something like Python was a first-class citizen across the MS Office suite. I know they are slowly making this happen. I haven't looked into it for a while. It seems MS wants you to have a subscription to Office 360, which is a nonstarter as far as I am concerned. I could be wrong.
There always seemed to be an assumption that you would empower the user with tools.
I suppose VBA does that to an extent, but it seems like we haven't moved the idea forward in 30 years.
I'd like to say it's because it's 'good enough', I suspect it's more a hold over from an earlier time that hasn't been eradicated yet.
Don't get so emotionally invested in tools because they're just tools at the end of the day.
The business doesn't care what tools are used so long as they do their job.
Also, knowing how to navigate a convoluted tooling systems ensures your job security, so why are you complaining again?
Because a job that would take 15 minutes turns into a 3 hour task. It might surprise you but some people actually enjoy their job and ticking off tasks :)
Many of these people do not think about themselves as developers. They have primary responsibilities outside of IT structures which usually means that "more professional" tools are not available to them.
They invested substantial amount of effort to learn the language and are locked into the platform because everything they know about programming, every tip, every trick, every solution to every problem is all about Windows, Excel, VBA, etc. and they would have to essentially start from scratch if they wanted to do anything else like Python.
I do tend to disagree here. It really depends how invested they are with VBA. Many VBA skills are highly transferrable to Python and other high level programming languages.
I was fortunate to have experience with multiple languages from the start, but many of my colleagues have programmed in other languages other than VBA after learning VBA only to begin with. From Ruby to Python and beyond.
1. The development environment is already installed.
2. The platform does a lot. Being able to program using Office components or program using browser components gives the programmer a lot to work with.
3. The platform extends into a "real" programming environment - VBA is a gateway drug to C# and all the other MS developer tools. Just like learning JS in the browser eventually turns into, can use my JS skills for writing other code on my machine?
Programmable platforms have historically been really important to adoption and longevity in the enterprise. The emergence of REST APIs as features on many web apps fills a lot of this gap for SaaS.
Quite a clever solution they use, I thought.
I implemented a simple XOR based encryption in VBA and it worked.
So, I imagine that's just one of many real world business use cases.
I quite enjoyed the bizarre deep dive into VBA and Excel tho
But the functionality is locked to higher tiers of 365 accounts. So I guess VBA is still the king.
Important to note that office apps and Macro-tools were essential before the Web and Mobile apps became popular. Businesses have to carefully balance between Adopting the Newest tech/fad and Growing their business, and Staffing/skills.
Everyone needs to seriously look at DDD again. You want a product?
- Small team composed of a few developers, one or two SMEs, one or two DEVOPS.
- SMEs teach the devs the domain language. Explain requirements in gherkin language or equivalent.
- Devops hand hold the developers to get it into production. (Devops guy can probably be split between 2-3 teams).
Many SMEs want to work their problem, not code. You're helping them.
VBA is anti-technology. There is no version control, there are no tests, automated integration tests? HAH!
*PS: "You build it you own it" Is wrong. You need a small "meta-programming" team that makes sure the teams have the tools they need to own production without their brains exploding. Perhaps these meta-programming teams can be split among a few corporations - as you don't really need them there all the time.
Huh. I distinctly remember working with VBA-based systems like 20 years ago where that was a massive difference - like, I'd been writing code on mid-'90s VB4 and it had "on error goto" but VBA didn't like 10 years later. But maybe it was specific to one or two VBA-based platforms.
Either way, it was super infuriating since it meant the only non-catastrophic error-handling possible was "on error goto next" and then manually checking error codes.
The writing was absolutely on the wall about Notes well before the Y2K panic. Staying on that platform when the world was passing you by, even if you couldn't get exactly the same functions in Outlook/Exchange or whatever else you slotted in, was foolish and honestly constitutes professional malpractice for whomever made that call.
– 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.
- 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
Which is kinda sad actually.
That's pretty cool.
VBA is terrific for glue code. Back in the day, before the Internet opened up the security hellmouth, ActiveX was pretty great for use cases like yours.
Early '90s, I made an in-house cost estimation app using Access 2000. It'd extract data from our MicroStation (belch!) CAD drawings to generate budgets and bill of materials. Huge time saver.
Here's a modern example:
https://softwareconnect.com/construction-management/planswif...
Cost estimation apps rely on a database of SKUs, assemblies, etc. Every entry can have dependencies, equations, etc. Like "for every 10ft of X, add 1 widget Y".
Super easy to implement with dynamic languages like LISP, where data can be code (macros). Not something Visual Basic is known for. My "one cool trick" was using VBA's built-in "eval" function equivalent.
I ended up leaving about 3 months after it was done but they continued to use it for a few years until it was replaced by a COTS system.
VBA seems like a solid choice compared to where they have their data being stored.
- 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
Huh, fast? Sure, it's fast enough for its use cases, but it is not fast.
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.
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.
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.
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.
Otherwise, you're on your own.
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.
The non-IT staff build those things because they've identified a way for the company to improve itself, but the process for getting what they want from IT is too expensive/onerous, IT has delivered disappointing results too many times, etc. Find a way to meet in the middle, or the non-IT staff are just going to build them in their own shadow cloud account and eventually make the IT department redundant.
There are tons of incredibly beneficial computing improvements that it doesn't make sense to spend IT resources on, because there are better ROI opportunities for them to focus on.
But! That doesn't mean the things they can't handle aren't valuable.
My preferred method is (1) require documentation (using a standard template) on all processes implemented by non-IT (what it does, how it does it, what value it delivers to the company, what the fallback manual process is, etc.), (2) store these process docs in a centralized location, which then becomes IT's backlog, and (3) any change control / regulatory requirements.
The grand bargain is then:
- Anyone is authorized to improve processes, if they generate the documentation
- IT has the authority to force decommissioned of an existing solution *after* they've delivered a working replacement
That seems to align everyone's incentives more clearly on "the good of the company."Getting a viable Minimum Viable Product is all important. If a non-developer can hack that together in Excel + VBA, more power to them.
Going back and rewriting it in a Proper Programming Language after the fact is an acceptable cost, once you have something solving an actual business need.
Most of these things are sheets which perform perfectly fine as-is, with their issues being around long-term maintenance. (Routine platform upgrade break the app, but the platform owners had no idea about the app until it broke for the users. The app didn't really even have an owner anymore because IT was never involved to assign it an IT owner and the author is long gone...)
Yes, it's the old-as-time problem of misaligned interests, but it's the reality in most corporate/enterprise IT and is a strong reason for prohibitions that may seem stubborn to devs.
I, as an SME, am fully happy coding in C#, Java, Rust, whatever! As long as the language is turin complete, is pro-code and versatile enough, I'm all ready to go.
Do note that IT actively chose to develop the solution in Microsoft PowerApps, despite my advising that the solution would be better suited as a web app.
- 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.)
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.
VBA is basically the scripting language of Office. It integrates well with Microsoft Office, and in a business environment, pretty much everyone has access to it.
Are there better languages? Sure. However, it is hard to beat the integration and ubiquity.
And, VBA is a much, much better language than (ba)sh script!
Exception, not the rule.
If there's a third category, please enlighten me
The organisation was using an excel spreadsheet for a bunch of things. The org identied his tech savvy-ness and asked him to add some functionality.
He taught himself VB for this task. I still remember the message he sent me happy he'd discovered functions. I asked him how many lines he had written, he was 3000 lines deep by the time he discovered functions.
He knew this was bad. He kept telling management this was too complex for an excel spreadsheet that is emailed around, and they should hire a developer to build proper solution.
He later left the org for greener pastures and on more than one occasion they contacted him to asking to add additional functionality to the spreadsheet. Each time he'd tell them they should hire a developer to write a real application, with a real database and they weren't interested. So he'd quote some stupid hourly rate hoping they'd go away and each time they agreed to it.
Last I heard, his spaghetti spreadsheet still lives on 10 years later.
We have such sights to show you.
And many Linux users whined for many years after that mess was replaced by systemd and many still do.
It was a bit of a mess indeed, however as the author of the Java port, I would assess the Korn shell scripts were still much better approach, despite the mess.
Reason for the port? Whoever was taking charge of the application wasn't confortable with UNIX and decided having it done in Java was easier for having random external consulting companies develop it further.
Edit: regarding the video embedded in article
The problem is they're an intelligent person falling short of their potential.
As understandable as it is, raging against people around you for their shortcomings isn't going to help you or them. You've got to do the hard and scary work of grinding your way up to get to where you belong.
But like I know that pain. I've been there before. After getting into FAANG there's still plenty of meaningless work but at least the people are smart.