5 ms·
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. I
by markus_zhang 7y ago
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.
- Ididntdothis 7y agoMaintaining 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.
- fbender 7y agoI found this gem: https://www.xltrail.com/ 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
- lmm 7y agoC is a pretty low bar. And yeah, not being able to do version control, diffs, releases, dependency management... it all adds up.
- pessimizer 7y agoI 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.
- Ididntdothis 7y agoI 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.
- kevas 7y agoIt 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. .
- ptx 7y agoDid 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?
- kevas 7y agoVba has classes, enumerated, interfaces, events, collections, stacks, queues, array lists, dictionary, and more.