Best way to scale up a prototype application?
January 26, 2007 12:58 PM   Subscribe

Better to prototype an application and hire someone to port it, or learn C from the ground up and do it myself?

I'm an artist with some programming background. My learning language was Processing. I have some other programming experience but don't feel as confident in any other language. I'm trying to develop a piece of software and processing allows me lots of play in implementing features.

However, for the long haul I think this needs to be running in less of a sandbox. How difficult is porting from processing (java) to the C family? Should I hire a programmer to do it for me once I have the prototype? Or perhaps to build it from scratch once I have a working model of the features and interface? I feel like I could learn C myself but I'm not sure if that's a good use of my time, plus I've always developed faster by hacking up existing code rather than following tutorials.

posted by ndrw to Computers & Internet (12 answers total)
Ouch. Processing is cool, but Java never makes you do things like memory management. The instruction set for C is relatively small, but you need to understand how why and when to delete or free memory, etc etc. Learning C will teach you bunches about computers. Or make you rip your hair out. Actually, both.

My advice is if you want to learn C, do it in C. If not, and all you want is your app ported, pay someone.
posted by YoBananaBoy at 1:11 PM on January 26, 2007

What platform do you eventually want this to be running on? PCs running Windows? Macs? Cell phones? As an applet in a web page?

(And what does your app do? Graphics, sound, what?)

Anyway, learning all the details of how to make your app work in a particular environment is going to be a lot more work than just learning the C language. You are probably best off getting someone with more experience to at least get you started.
posted by xil at 1:15 PM on January 26, 2007

Also, Processing is RELATED to Java, but isn't Java code itself. If you don't understand the distinction, you're going to have trouble.

The Processing environment is written in Java. Programs written in Processing are also translated to Java and then run as Java programs.
posted by xil at 1:17 PM on January 26, 2007

Best answer: I've been programming a long time. The language that I typically use is sometimes considered a "prototyping" language, and in the beginning I would constantly hear people tell me that we were going to prototype in this language and then make the real version in C or C++ later. The real version never came. If something *really* needed to be done in C, we'd port just that part and bring it in as a library. This was very rare, in all actuality, and is limited almost 100% to some math operations that simply had to be a lot faster.

What I'm getting at is, your prototyping environment might be good enough, or nearly good enough, for the final product. You'll have to be the judge of that.

As a developer, I never much liked making a product based on someone elses semi-working product. It's like designing a piece of electronics based on what happens when you turn the knobs on an existing black box. Sometimes the author of the original piece was able to give me some specs and algorithms and what not, and that helps, but it's always much easier, to me, to start from scratch. I can understand why you'd want to prototype though, since you want at least the basic proof that your idea will work.

I have no idea how difficult it is to port from processing to C.
posted by RustyBrooks at 1:22 PM on January 26, 2007

Response by poster: I've heard some of these issues but wanted to keep the question concise. I have plenty of experience going into the java code when processing is having some issues. This is pretty good feedback, and I agree that is better to start from scratch than to take over someone else's project.

Guess I'll just bite the bullet... thanks for the responses, guys!

Also to clarify, its a custom graphics program. I hate flash, hate hate hate it. Any further thoughts welcome, thanks again
posted by ndrw at 1:27 PM on January 26, 2007

Not sure why you want to write it in C... for desktop apps, and for someone with your experience, that's an unnecessarily big bullet to bite.

I'd first look into the ability to Processing to export to .exe, which seems pretty nice from what I've done with it, and then think about porting it to Java, or maybe C# - either would be much less of a leap than C or C++.
posted by tmcw at 1:35 PM on January 26, 2007

Empirical data should inform your choice.

Define what's fast enough. (This will include defining what kind of data make up your expected use cases, both in terms of size and nature.)

Test whether your program in Processing in fast enough.

If it is, you're done.

If it's not, profile your application to identify the bottlenecks and ameliorate the worst bottleneck, possibly through re-thinking data structures, algorithms, or other elements of the design, perhaps through optimizing that piece in another language. Test if it's now fast enough.

Repeat as necessary.

Premature optimization is the root of all evil.

I have two degrees in computer science and 16 years of experience as a software engineer, the first 5 of which were programming in C, and it'd take extraordinary circumstances for me to consider it a good use of my time to re-learn C well enough to want to write production code in it. I expect you might find it's not a good use of your time either.
posted by Zed_Lopez at 1:46 PM on January 26, 2007

I don't think there's any reason for you abandon Processing, expecially with it being so close to 1.0. I would say go as far as you can with it, then wrap the Processing container in a Swing application if you need a native-looking interface. You could hire someone to help with that.
posted by Doctor Barnett at 2:07 PM on January 26, 2007

Best answer: Somewhere along the line you were exposed to this myth that you can only write "real" programs in a very low level language. C is absolutely the worst language to start off a prototype with. Start with the highest possible language that you can achieve your goal with. Then profile it, and find out where it spends its time. Optimize those with a lower level language.

If you want an analogy, C is like an X-Acto knife -- it is extremely sharp, but capable of very intricate and delicate work. It puts the user in total control. If you are not careful and deliberate, it is easy to cut yourself badly. On the other hand, if you just want to cut up some 2x4s to frame an addition on to your house, you'd probably want to use a circular saw or table saw and not a tiny little razor blade.
posted by Rhomboid at 2:07 PM on January 26, 2007 [1 favorite]

I doubt it'd be worth it to port it to *anything*, let alone C. You'd have to reimplement Processing's graphics library, not just your program.
posted by equalpants at 2:07 PM on January 26, 2007

Response by poster: I've heard good things about C#. I'm sure I can handle the bullet, maybe it would be more of a jump from an artist who programs to just a hack programmer. I guess the main thrust of my question was is it worth the time.

If it clarifies things any, I prefer the mac platform. I've also been having a lot of fun with linux. I suppose it doesn't have to be C or C# but I'd rather be working in an application than an applet.

also hopefully w/o starting some flames, I should say that I have xcode already installed.

thanks already for so much feedback
posted by ndrw at 2:08 PM on January 26, 2007

You should look at your audience for this release. If it's a tech demo in a controlled environment, just show them the Processing version. If you need to deploy this to lots of users immediately, you should reimplement in Java and invest in an installation solution like install4j.

I assure you that C is not the language you want to program this in. Especially if you're used to the nicities of high-level languages. While I certainly enjoy hacking C(++) on Unix, I can't imagine using it for rapid prototyping of interactive gaphical software. It's like trying to personally build a bridge in a week using only hand tools.

If you're doing 3D graphics, you might think that you need C in order to pull off sufficient speed of rendering. You're thinking OpenGL, maybe? Have a look at Java3D.

Most of the heavy lifting of the rendering process is handled by OpenGL. Much of it is native code, so it's processing at basically C++ speeds with a bit of overhead for ref counting and the like. You'd never code the Doom 3 engine in it, but if you're graphing data, swirling pretty lights, user interfaces, or relatively simple 3D games, you're golden.
posted by Netzapper at 9:05 PM on January 26, 2007

« Older Help identify this movie   |   Modern ways of testing character Newer »
This thread is closed to new comments.