Ask YC: Development-wise, what do you do that's unconventional and why?
I'm interested in how people are running against the herd and why.
A good example of what I mean would be HN's use of tables for layout--it's not trendy.
For myself, I am playing with stylesheet formatting so most things are on one line, which I find faster to get around, and easier to see more at once. Another example is I now rarely abbreviate in variable and function names. I've decided I waste more time remembering my abbreviations than I would spend typing the word.
(
74 comments
| 34 points
| on HN
)
For instance, we have a user service (which controls accounts, sessions, etc and has its own database), a metadata service (which controls what files we know about, what tags they have, etc and has its own database), a file service (which controls the actual binary data of the files and has its own database), etc (we have a few others, but that gets the point across). They talk to each other through REST -- though it could be anything, of course -- to get anything done they might need.
This allows us to scale each service independently, which is great. I'm always surprised at how long it takes folks to move to a SOA.
But, perhaps, the coolest part from an always-hungry-to-try-new-things development team is that having a service based architecture means that we are free from programming language constraints. As long as the language can speak HTTP, we can try it out for a new service or a new client. There's nothing like the feeling you get when mastering a new language. And there's no better way to master a language than write something tens of thousands of people will be using.
So, we have an old front-end built in C#/Mono, we have a couple Rails services, a Java service, our new APIv2.0 (http://api.openomy.com) is written in Haskell/HAppS (which I'm particularly proud of), and now we're writing a client in Scala. And, besides that, we use Perl for some offline scripting tasks.
I think it's pretty unconventional-- but it shouldn't be! I highly recommend going this route.
Using immutable data structures. I've jiggered up some Python decorators to handle the copying for me, so all my setters return a new object instead of mutating the old one.
Writing code that's both Flash and JavaScript. A lot of our product is written in the common subset of both languages, with a compatibility library to paper over differences.
ActionScript classes are syntax-incompatible with JavaScript, how did you solve this? An AS to JS mini-translator seems to be the simplest way, no?
I haven't ruled out doing a mini-translator; this is very obviously a hack, and if the common codebase grows much larger we'll probably appreciate it. (We've also considered rewriting the whole thing in pure Flash, but there're certain user benefits that the dual-language architecture gives us that we're not quite ready to give up.) This approach is "good enough" for now though, so we're hoping that it'll get us to an initial launch, and then we can decide whether it needs a rewrite based on what users want to do with it.
* It's an online bookmarking system, and I didn't add tagging. I found that the UI step to add tags was a bit of a usability burden, and that I never actually used them to find stuff again anyway.
* I wrote it in Perl. Definitely not trendy, but it's fast, dynamic and (with mod_perl) stupidly easy to deploy.
* I rolled my own JavaScript libraries and wrestled with cross-browser issues rather than using jQuery, prototype, or some such. Why? To learn the nitty-gritty details of DOM manipulation and browser compatibility.
* I de-normalised the database from the start. Why? Because it enabled me to build a simple, light and fast object-oriented table wrapper without the overhead of dealing with associations, joins, and so forth. For any structure that does require a table join, I use database views to make it look like it's a simple table to the application.
It separates the engine of the app from the GUI, and the interface between is well defined. I use txt + UNIX Pipes to communicate.
Also, any stability issues and memory leaks don't effect the entire app and I get to avoid all the weird concurrency issues of threads.
It forces me to understand each step of the development process, reduces the overhead of any machine I work on, and allows me to work on pretty much any server, anywhere, using just Putty/Terminal.
Interestingly, I also try to minimize the amount of customization I do, sticking instead with the defaults so I can easily work in new environments. I'm not sure if that's unconventional though.
In the abstract, Ward defines Language Oriented Programming as defining a formal description of the language to develop the type of application in question, and then write the application in that language, and implement the compiler using existing tools.
The problem I see with this approach is that it's rare to know ahead of time what the ideal language for an application should look like. I don't think you're really going to know until you try to develop it. That's how the Arc approach differs. Particularly when you're already working in a language with rich meta-programming/code generation capabilities, I don't think there's any reason to have a strict separation of the phases. Even if you're not using a language with innate code generation, it's still possible to iterate back and forth between writing the application and changing the language/compiler
Keep in mind I haven't read the whole paper yet, or any of the related work, so the methodology might not be as strict as I've presented.
Its stupidly easy to hack together prototypes of functions to test out data structures and algorithms just using perl and the command line. This helps me think more about the structure of the program and less about the syntax of a specific language, especially languages that I'm weaker in.
Once its working right and thought through, I'll use the perl "pseudocode" as a guide to code in the target language.
I use Perl (which, given the number of others here mentioning Perl, seems to not be so unconventional after all). Partly because our codebase is 450kLoC, or so, and almost all Perl. Won't be rewriting that anytime soon. Perl is also very comfortable for system administration tasks. Moreso, in my experience, than Python.
I think a lot more than I code. If I write more than a dozen or so lines a day, it's a heavy day. I am mainly maintaining and extending existing software...so it's often just wrapping my head around the existing API and code. But even when starting from scratch on something, I take a long time to start actually coding, and only occasionally have a blast of productivity where I push out a couple hundred lines in a single stretch. This is somewhat bug-like, but I've never really been able to change. Luckily, as I've gotten better at the tools I use (Perl, JavaScript, and shell, mostly) those few lines of code tend to actually accomplish quite a lot--and the resulting code is usually nice to maintain because it is very short. So, the work does get done...but when I look at my co-founders output, I always feel tiny. He pumps out hundreds, and sometimes thousands, of lines per week...and they all work really well and are often as concise as what I would have come up with (though not always...he sometimes "powers through" and tightens it up later when it becomes a problem, which is a skill I often wish I had).
Also WRT abbreviations and again in algorithmic code: I love to use one-letter variables for 'working' variables. It forces me to reread what I've written and really understand what's going on, rather than take shortcuts based on what a variable name might imply.
Business logic "if the account balance is below $100 send a warning email" code need not apply ... for that stuff I just wade through same as anyone else, although I'm more apt to write code that writes code if I'm faced with a particularly high pile of the stuff.
I use tools like Libero[1] to express service logic directly as a state machine.
I generally try to build and maintain a simulator for whatever I'm working on with tools like SimPy[2] and Spin[3].
I try and use Excel spreadsheets to build mock-up GUI's.
I try and make it so that all database access occurs behind service API's. Before I have the basics worked out I don't even bother with an actual database and instead just use memcached[4] and a file of initial data.
[1] - http://legacy.imatix.com/html/libero
[2] - http://simpy.sourceforge.net/
[3] - http://spinroot.com/spin/whatispin.html
[4] - http://www.danga.com/memcached
Surprisingly, it works well, probably because it discourages us from making those things too complicated. The frameworks/APIs used by those objects have to be clean.
Some of the things he was coding seemed relatively risky (e.g. relying on binding to work flawlessly with a complex, deep nested model - we've had hard-to-debug issues with ssome Flex UI-field binding in the past)
Are you implying poor programming makes one more likely to start a business? That will float like a lead balloon here.
Am I misunderstanding your post, or feeding a troll, perhaps?
The issues with Flex in the past with viewing/editing attributes on a complex parent.child.subchild model are in the past (they fixed the issues). His code was not "bad, difficult to debug" it was "risky" in the sense that Flex didn't support it in a previous release.
When I told him that his code was risky, I said it with a half-serious tone (e.g. half joking). Rereading the post indicates that the tone of the post and the tone of the original comment never carried through. I apologize.
If someone intentionally loudly told me my code was irresponsibly risky and stated my future ambitions for all to hear, I would not be impressed.
- as functional as possible, using classes almost only as namespaces.
- lots of little inner classes as data tuples.
- lots of recursive functions filling in/trimming out containers.
- the 'final' keyword is the best of the lot.
And no standard boiler-plate "patterns" for which the java language is sadly know (and which make java code unreadable, unpleasant, and altogether a horrible experience).
(I'm far from an emacs power user -- also I don't use the interactive toplevel much, and never from inside emacs; instead I throw that sort of thing in run-once junit code in case it becomes a test suite.)
[edit: by which I mean I don't have such a need for properly functional programming with function-as-argument etc. Most of what I do is plain ol' number crunching, paired with threading.]
[edit 2: i.e. "blub" is better. I have to give scala a better look one of these days.]
Still from a 'conciseness' point of view and ignoring all the benefits of closures, first-class-functions, and other goodies, scala still has some serious awesomeness to serve up, especially when navigating the world of Enterprisey Java Libraries: implicit conversions. A good explanation is here: http://www.artima.com/weblogs/viewpost.jsp?thread=179766
There are also some downsides, of course ... I'd say they can all be summed up by the facts that scala is a young language, still evolving, and it is a large language with lots of features (some rather hard to grok at first).
Cheers!
Can we not "rage against the herd" while running with the herd?
Does the direction in which we wish to go need be contrarian?
Am I making any sense whatsoever? :/
Having a good why is the difference between Darwin and a Darwin-award candidate. Sometimes a best practice is best, sometimes it's just a practice.
If the herd is everyone in the world that writes software, then I'm pretty sure everyone here is raging against that (much larger) herd.
I just cannot tolerate the mouse-clickiness of all mainstream IDEs, neither the extreme use of the control+this+control+that of emacs.
My primary reason to get into vim was the promise of short key bindings, very easy text editing/rewriting and no mouse. It fullfilled that promise: my wrists have not hurt again ever.
Only about 40% or so used a big IDE (Eclipse or Microsoft's stuff, plus a few IntelliJ) full time. A few more used Microsoft's stuff for the debugger when they needed it.
Have you tried a trackball? if I use a mouse for a week or so my wrist starts aching, with a trackball none of those problems.
* My wrists used to hurt a lot from bizarre keybindings that use the control key (I used to use emacs a lot), than from mouse usage. Remapping to the caps is no use (strains my left little finger and left upper side of the hand). Remapping to alt (or to the apple key, in a powerbook) helped a lot, but still too many control pushes.
* The mouse slows me down, way more than hurts my wrists.
* I use Blender a lot. Using the mouse for Blender is no problem regarding my wrists. The trick for me is: extend the arm to fully rest in the table, flat, so that the mouse ends up nearly behind the laptop.
edit: Heavy IDE's haven't paid off for me yet. (I like to be familiar with every point of control in my environment. Hidden configurations have given me more headaches and stress than my personality can afford.)
Devil's advocates could certainly say I just haven't spent enough time learning IDEs.
I would respond with tangent rant about the virtue of owning ones means of production which includes knowledge. Knowledge ownership seems more obtainable when you must know how to do everything from the ground up.
a) Everything in one tool. Your servers can be right there, you have your code, your repository is directly connected, etc. b) It is actually is pretty good. If it wasn't so bloated I would use it. c) It is easy to train people to use eclipse, debug in eclipse, its all visual. d) Loads of plugins, again all in one tool.
Cons would be it commonly eats up over a gig of ram. It is slow. An expert in emacs can probably do most tasks quicker than an expert in eclipse.
In order: Edit multiple documents: Multiple buffers with buffer menus, buffer-name completion, etc. Syntax highlighting: See font-lock-mode Multi-level undo/redo: See emacs undo. Emacs does lack in the redo area though... Directory tree view window: See dired Find and replacs: C-M-$ or if you like regular expressions, M-x query-replace-regexp column mode editing: See rectangle manipulation commands in emacs. Natural word wrapping: See auto-fill-mode Spell checker: See flyspell-mode and flyspell-prog-mode which only spell shecks inside comments and program strings. User tools and macros: See elisp: One of the most advanced programming languages, integrated right into the editor. Furthermore, comint can be used to call any other program and manipulate output. Etc...: See emacs packages.
Etra: A complete programming language instead of the restricted macros in Crimson. Since elisp is turing complete, practically anything is doable, programs like GNUS, etc...
So... try emacs and see if you like it.