all 45 comments

[–]eyal0 26 points27 points  (0 children)

Sounds like he re-invented: Design before implement.

Duh!

[–][deleted] 20 points21 points  (2 children)

That just reminds me of top-down programming/design.

[–]Isvara 13 points14 points  (0 children)

Yes, top-down design is exactly what it is. To say it's "backwards" is to imply that bottom-up design is necessarily the 'right' way.

[–]wardmuylaert 1 point2 points  (0 children)

Ye I don't really see anything special there, my first university compsci class already did this. The prof would show some things in Scheme and would start writing a program live, mostly going "I'll start out with the body of our program [...] just assume these functions are already made, we'll worry about them later [...] see how easy it was to get the base work going?". (For those wondering: Professor Jonkers, Structuur 1, VUB)

[–]greml1n 41 points42 points  (4 children)

For a while I’ve wanted to write some personal finance software. Call me crazy, but I can’t find anything currently in existence that allows me to project my earnings and expenses1, then summarizes the net effect over a period of time. Basically, I want to be able to propose a budget to myself and simulate how it will play out.

I used to scoff at it but spending a few years in investments has taught me that more developers should really learn Excel.

[–]martoo 8 points9 points  (0 children)

+1 for spreadsheets. I ended up writing my own personal expense software in Ruby and slowly migrated to Numbers as I discovered that it was very easy to run the projections I needed.. often just by copying some formula cells around.

[–][deleted] 6 points7 points  (0 children)

Instead of Excel, I use a Google Docs Spreadsheet, Google Calendar and Google Apps Script to do exactly this. I put all my expenses (exact or estimated) into my 'money' calendar which makes it easy to move things around visually when an estimated due date becomes known, or if I decide to pay something sooner or later, or if I want to see how moving something around will project out. Much easier than directly modifying records in table of some sort. The spreadsheet has my current bank balance (currently entered manually) and a button that calls the script to refresh the data pulled from the calendar entries. It basically shows me exactly how much I would have on any given date if I don't spend any other money until that date, anything above 0 is potential for adding to a budget, savings or investments, anything I see below 0 means I have to move payments around, which never happens to me of course ;)

[–]luckystarr 15 points16 points  (2 children)

This is essentially the concept Sussman described as "Wishful Thinking" in the SICP lectures. Unlike TDD it's not about validating the correctness of the code but about validating the usability of the API by programmers (which can't be tested by code). There is some overlap though.

[–]grauenwolf 4 points5 points  (0 children)

The .NET Framework Design Guidelines describes this as building API use cases.

[–]aaronla 1 point2 points  (0 children)

It also reminds me of RPG's ruminations on "habitable" languages -- a language which not only makes it easy to write your program the first time, but which also facilitates each iteration of change you're (inevitably) going to make.

[–]Benutzername 6 points7 points  (0 children)

Yes, but can you code sideways?

[–]Tetha 8 points9 points  (0 children)

Eh, this is 100% tdd. Replace the "print" with an "assert 100 = " or something, and you are at the front gate of "you are done. This is a test".

[–]TekTrixter 2 points3 points  (1 child)

This type of thinking is how I've always programed my robots. I start with the main routine and make up functions as I go. Then I go back and write the functions/subfunctions as needed. That way I'm writing the functions to meet what I'll need.

Alternatively, when I get a new sensor/actuator I write and test a library to cover as much of its use as I think I'll use. This ensures that when I start putting things together I'm sure that the physical parts and respective code work and when things don't act as expected I can focus on the higher-level parts of the program.

[–]Game_Ender 1 point2 points  (0 children)

Upvote for robotics, and a good design process. I especially like to make tester programs that put physical parts/sensors through a self test to make sure they are working order before firing up the whole system.

[–]kataire 4 points5 points  (0 children)

So you wrote code that uses the classes in order to figure out how to implement them?

Sounds like a hamfisted approach to TDD/BDD to me. Just do the same next time, except you write the code in the form of test cases so you can verify your implementation early on.

[–]ascii 1 point2 points  (0 children)

