News for hackers. Stuff that matters.
Re:Will VBA Die? (2019) by markus_zhang on Thursday February 27, 2020 @10:57PM (#22440409)
However, it would take a lot of effort to maintain that 30K+ lines of VBA application. But I think that's because the infrastructure at that time was archaic. If it's today you would probably ditch Access for SQL Server and build reports with something more modern.
Re:Will VBA Die? (2019) by kevas on Friday February 28, 2020 @04:24AM (#22441578)
It was extremely easy. For awhile, I used naming conventions to keep everything organized, but then found RubberDuckVBA and there... I found enlightenment.

The codebase was clean and extensible. I built out a standard lib (I/O sync/async, networking, array methods, dictionary class, XML utilities (DOM/SAX). Then built out database functionality that included auto exporting to various formats, many tabs and with optional conditional formatting. Built the UI from the ground up to be async by building all UI components to be ‘reactive’ and have standardized interfaces. Started with just the frame & label and made my version of the modern web design in VBA’s user form. All components were reusable—from buttons, checkboxes, custom filterable drop-downs, tables, and the ability to display a subset of markdown (which allowed end users write their own documentation for the workflows they’d end up owning)

It had standardized parser interface that allowed for quick buildout of a new parser class; same for full pages. The navigation was completely dynamic and handled by the routing/navigation module. The permissions for all users were in a hosted database and the ui would only build out what the user had permission for and nothing more. SQLServer would handle user authentication as it would get the users name from the connection metadata.

I handed over the project a few months back to a former colleague, one who has only been programming for about a year and one who only knew how to do macro recordings. Since leaving, the application has thrived and is used all across the country, supporting hundreds...

Just before I moved on, I started working on a VBA native toy browser that supported basic HTML, but ended up leaving and not finishing it.

One pain in the ass was custom :hover functionality over ui components. Tried a lot... even tried hooking into window messages, but that messed up some async events...

I think I went off topic, but it wasn’t really a problem.

.

Re:Will VBA Die? (2019) by ptx on Friday February 28, 2020 @04:55AM (#22441689)
Did you build some kind of component tree diffing for the reactive UI, like React? Or data binding?

And how did you design the async parts, given that VBA doesn't have first-class functions? Classes and interfaces? Or nested event loops?

Re:Will VBA Die? (2019) by kevas on Friday February 28, 2020 @01:51PM (#22445249)
Vba has classes, enumerated, interfaces, events, collections, stacks, queues, array lists, dictionary, and more.
Re:Will VBA Die? (2019) by ptx on Friday February 28, 2020 @09:18PM (#22448279)
I didn't mean to imply that it doesn't, and I know that it does - but I was just curious about how you built the reactive UI and the async features.

I did some async stuff in VBA recently (with events) and it was a bit of a mess, which I'd like to clean up if possible. VBA has classes but not anonymous classes, and not anonymous functions either, so you can't easily do callbacks. And the error handling mechanism is not great.

Re:Will VBA Die? (2019) by Ididntdothis on Thursday February 27, 2020 @11:53PM (#22440602)
Maintaining VBA code is probably easier than maintaining C code. You have all the tools to structure things nicely. You even have classes. One problem is that you can’t version control Excel or Access code. I think that’s the biggest weakness.
Re:Will VBA Die? (2019) by fbender on Friday February 28, 2020 @02:05AM (#22441062)
I found this gem: https://www.xltrail.com/ – I have not used it yet but from the looks it‘s a great solution to our vicious circle of (no) maintenance at work :D
Re:Will VBA Die? (2019) by lmm on Friday February 28, 2020 @05:23AM (#22441818)
C is a pretty low bar. And yeah, not being able to do version control, diffs, releases, dependency management... it all adds up.
Re:Will VBA Die? (2019) by kevas on Friday February 28, 2020 @02:02PM (#22445335)
I had version control and everything
Re:Will VBA Die? (2019) by lmm on Friday February 28, 2020 @09:45PM (#22448384)
What did your build/release pipeline look like? I'm imagining a lot of that would have had to be custom, just because I've never heard of this being done with VBA.
Re:Will VBA Die? (2019) by pessimizer on Friday February 28, 2020 @09:27AM (#22442966)
I used to use a weird excel extension that I found somewhere that would export all the modules as text and push them to a subversion repo.
Re:Will VBA Die? (2019) by Ididntdothis on Friday February 28, 2020 @01:12PM (#22444904)
I wrote one for Access a long time ago. Worked surprisingly well but it didn’t export queries and table definitions. Should have done that too.