News for hackers. Stuff that matters.
Re:Applying programming language research ideas to transform... by leibnitz27 on Saturday January 19, 2019 @03:44PM (#18949060)
Banks do crazy stuff with excel. I embedded a higher order functional language natively in excel 10 years back....

http://cufp.org/2009/fmd-functional-development-excel.html

Re:Applying programming language research ideas to transform... by tluyben2 on Saturday January 19, 2019 @03:56PM (#18949112)
Banks, insurers, accountants; I know a company with 100M euro rev per year that runs entirely on Excel with VBA. Their office car park gate is opened, closed and managed with Excel.

It sounds crazy but the CTO is a cofounder and he found it is much cheaper to just do everthing that way. They have been running like that for over 20 years.

Re:Applying programming language research ideas to transform... by vba on Saturday January 19, 2019 @08:52PM (#18950449)
I'm a dev on XL at Microsoft and took a trip a few years back to meet some of our advanced users. I was blown away by their 'accidental' CS education through Excel. They built sheets (debuggers) to debug other sheets (programs) on their OS (excel), and did this not even using VBA.

In my own time, I've visited manufacturing plants where I've seen customers send the factory a spreadsheet containing nothing but a VBA project to exercise a (hardware) test jig for quality control.

This just reminded me that when I was young, I couldn't afford VB5/6, so I would program in VBA in the office products.

Re:Applying programming language research ideas to transform... by lph on Saturday January 19, 2019 @10:33PM (#18950816)
I used to work in the aerospace industry. The engineers had spreadsheets that consisted of three visual elements: Cells for the input and output filenames, and a "Run" button.

It had once been company policy that engineers didn't have compilers or other programming tools on their computers (because "we have programmers for that"). But engineers are a resourceful lot, and they did have Excel with VBA.

Re:Applying programming language research ideas to transform... by cm2187 on Sunday January 20, 2019 @01:51AM (#18951570)
I still find it useful to use Excel as a GUI. I created all sorts of models that takes lots of configuration tables as inputs. There is no faster UI for someone to fill and modify a table than Excel, so all configuration files are excel spreadsheets.

On the “we have programmers for that”, I see another culprit appearing: IT security, who decided unilaterally that everone else in the 100k people organisation only needs Office and are trying to impose security solutions based on that assumption. That includes application whitelisting, or automatically encrypting all office documents (as a result non office programs can’t consume spreadsheets anymore), etc.

Re:Applying programming language research ideas to transform... by m0zg on Sunday January 20, 2019 @02:44PM (#18955140)
>> because "we have programmers for that"

I hope it was long time ago. That's the most idiotic policy I've ever heard. :-)

Re:Applying programming language research ideas to transform... by ramraj07 on Saturday January 19, 2019 @07:03PM (#18950066)
One possibility is this - the people who mess with Excel VBA are generally very smart folk who just never went too techy, but then got really good at Excel and just learned vba as the next logical step. That means the code might not be kosher but it will be thoughtfully written and encompassing all the practical use cases.

Contrast that with a 20something can grad who while competent isn't as smart as that non tech guy, and has indoctrinated the cs way of doing things w.r.t. test coverage and unit tests but often will lack the insight of what the program is actually trying to do. Frankly I would also like to choose the former than the latter.

Re:Applying programming language research ideas to transform... by chii on Saturday January 19, 2019 @08:11PM (#18950317)
I challenge you to make changes to a spreadsheet or VBA program that isn't using modern programming methods like unit testing and version control.

They would turn into a huge mess unless the coder is very diligent and understand every part.

CS 'indoctrination' is not a failure of education. Surgeons have been 'indoctrinated' to know pre-op procedures.

Re:Applying programming language research ideas to transform... by ramraj07 on Saturday January 19, 2019 @09:13PM (#18950503)
CS indoctrination is most definitely not a failure of education. Mediocre kids thinking they are writing good code because they've written unit tests is.

EDIT: Let me explain my thinking a bit more - we can try to categorize software development into two categories:

1. People write messy, unorganized code that is often in the head of just one or a few folks, who are smart but unorganized and often without formal CS training. The code often has almost no tests and doesn't follow any of the standard best practices of software engineering. The code is often impossible to pass down to new people, often ending up forcing the new people to redo a large fraction of the work.

2. People write clean, modular, testable code with good unit and integration tests, a robust build framework, etc. The code is written in a manner thats super easily transferable, most devs don't even have to understand the entire codebase to start meaningfully contributing.

Obviously, the second category is the preferred category. A good SDE with a CS bg should follow (and often do follow) the second method. However, category 2 could, at least from my experience, be split into two sub-categories:

2A. The framework for both the code and the dev ecosystem was laid down by (often just one) really good engineers who think through what the problem really is and make sure that the fundamental structure and architecture of the codebase works towards solving that real world problem. This kind of code is absolute pleasure to work with and extend.

2B. The framework and the majority of the code are written by average engineers; often the first few eng hires in the company put the groundwork and make poor design choices and the engineering team that follows never wants to change anything fundamental because that's "tech debt" which the company can never afford to take a step back and look at. The average engineers have a good heart, but often their test cases never test real-world edge cases, they often don't even remember the architecture of the code they themselves wrote a few months back, and the code breaks all the time. Furthermore, the engineers would generally balk at adding any new feature because the codebase is fundamentally evolved into something that just cannot be extended without significant rework, and often they cant even see how they can rework it to add the required feature. In the end, good SDE practices and testing doesn't do shit if the person who wrote it didn't think hard enough.

Here again, 2A is the preferred method of doing dev, but unfortunately, the thoughtful smart SDEs aren't that many, and would often be found in a well-paid job in a big company. Most regular devs can't step up to that level and the end result is 2B happens.

Now the question is, which is the better of the two evils, if they are the only choices? 1 or 2B? I'd choose 1. My experience has been that while the scrappy code is unmaintenable by anyone new, at the least the guys who wrote it (assuming you can keep them long enough) will at least own up to it and make sure it keeps running, and they can at least try (and practically, generally succeed) to ship a new feature as opposed to the 2B case where often the categorical answer would be no.

Re:Applying programming language research ideas to transform... by rgoulter on Saturday January 19, 2019 @09:31PM (#18950581)
http://steve-yegge.blogspot.com/2008/02/portrait-of-n00b.htm... This point reminds me of "Portait of a Noob". For people who understand what the codebase is doing, it's more effective to have as much code on screen as possible. For "noobs", since you don't know what the code does, less code on screen is better. Additionally, these 'noobs' like more meta-program stuff like type declarations (or unit tests) which don't actually contribute to the program itself, but provide a safety barrier to prevent things from going wrong. (Whereas, if you know what the code is doing and it goes wrong, you can just fix it).

It's fair to say "a program not covered by unit tests can still be good enough to get the job done" (& to suggest that this is under-appreciated), but not having sufficient test coverage significantly raises the barrier to entry for those not familiar with the code ("noobs") from contributing.

(EDIT: I wrote my comment before parent's edit)

Re:Applying programming language research ideas to transform... by nightski on Saturday January 19, 2019 @10:25PM (#18950779)
Is that really true though? Comprehensive test coverage will definitely give the new programmers confidence, but is it justified? Are there really that many software projects where lots of tests instills confidence that changes won't break things?

At the end of the day, unit tests or not - you have to understand the code you are working in. This means new programmers will not deliver features as fast as those who have been working on the project for a while. They are going to need to learn the code base regardless of whether it has tests or not.

Re:Applying programming language research ideas to transform... by ramraj07 on Sunday January 20, 2019 @12:17AM (#18951302)
There was a post on HN about Oracle's DB2 code being completely in C and fully unitelligible. Only an insane suite of semi integration tests allows them to maintain it, albeit in the most inefficient way.
Re:Applying programming language research ideas to transform... by tjalfi on Sunday January 20, 2019 @11:08AM (#18953621)
Is [0] the comment you are referring to?

[0] https://news.ycombinator.com/item?id=18442941

Re:Applying programming language research ideas to transform... by Apaec on Sunday January 20, 2019 @12:39AM (#18951394)
I guess this kubernetes piece[0] would be the epitome of n00b code.

[0]: https://news.ycombinator.com/item?id=18772873

Re:Applying programming language research ideas to transform... by cm2187 on Sunday January 20, 2019 @02:00AM (#18951593)
A good recent example of that. We were asking a dev team to build a dashboard (we are a bank) showing capital ratios. The team came back saying voila! We looked at it, and the headline number in bold at the centre of the dashboard was showing a cet1 ratio of 1300% (a cet1 ratio is typically in the 5%-20% range). I am sure they used modern programming techniques, but they left an error that would have shocked even the least sophisticated user.

I have many similar annecdotes. Having a good understanding of the underlying domain and what numbers to expect is critical to writing correct models and too often I see dev teams in banks that have no understanding or curiosity of what they work on.

Re:Applying programming language research ideas to transform... by jrumbut on Sunday January 20, 2019 @10:51PM (#18957507)
This is such a common pathology it does cast doubt on the entire field of software development but I would like to note it's been pretty commonly spread and now many years old best practice to have real users in constant communication and perhaps colocated with developers.

This is a very predictable outcome when a requirements doc is tossed over the wall followed by patient waiting for the output.

Again, it happens all the time so maybe this advice isn't enough or practical or something, but there is a well recognized solution and I would wonder whether it was done in this project.

Re:Applying programming language research ideas to transform... by antpls on Sunday January 20, 2019 @03:41AM (#18951966)
On the other hand, a dashboard is probably one of the most boring stuff to work on when you have a CS degree. Typically, a dashboard is asked as a deliverable to keep the dev team busy while also making sure other people's jobs in the bank arent rendered obsolete if the dev team were used to its full potential.

The people saying Devs dont do enough effort to understand the domain are the same people who try to keep the "domain" overly complicated to justify their jobs/positions

Re:Applying programming language research ideas to transform... by angry_octet on Sunday January 20, 2019 @09:11AM (#18953102)
You're right, a dashboard is a project for when you don't know if they can do anything useful.

I think the fault is actually the split between IT (a support function) and the product group, which often doesn't have/isn't allowed embedded devs.

IT managers are often toxic for delivering, never take ownership, SLA bullshit, too much PRINCE2 and ITIL.

If you can get developers embedded, huge wins are possible. But they have to bring the client with them, not code away in isolation.

Re:Applying programming language research ideas to transform... by nerdponx on Sunday January 20, 2019 @10:24AM (#18953423)
That's because a dashboard is easy (boring) if you code it up right. Whereas in Excel it's wizardry.
Re:Applying programming language research ideas to transform... by gizmo686 on Sunday January 20, 2019 @12:25PM (#18954170)
Still, when you have a team of very smart folk writing complicated bussiness critical software in Excell, it is a good indication that you should invest in training those people in more proper programming languages.
Re:Applying programming language research ideas to transform... by cm2187 on Monday January 21, 2019 @04:10AM (#18958914)
Agree. I am trying to get bankers to learn programming by offering them free courses.
Re:Applying programming language research ideas to transform... by 4thaccount on Saturday January 19, 2019 @04:09PM (#18949187)
It isn't the language for everything, but I've found you can do so much with a spreadsheet and a little VBA. Optimization, graphics, math...whatever.

I also figure the company you refer to has some real benefit by focusing on one technology everyone knows.

But how and the heck do they manage a gate in a spreadsheet?

Re:Applying programming language research ideas to transform... by tluyben2 on Saturday January 19, 2019 @04:21PM (#18949258)
I know about it because my friend (son of the ceo) provided the electronics for the gate and he showed me all the software in 1999 because we were pitching a rewrite in ‘web tech’ (my go to was Perl in those times). The gate software wrote to the parallel port via the win32 api to open and close the gate after the day/night watch entered the numberplate and name into the sheet.
Re:Applying programming language research ideas to transform... by 4thaccount on Sunday January 20, 2019 @07:35PM (#18956617)
That is indeed pretty cool. I wonder how the system works now.
Re:Applying programming language research ideas to transform... by tluyben2 on Monday January 21, 2019 @04:47AM (#18959096)
Last I heard (few years ago) nothing changed; just more was added in the same way. If it ain’t broke...
Re:Applying programming language research ideas to transform... by wenc on Saturday January 19, 2019 @05:46PM (#18949712)
I've done some pretty mindbending things with VBA on Excel.

They work but they are not pretty and not easy to maintain. VBA is technically a "complete" language (I want to say Turing-complete but that is not a meaningful trait), so it is possible to do a lot with it, but one ends up having to re-implement (sometimes badly) stuff found in other languages in order to write the main parts of the code.

Part of what makes VBA deceptively easy is the control over the interactive elements of Excel (a lot of stuff is done with the Range object), but unfortunately that also introduces state that you can't always control, which entails write extra checks to make sure the state is correct before proceeding. This is especially true if your users are on different versions of Excel (I once wrote something in 2010 that doesn't work in 2016).

There are now other options like QueryStorm [1], which lets you write C# in Excel and connect to SQL databases.

There are also a bunch of Python-Excel solutions that are based on manipulating COM objects, but I've learned that when dealing with a Microsoft stack, there are advantages to using Microsoft-native languages like C#.

Coming back to the article, it mentions adding arrays, vectors, and records to Excel itself; this will make Excel much more powerful because it has traditionally been a cell-based computation system, which has disadvantages that higher-level abstractions overcome (like vectors and tables).

It also mentions writing Excel functions in a first class manner instead of relying on a separate procedural language like VBA. Operations on arbitrary sized arrays will also help it transcend Excel's issue of operating on fixed size arrays -- this will clean up a lot of very messy formulas.

These developments will be interesting to watch, because it brings Excel much closer to a true functional computing system, and gets closer to Quantrix [2] territory.

[1] https://www.querystorm.com/

[2] Quantrix is a multidimensional spreadsheet, and a commercial successor to Lotus Improv.

Re:Applying programming language research ideas to transform... by vba on Saturday January 19, 2019 @08:35PM (#18950398)
"but I've learned that when dealing with a Microsoft stack, there are advantages to using Microsoft-native languages like C#."

curious. can you elaborate?

Re:Applying programming language research ideas to transform... by raddan on Saturday January 19, 2019 @09:35PM (#18950596)
You can add custom functions to Excel (e.g., the ribbon) and other Office apps using Visual Studio Tools for Office (VSTO). There’s almost nothing you can’t do once you have C# or other .NET languages in the mix (I like to use F#).

One of my collaborators (Ben Zorn) is one of the people featured in the linked article. We’ve been working on visual debuggers (and other things) for non programmers in Excel for a few years now.

Re:Applying programming language research ideas to transform... by wenc on Sunday January 20, 2019 @03:30PM (#18955397)
There are many little things that just aren't available in Python-Excel libraries, that are available in VSTO.

There are also odd little things that Python database libraries don't implement, like SqlClient.SqlBulkCopy. Native bulk inserting is generally unsupported on Python, so I either have to spit out a CSV and use bcp.exe to bulk insert, or I have to use TurbODBC, a Python library (which has certain limitations, like not supporting certain datatypes like VARCHAR(MAX) or GUIDs).

Re:Applying programming language research ideas to transform... by z3t4 on Saturday January 19, 2019 @04:35PM (#18949329)
I think software is often more complicated then it needs to be. I used to write a lot of vbScript, but now I use Node/JavaScript whenever I need to glue something together. And there are many modules in Node.JS that you can glue together in order to do something useful. I find it even easier then vbScript/Excel/VBA!
Re:Applying programming language research ideas to transform... by tluyben2 on Saturday January 19, 2019 @04:55PM (#18949427)
I am (as a matter of principle) only working on projects which need to run for 10+ years or cannot be upgraded (firmware for very constrained devices) so yes, software is often far more complicated than it needs to be, but writing it in VBA or JS is not helping imho. Carefully designing, typing and formally proving (parts) is what makes me have applications running on cheap servers with basically 10+ years uptime (besides OS security updates) that give me income without work. I run software (SAAS) more complicated and with more clients on one 15 euro per month server than many run on complex aws setups with node/js/mongo. Also with higher uptime; although aws etc can give you 100% uptime, the quality of most software is so bad that it goes down. Ofcourse maybe you are different and take care to make things robust; that is not the common vba/nodejs hacker though in my experience.
Re:Applying programming language research ideas to transform... by z3t4 on Saturday January 19, 2019 @08:22PM (#18950351)
Managing complexity is not so much about the language, it's more about software development process. But I think it helps to use a safe and simple language. Engineers often forget about their own cost.
Re:Applying programming language research ideas to transform... by chris1993 on Saturday January 19, 2019 @08:27PM (#18950368)
I'm fascinated. What sort of software needs to run with ten years uptime? How do you avoid downtime for operating system updates on those cheap servers?
Re:Applying programming language research ideas to transform... by tluyben2 on Saturday January 19, 2019 @10:19PM (#18950757)
A lot of embedded hardware, financial transaction systems, factory critical ERP systems (I built one mid 90s in Clipper which is still running in that place; actually I built a few which are still mission critical at this point in time).

But, less hardcore, also my own projects; picturepush.com and flexlists.com for instance have been running for > 10 years making me money. Flexlists was hacked / down once because of a stupid fix gone wrong (just winged it before taking off in a plane). I have many of those; downtime etc will cost me literally money and clients. But running it multi-region AWS etc will cut massively in my margins and, as I see in the many companies I do c-level interim/consultancy for, it really actually results in more downtime at most companies because more moving parts.

OS updates I carefully study and only do them if they expose an exploitable issue. Which is almost never the case as most exploits actually require server access. The mentioned hack was my own fault and showed me that I must use the demands I have for the systems I write for clients also for myself. I am redoing my applications (some of them) in C#, F#, TLA+ and Coq at the moment.

My goal as an engineer is to only need to update the frontend to current standards and let the rest be untouched. I have managed so far.

Re:Applying programming language research ideas to transform... by jammygit on Monday January 21, 2019 @09:55AM (#18960736)
I've always read that proving correctness and using theorem provers was impractical for real projects. Could you elaborate on how you use those tools and for which situations? I'm actually really curious
Re:Applying programming language research ideas to transform... by jacquesm on Saturday January 19, 2019 @08:41PM (#18950411)
Telco, HVAC, message switches, various embedded systems, alarm systems and so on.
Re:Applying programming language research ideas to transform... by mandeepj on Sunday January 20, 2019 @01:02AM (#18951450)
If you can do something, it does not mean you "should" do it
Re:Applying programming language research ideas to transform... by clausok on Saturday January 19, 2019 @08:55PM (#18950455)
Crazy stuff indeed. I saw a type of "click-once", auto-update deployment for vba code at an IBank in 2000 that worked wonderfully. Excel models built by trading desks and investment banking groups themselves are often constructed under a lot of time pressure and one thing about Excel is you can do it wrong and it may still work reasonably well. I have seen some specialty Excel software teams in these environments that refactored those models and made them remarkably robust and coherent. Much of it is just having the time to study alternatives: what part of the model should be on the sheet in formulas, what part in vba, what part in another language via an xll? What questions are the users going to ask and what calculations do they need to be able to see and understand? Where does the flexibility need to be? If a user moves a sheet to another workbook, will the button on it still work? How do you deploy vba code so that if you fix a bug all the models that use that vba code, and all their 'save as' descendants, run the fixed code.

There are clever ways to answer these questions but if you condescend to Excel as a development platform, and believe you can't build anything great with it, you may never brainstorm enough to uncover them.

Re:Applying programming language research ideas to transform... by stcredzero on Saturday January 19, 2019 @04:21PM (#18949252)
This sounds like a joke, but I actually met a guy in the early 90's who wrote a Quicken/Microsoft Money competitor as a series of VB Excel macros, who then joined in on the Microsoft anti-trust suit, when Microsoft made moves to try and squash him.
Re:Applying programming language research ideas to transform... by quickthrower2 on Saturday January 19, 2019 @06:59PM (#18950055)
YNAB started off as a spreadsheet for sale.
Re:Applying programming language research ideas to transform... by tedmiston on Saturday January 19, 2019 @04:12PM (#18949207)
This is really interesting. I wonder if some people that did this have migrated towards hybrid models? Particularly I'm thinking of something like Jupyter notebooks where charts, tables, and code can live side by side and be iteratively developed in a really tight REPL feedback loop as well.
Re:Applying programming language research ideas to transform... by _the_inflator on Sunday January 20, 2019 @01:38AM (#18951547)
Consider every excel sheet as an app and you are in business. ;)