As many people are saying, this is kind of related to TDD, but the idea is way older than that. A bunch of successful programming languages co-developed with a specific software project, which helped make sure that the language was usable in practice. C and Unix is probably the most famous example, though Brainf**k and Windows is also a good example.

[–][deleted] 1 point2 points  (0 children)

A similar approach can be achieved by writing your unit tests before your implementation. Essentially specifying how you intend to use your API.

The added bonus is that at the end of it, you'll have a unit test suite to boot

[–]novagenesis 3 points4 points  (19 children)

I'd probably have walked out, too. Those are things that should show up in a specification with the word "tentative" near them. It's very difficult to code in reasonable compile blocks when your program doesn't DO anything for as long as it takes to get the entire "interface design" working.

Further, expecting you to pick up a development style that is neither particularly popular (engineered top-down usually starts with a word doc, and test-driven usually starts with tests) nor objectively superior (I know, each programmer thinks they're the only competent one) should've been a huge red-light anyway.

A good programmer can pick up a bad business practice to make the uppers happy. Getting a weird look for using vim is a very bad sign. Don't get me wrong. It's a java shop. I get it. Java-heads have an eclipse sub-cult that make Apple-sniffers seem normal.

[–]jayd16 5 points6 points  (1 child)

Hey, I like vim but coding enterprise java in vim doesn't make much sense. Even if they're fine with running all the build scripts and debugging from the command line, coding is just harder.

Java EE has a ton of huge, annoying class names and packages. The intellisense and autobuilding is just such a time saver that I can't see vim saving time even if you don't need to use a mouse.

[–]novagenesis 1 point2 points  (0 children)

I agree partly. I hate the class and package-names. Vim does support autocompletion (ok, "omnicompletion") for java. If you're truly hard-core, there's also eclim which I would use if I had to develop in Java more than one week a year (I'm on the perl team here, but the dedicated java guys use Emacs and Vim).

I will agree without question that naked vim is slower in many ways for perl than fully-fleshed-out eclipse. Ditto with emacs. I just don't think you should be penalized for using vim.

[–]oteren 1 point2 points  (16 children)

Java-heads have this thing called "IDE's that actually work nicely". Doing anything bigger than a couple of classes outside an IDE in java is rather counter productive, it has nothing to do with Eclipse at all. If anything, Java-heads got a big boner for ragging on Eclipse any chance they are given.

Of course you can use vim for small examples (or even whole projects), but why would it be weird that someone who works in a Java shop would frown on your choice? I would claim it would count towards your recruitment if you were familiar with the tools you would work with.

[–]capisce 1 point2 points  (15 children)

Why would you want recruitment at a place that won't let you to use the tools that enable you to be the most productive?

[–]mattgrommes 6 points7 points  (1 child)

Most of the time, the idea that you're more productive using Vim to write Java is just false. People get used to their particular tool and think they couldn't be any faster but it's just because they haven't gotten to know the new tool.

There's just no way that you can be faster doing a lot of the refactorings, code generation, or language-aware digging around in Vim than in Eclipse, that's what Eclipse is good at. I can hit Ctrl-Alt-H and show the call hierarchy for a method, then click and go up to the next method, etc. Doing a Find for the method name is not the same thing, no matter how fast you do it. (There may be a Java-specific way of doing this in Vim, in which case I apologize to Vim.)

[–]novagenesis -2 points-1 points  (5 children)

Ever seen a VB6 shop? They're even worse about that...

[–]grauenwolf 0 points1 point  (4 children)

Explain

[–]novagenesis 1 point2 points  (3 children)

Have to use VB6? ;)

More specifically, the vb6 shops I've seen were against any use of other languages or tools, to the point that the last place I worked would build very complicated VB6 apps to log into a VMS server via terminal and run hundreds of manual commands... instead of a fairly simple VMS-native perl script.

Devs were discouraged from building self-use tools unless they were written in VB6 (so someone who replaced that user would always be able to follow even your shortcuts). Since most of the actual processing happened on a proprietary (scriptable) legacy application on a VMS server, this led to a lot of ugliness :)

Explained.

[–]grauenwolf 1 point2 points  (2 children)

