News for hackers. Stuff that matters.
Re:Microsoft 3D Movie Maker Source Code by svag on Wednesday May 04, 2022 @02:39AM (#31257427)
This is interesting at the bottom of the readme file

  Jez also offered this interesting BRender anecdote in an email:

  When Sam Littlewood designed BRender, he didn’t write the code. And then document it.  
  The way most things were built at the time.
  First, he wrote the manual.  The full documentation
  That served as the spec.  Then the coding started.
Re:Microsoft 3D Movie Maker Source Code by samlittlewood on Wednesday May 04, 2022 @05:54AM (#31258448)
Some more detail on this:

The starting point for BRender was a sequence of software rendering experiments that grew from 'never doing it like our hand coded asm real mode x86 renderers ever again'. There were various diversions, eg: an achingly beautiful plane sweep that only rendered the visible parts of each output scanline, whilst murdering the cache so comprehensively that there are likely still lines waiting to be filled even now. Fortunately, to get the FX Fighter team going with something stable whilst debugging continued, I knocked up a Z buffer implementation, and was given a sharp lesson on caching when it blew all the previous attempts away (notably with consistency of performance).

Arriving at this point we figured there might be a product in it and looking at our own interaction with other libraries, it was clear that a manual was key to this. If I remember correctly, the API was a negotiation between myself proposing designs, and Crosbie Fitch documenting it - pushing back with ways to make things easier to explain.

It worked out very well, and we took it into later Argonaut hardware projects. The hardware guys had enough tools to do frame capture and replay from various games/apps at a low level, so were not desperate for a full software stack. The clients had very particular views about how APIs should look, depending on planned uses, in house style, compatibility etc. We would negotiate the API documentation back and forth - including lots of sample code.

This sample code was important, (and BRender would have benefited from more of this). I took lots of real use cases, then wrote proper code to implement them against the proposed APIs and included them in the docs as tutorial and example code. Importantly - they were a representative sampling of the anticipated uses (not just the easy ones), they were not 'handwavy' and included all appropriate resource management and error handling, and they had to read well on the page. As the API negotiation continued, so the examples and tutorials got updated.

This process also had the benefit that we only started investing in client specific software development once the project had got enough momentum (typically committing hardware NRE).

Re:Microsoft 3D Movie Maker Source Code by LeonM on Wednesday May 04, 2022 @06:55AM (#31258793)
This is what I love about HN. Somebody quotes an almost 30 year old readme file, and the person mentioned in the readme chips in to tell the full story. Thank you Sam!
Re:Microsoft 3D Movie Maker Source Code by reflectiv on Wednesday May 04, 2022 @06:10AM (#31258521)
I really wish software was written this way these days.

These days I am always being rushed through sprints barely knowing what is going on.

What you described sounds like a wonderful way to actually engineer a great API.

Re:Microsoft 3D Movie Maker Source Code by samlittlewood on Wednesday May 04, 2022 @10:07AM (#31260622)
It is! Although what I missed out from above is that whilst the API and it's documentation is the deliverable - we would, to the best of ability, try and minimise risk whist developing it. Eg: by doing small performance experiments, drawing on prior experience, thinking about the evolution of resources within the API whilst writing samples, and looking at how other APIs handle similar things (but be careful - they may have had to perform heroics to achieve their behaviour).

Whilst the official progress is top down, the duck's feet are working hard feeling along the bottom to check for obstacles.

Re:Microsoft 3D Movie Maker Source Code by giancarlostoro on Wednesday May 04, 2022 @08:22AM (#31259461)
I feel like sprints should be more relaxed: "Oh you might bleed over into the next week? Don't stress, that's fine. Can we help you get unblocked and how?"

Just because you say you want it in 2 weeks does not make it so. Don't over promise, you will be severely disappointed. Software breaks, it does not care for deadlines.

Re:Microsoft 3D Movie Maker Source Code by tylermac1 on Wednesday May 04, 2022 @09:00AM (#31259779)
This how my team functions. It's such a refreshing work experience. Estimating work is hard, we shouldn't be punished or feel bad when we're off a bit.
Re:Microsoft 3D Movie Maker Source Code by hiccuphippo on Wednesday May 04, 2022 @09:39AM (#31260209)
That's kind of the way I write APIs, albeit at a smaller scale. First write the code of how I want to use the API, then write the the actual API. I remember a talk from the developers of the Python requests library mentioning this same process.
Re:Microsoft 3D Movie Maker Source Code by reflectiv on Wednesday May 04, 2022 @09:43AM (#31260269)
Yes, I do this too...its a different thing when you are talking about your own insular project or something at a smaller scale.

The thing I was talking about was larger scale projects like the ones mentioned by the author (of the sort I work on at my day job) where you have teams of stakeholders and outside influence combined with a desire to release rapidly in an iterative form.

Software these days is just done differently in those contexts...we can't slow down enough to do what was detailed above...I just wish the world was sorted in a way or slowed down enough to do REAL engineering.

Re:Microsoft 3D Movie Maker Source Code by grishka on Wednesday May 04, 2022 @12:50PM (#31262934)
I kinda work this way on my personal projects: first I come up with a rough idea of the UX, and only then do I start implementing it. The desired UX ends up driving the decisions about the implementation details and technicalities — not the other way around as it often happens in much of modern software. And I, of course, disregard the time component.
Re:Microsoft 3D Movie Maker Source Code by kingcharles on Thursday May 05, 2022 @02:21AM (#31270184)
I seem to remember BRender being one of the highest-performance software renderers of the day. I used to talk to Jez on Usenet and he offered me an interview at Argonaut (I was 16 I think) after I showed him my hand-coded x86 renderer. I don't think I was doing any real mode by that time, though. I can't even remember what effect running in real mode would have outside of the memory limitations? You can still access the full 32bit registers, right? (been 25 years since I coded x86).
Re:Microsoft 3D Movie Maker Source Code by samlittlewood on Thursday May 05, 2022 @06:09AM (#31271501)
There were three similarish software renderers around at that time, BRender, Canon Renderware (Adam Billyard), and Rendermorphics RealityLab (Servan Keondjian). There were also some renderers out of the demo scene that were definitely faster (but often with perf. related limitations).

The code was mostly C, with some protected mode x86 for inner loops. Prior to that point, all our PC games had been real mode x86- and BRender was a result of moving away from that.

Re:Microsoft 3D Movie Maker Source Code by kingcharles on Thursday May 05, 2022 @08:12PM (#31279696)
Yeah, I was coming from the demo scene side, although my code ended up in an Eidos game.

I dug into the released BRender source until I found the inner loops, then I "Nope!"'d all the way out and remembered why I never went back to assembler.

Thanks for the memories. I'm glad the code survived all these years until it could be released.

Re:Microsoft 3D Movie Maker Source Code by ArtWomb on Wednesday May 04, 2022 @09:18AM (#31259960)
"hand coded asm real mode x86 renderers"

a more elegant weapon, from a more civilized age, may the forth be with you ;)

Re:Microsoft 3D Movie Maker Source Code by Arrath on Wednesday May 04, 2022 @11:03AM (#31261479)
> ...whilst murdering the cache so comprehensively that there are likely still lines waiting to be filled even now.

Very evocative writing, I love it.

Re:Microsoft 3D Movie Maker Source Code by CrosbieFitch on Sunday May 08, 2022 @04:41PM (#31307959)
Is this really '4 days ago' as of 8-May-2022?

If it is, "Hello Sam!"

Re:Microsoft 3D Movie Maker Source Code by CrosbieFitch on Sunday May 08, 2022 @05:16PM (#31308219)
Anyway, from my recollection, it was a case of me wanting to produce a C++ API/wrapper around the C API, and realising that the extant documentation wasn't quite sufficient for me to do so (to fully grok what went on underneath the C API enough to produce a C++ wrapper). Therefore, producing a more thorough technical reference manual seemed to me to kill 2 birds: I'd obtain a sufficient understanding, and so would the customers. Thus although Jez was right that the manual came first, the process of producing a more thorough TRM gave rise to Sam's observations.
Re:Microsoft 3D Movie Maker Source Code by samlittlewood on Tuesday May 10, 2022 @03:25PM (#31331456)
Long time! Maybe we should wait until Dan back over, get the old gang together, and see if we can finally agree on a restaurant.
Re:Microsoft 3D Movie Maker Source Code by CrosbieFitch on Friday May 13, 2022 @04:40AM (#31364860)
Well, if the restaurant is in France, that's a possibility. ;-)

I still remember winning the 'Bog Roll d'Or' for being last man standing in the Phall eating competition.

Oh, and the Yaohan Plaza (aka Oriental City, Hendon).

Re:Microsoft 3D Movie Maker Source Code by ChicagoDave on Wednesday May 04, 2022 @10:55AM (#31261341)
This sounds a lot like Domain-Driven Design. Model first. Test with code. Validate with scenarios. Repeat.
Re:Microsoft 3D Movie Maker Source Code by mkreis on Wednesday May 04, 2022 @04:28AM (#31258043)
That reminds me of Amazon's method "working backwards": https://www.productplan.com/glossary/working-backward-amazon...

You start e.g. with a press release and then make your way backwards to the user stories and backlog.

It's a very useful approach to think big and focus on the problem instead of the many little issues that need to be solved.

The problem is that programming is still knowledge work. That means you can not specify everything beforehand without doing the actual work. (Like writing a novel, which can not specified before.) The solution would imho be a good balance between description the big picture/desired result (good) and spec'ing out every little detail and screen in advance (bad).

Re:Microsoft 3D Movie Maker Source Code by indigochill on Wednesday May 04, 2022 @08:24AM (#31259480)
I remember seeing a programming tutorial that used this approach as well fairly early in my software engineering education. I want to say it was part of the SICP MIT course but I could be confusing it with something else.

It was pitched as something like "wishful thinking programming" IIRC. First you write the highest-level "business logic" code that you want to write with made-up constructs that have no implementation, then only once you've established that it feels good to write code using those constructs do you implement them.

I remember this also being the same approach that was used in a CPU-building course I took (NAND 2 Tetris): start with the instruction set, then implement it.

Re:Microsoft 3D Movie Maker Source Code by dr-neptune on Wednesday May 04, 2022 @09:17AM (#31259948)
Wishful thinking is mentioned several times in SICP, both in terms of to be implemented functions and in separation of concerns.

Oftentimes in the book, they will write out a function with reliance on a variety of other functions that haven't been written yet, but which show a blissfully declarative outline of exactly what the function does. Then you go and write the sub-functions.

Looking at the code after is quite nice, but it takes a bit to wrap your head around writing large swaths of code that can't run -- especially when you're used to writing REPL-driven code and consistently checking/"testing" it

Re:Microsoft 3D Movie Maker Source Code by astrange on Wednesday May 04, 2022 @07:19PM (#31267139)
This is an actual advantage of test-driven design; unit tests are bad for their stated purpose (they aren't good at testing things and are expensive to maintain), but because they make you write clients for your APIs before implementing them, you actually have some hope of knowing they're useful.

I think you should consider writing unit tests before coding but then delete them and then write regression tests after. Though, haven't tried this approach yet.

Re:Microsoft 3D Movie Maker Source Code by dusted on Wednesday May 04, 2022 @03:48AM (#31257829)
I've done some hobby projects this way, of course I've allowed myself to go back and adjust the documentation where the implementation would be easier or simpler from only slight alterations of the workflow.

It's been very pleasant, and allowed me to make good sense of what I was doing and where I was going.

Re:Microsoft 3D Movie Maker Source Code by johnchristopher on Wednesday May 04, 2022 @03:20AM (#31257674)
Right now, at work, I am getting insane with a task of re implementing some web forms that talk to shinier API. No documentation "just read the previous ruby server side validation code and put it on the js front-end". So I am hunting for hints and people to to be sure the code does what it intended to do. And I get cup sized eyes when asking for documentation :D.
Re:Microsoft 3D Movie Maker Source Code by kolme on Wednesday May 04, 2022 @03:31AM (#31257737)
That's the _worst_ kind of specification. "It has to be like the old one, but with this differences".

That means you have to study the old code, which is of course poorly documented and probably buggy; and then try to reproduce it in a sane way.

Re:Microsoft 3D Movie Maker Source Code by exikyut on Wednesday May 04, 2022 @03:39AM (#31257780)
Alternative idea: keep running the same Ruby code.

- https://github.com/ruby/ruby.wasm (compile Ruby to WASM)

- https://mame.github.io/emruby/ (example of Ruby compiled to WASM)

- https://opalrb.com/ (compile a subset of Ruby to JS)

This requires downloading several MB of code (and then caching it in-browser) so would be ideal for internal-only stuff.

Re:Microsoft 3D Movie Maker Source Code by johnchristopher on Wednesday May 04, 2022 @04:21AM (#31258000)
Pretty cool. (I changed the languages for privacy reasons but your solution still stands)
Re:Microsoft 3D Movie Maker Source Code by exikyut on Wednesday May 04, 2022 @04:59AM (#31258185)
Ah, well even if it's some super-obscure or internal thing, if it compiles down to C that doesn't mind POSIX you might still be able to Emscripten-ify it!

(Part of my thinking with this solution is to broadcast "you are asking me to do something that requires a solution this complex to wrangle the problem space effectively" to try to fend off similar inanity in the future, admittedly, perhaps I'm being a bit optimistic/unrealistic heh.)

Re:Microsoft 3D Movie Maker Source Code by cfn on Wednesday May 04, 2022 @03:28AM (#31257718)
You are lucky, I am reimplementing CRM functionality on a web api by looking at SQL Server Profiler!
Re:Microsoft 3D Movie Maker Source Code by smaudet on Wednesday May 04, 2022 @01:23PM (#31263357)
Why wouldn't you reach for a decompiler first?

I guess perhaps you are working with some very obfuscated code, still if you are black box profiling code it might make sense to crack open that box as much as possible. Unless what you are working with is DRM-level "performs like cow dung in a blender" horrifically inefficient, I can't imagine it is obfuscated that badly.

At any rate, hopefully you are paid well for it, reverse engineering is difficult, to say the least.

Re:Microsoft 3D Movie Maker Source Code by cfn on Wednesday May 04, 2022 @02:09PM (#31263864)
They have the source code but they need someone to sign off, etc, etc (I am an external contractor) and meanwhile I started by doing what I could and now am nearly finished. Decompiling the old app would be hard because it is a VB application.
Re:Microsoft 3D Movie Maker Source Code by teh_klev on Wednesday May 04, 2022 @06:34AM (#31258643)
Holey moley, that's just plain cruel.
Re:Microsoft 3D Movie Maker Source Code by johnchristopher on Wednesday May 04, 2022 @04:21AM (#31258002)
Haha, wtf :D.
Re:Microsoft 3D Movie Maker Source Code by avgDev on Wednesday May 04, 2022 @09:12AM (#31259894)
We had an application running a business for 10 years. It started printing labels incorrectly. There was a bug in the code. The source code provided for the application was at least 5 years out of date. Documentation was null. Additionally, the variable names were TextBox1, TextBox2....etc.

I decompiled the app, documented the UI and which variable is what. Rewrote the whole app. It was quite painful but good learning experience. I would love to do another one.

Re:Microsoft 3D Movie Maker Source Code by Cthulhu_ on Wednesday May 04, 2022 @03:47AM (#31257822)
Yeah I'm doing the same thing; I get by well enough with trying to read the old code and playing around with the old user interface, but there's hundreds of fields and thousands of features that I have to go through one at a time. Most validation is just a regular expression though, easy enough to port.
Re:Microsoft 3D Movie Maker Source Code by walski on Wednesday May 04, 2022 @04:26AM (#31258028)
The concept of "Readme Driven Development" [1] seems similar, but smaller in scope. I've actually found it very pragmatic/productive to, especially for smaller libraries, start with writing the Readme.

1: https://tom.preston-werner.com/2010/08/23/readme-driven-deve...

Re:Microsoft 3D Movie Maker Source Code by magpi3 on Wednesday May 04, 2022 @03:31AM (#31257735)
This is an amazing, amazing skill. Do any university classes teach programmers how to think like this? Can it be taught?
Re:Microsoft 3D Movie Maker Source Code by dranka on Wednesday May 04, 2022 @03:43AM (#31257801)
It sounds a bit like the Waterfall model. It became highly unfashionable in the 90s, maybe even earlier.
Re:Microsoft 3D Movie Maker Source Code by buescher on Wednesday May 04, 2022 @01:11PM (#31263198)
It's really more of a proto-agile approach! I've never done the manual first personally, though I had a boss that had been on a project run that way early in his career who always wanted to do things that way again. The idea is to skip distilling requirements into specifications, engineering documentation, and user documentation. Instead you gather requirements AS user documentation, and only work backwards from there as necessary. Sort of like skipping all the specifications to V&V activities in a traditional systems engineering approach by writing tests first in test-driven-development.
Re:Microsoft 3D Movie Maker Source Code by dranka on Wednesday May 04, 2022 @02:48PM (#31264343)
My comparison to waterfall was a reductionistic take on the specifications up-front before coding starts aspect. If comparing it to the full waterfall process then it is definitely a fresh take!
Re:Microsoft 3D Movie Maker Source Code by swarnie on Wednesday May 04, 2022 @03:44AM (#31257809)
This is pretty much how we were taught in college 15 years ago.

Actually implementing something is left to the final 30% of a project. One must first bore themselves to death with design and documentation before a single line of code is written.

Re:Microsoft 3D Movie Maker Source Code by IshKebab on Wednesday May 04, 2022 @05:27AM (#31258337)
And then discover that the entire foundation of the design can't work because of some critical logical flaw you didn't think about...
Re:Microsoft 3D Movie Maker Source Code by samlittlewood on Wednesday May 04, 2022 @09:40AM (#31260222)
Something I missed above is that either prior, or concurrently, there will be performance experiments to check that things are staying sane, but these do not contribute to the later software development (except as a reference) and are likely not consistent with each other. The deliverable at this point is only documentation - getting it good as possible without any concern for impact on existing implementation. The goal is to get as far up the slippery pole as possible - inevitably things will slide back over future version iterations.
Re:Microsoft 3D Movie Maker Source Code by jussij on Wednesday May 04, 2022 @10:34AM (#31261026)
That describes most software design and development to a T. The reality is you'll hardly ever get the design right the first time around.
Re:Microsoft 3D Movie Maker Source Code by swarnie on Wednesday May 04, 2022 @06:36AM (#31258657)
Yep - It was a pretty flawed methodology all told.
Re:Microsoft 3D Movie Maker Source Code by nitrogen on Wednesday May 04, 2022 @07:41AM (#31259137)
It's only flawed for beginners. With 10 years or more of experience, it's possible to design successfully based on that experience.
Re:Microsoft 3D Movie Maker Source Code by badsectoracula on Wednesday May 04, 2022 @08:17AM (#31259424)
It is flawed for (otherwise) veterans too if they are trying to do something that they haven't done before so do not know what they do not know.

This really only works if you have done the same or something very very similar before and so you have practically no unknowns. Notice that the developer who did that commented above that they had already done similar work at the past.

Also related this quote about how Joe Armstrong (of Erlang fame) approached problems (from [0]):

> Joe wrote amazingly simple programs and he did so in a peculiar way. First he wrote down the program any old way just to get it out of his head. Then once it worked he would then immediately create a new directory program2 and write it again. He would repeat this process five or six times (program5, program6, ...) and each time he would understand the problem a little better and sense which parts of the program were essential enough to re-type. He thought this was the most natural thing in the world: of course you throw away the first few implementations, you didn't understand the problem when you wrote those!

[0] https://github.com/lukego/blog/issues/32

Re:Microsoft 3D Movie Maker Source Code by IshKebab on Wednesday May 04, 2022 @11:48AM (#31262130)
Sure if you're writing a similar program to one you've already written. But then it's just agile on a longer time scale!
Re:Microsoft 3D Movie Maker Source Code by HidyBush on Wednesday May 04, 2022 @05:00AM (#31258190)
I mean, it's not really an amazing skill in my opinion. What's amazing about writing a high level explanation of how your program works, maybe with a few simple diagrams to show the reasoning behind it, and then writing a more detailed specification of what the program should do? It's basically a more comprehensive version of first writing the flow chart of your program in pseudocode with attached comments and then implementing it.
Re:Microsoft 3D Movie Maker Source Code by magpi3 on Wednesday May 04, 2022 @07:27PM (#31267199)
It's easy to do it, but I have never really heard of anyone doing it successfully like this. Most programmers come up with a basic plan and then just start coding it and things evolve from there. As the saying going, "a battle plan never survives contact with the enemy."

I'm incredibly impressed with programmers that can visualize a large program and the end product actually resembles what they originally envisioned. That is a gift.

Re:Microsoft 3D Movie Maker Source Code by llampx on Wednesday May 04, 2022 @03:37AM (#31257770)
Can that really happen with Agile, which means requirements can change or new requirements can come in at any time?
Re:Microsoft 3D Movie Maker Source Code by OwlsParlay on Wednesday May 04, 2022 @06:07AM (#31258503)
You'd still start off with requirements - documentation - code, it's just on the understanding that any of these can change.
Re:Microsoft 3D Movie Maker Source Code by withinboredom on Wednesday May 04, 2022 @04:06AM (#31257929)
Sure, why not. Just change the documentation first.
Re:Microsoft 3D Movie Maker Source Code by Narann on Wednesday May 04, 2022 @05:40AM (#31258390)
By some aspect this is how you write an API.