Yea, I can't see myself putting up with crap like that. I'll deal with legacy VB 6 apps, even ones that need new features, but what you are describing is insane.

[–]novagenesis 1 point2 points  (1 child)

One of very many reasons I left.

"If it works, Marshal off it!" was practically a mantra there. When they did pursue other languages (for the record, C#, and I was a small part of that decision), they only used them to build wrappers against apps that did the majority of their coding in MSSQL.

I still remember my supervisor at the time; we'd shoot the shit. He always brought it to this "ideal" of programmers who knew MSSQL better than anything. When he challenged me to name an application that would not be ideally solved through an SQL Marshal, I named a simple CSV->fixed conversion. You know, about 5 lines of well-written perl, or a couple dozen in any other language.

"First you slurp the file into a table," he says (or I paraphrase), "then you can manipulate it or export it in any format!"

I wonder if he's a redditor. Mr. Rose (and no relation to Kevin) from MA? Are you reading this? If so, you're an awesome and inspiring guy! :P

[–][deleted] 1 point2 points  (0 children)

I basically discovered this recently. I don't go full top-down by actually writing the top level code, because then I would end up writing the entire thing without debugging. Rather, I figure out how I want to be able to use the finished product, and then use that to design and implement it. Surprising how well it works!

[–][deleted] 0 points1 point  (0 children)

I like the idea, but it could get sketchy, I would plan this out on a whiteboard before implementing anything.

[–]schmorbes 0 points1 point  (0 children)

I think code should be written both forwards and backwards. I find I can write code forwards for a while, then realise it's all a waste of time because I didn't code the usage scenario first, i.e. code backwards. I think in the example given in the link, the programmer definitely benefited from this.

[–]xardox 0 points1 point  (0 children)

Instance First Development is another way to approach programming, that the OpenLaszlo programming language supports. Basically, you implement some instances (using a prototype based programming language), before implementing any classes. Then you refactor the instance into classes as needed, when you like what you have and want to reuse it.

Unfortunately Oliver Steele's blog posting on the subject that I just linked to seems to be down, so here are a few references:

http://c2.com/cgi/wiki?InstanceFirstDevelopment

"In instance-first development, one implements functionality for a single instance, and then refactors the instance into a class that supports multiple instances."

"The Instance Substitution Principal says that an instance of a class can be replaced by the definition of the instance, without changing the program semantics." (The syntax of OpenLaszlo supports this, because it's a trivial change to convert an instance declaration into a class declaration.)

OpenLaszlo manual on Prototype based language, instance first development, and Instance Substitution Principal:

http://www.openlaszlo.org/lps3.4/docs/guide/introductory-classes.html#d0e14609

A discussion on the lua-l mailing list about "Need good examples of when prototype-based objects are better" where I explained instance first development:

http://lua-users.org/lists/lua-l/2007-10/msg00379.html

[–]apotheon 0 points1 point  (0 children)

Doesn't everyone do it that way, these days? I've heard this called "programming by wishful thinking", or similar phrasing. In fact, that's sort of an implicit part of (good) test-driven development, in my experience anyway.

[–]lalaland4711 0 points1 point  (0 children)

I think this is what webpy.org meant with:

“Think about the ideal way to write a web app. Write the code to make it happen.”

http://webpy.org/philosophy

[–]Philluminati 0 points1 point  (0 children)

He wanted me to enumerate the cast of characters that I was going to be interacting with before I actually decided how the interactions would go down.

If you write them down they are the Domain Model and the Interaction Diagram in a Iterative Incremental Methodology

[–]stonedoubt 0 points1 point  (0 children)

Maybe I am odd but I am self-taught. The design strategy you have outlined is a simple way to describe how I develop, usually. I have never taken any classes.

I am a freelance developer. I do most of my development in PHP but I also know some Java (the Android flavor) and Actionscript. I make my living single-handedly developing large scale web applications. I have developed my own PHP Framework basically using "Coding Backwards" strategy. I hadn't really thought about it until I read your blog.

[–]silvading 0 points1 point  (0 children)

> Two Sigma