Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Why didn't I do that sooner?

MarkMark Vanilla Staff
edited September 2005 in Vanilla 1.0 Help
If you've looked at the Vanilla codebase, you're probably aware that there are a lot of classes in there. At the beginning of any project, I spend a stupid amount of time coding up those definitions, and all they really are is a reflection of tables in the database.

Tonight I was going to start work on another open-source application for release through Lussumo (I will be releasing it in conjunction with Vanilla 0.9.3) and I sat looking at the screen - dreading writing out all of those class definitions for the new application. I type quickly, so it's not a huge deal - but there are always typos, and it's just so damn monotonous.

Then, suddenly, I realized that all of the information I need to define the classes is already in the database (duh). I just sat down and coded for about 30 minutes and created a new tiny application that looks at a database you specify, and automatically generates your class files for you.

Why didn't I think of this sooner?!

I feel like kicking myself.

Comments

  • Well, I think it's propably like C programmers and C++ programmers with OO, C programmers who jump to C++ will have hard time going with OO since they have done things differently all the time, so there is bound to be some relearning, and even unlearning some stuff. Coding is funny that way, people tend to create their won routines what they do when they start a project, or do some part of a project. Like I have noticed with Python, half of the time you just scroll tons and tons of other peoples source to find some commands some other people have made for your project so that you wouldn't have to make them yourself, and afterall you have just aswell made the function codes by yourself in the same time.
  • edited September 2005
    any hints mark? Don't kick yourself. You may not have thought of it imediately, but you still thought of it. See?
  • yeah that's a revalation i've really started noticing myself... i've gotten to the point where if I am going to have to do it more than once i'll write an app to do it.
  • Yeah -- been there a fair few times myself with asp. Is there any chance of you releasing that wee app -- I'd love to convert it into asp ...
  • Cam, how easy it is to port PHP scripts to ASP or any different languages/scripts? And how about databases? It has been a long time since I saw a free web application based on something else than PHP and MySQL.
  • the reason free web apps are based largely in php/mysql, i believe, is that php itself is an opensource language and can be run on many operating systems, as opposed to asp which (correct me if i'm wrong) requires IIS and therefore a MS licence of some kind.
  • MarkMark Vanilla Staff
    As I've said before, I'm not a PHP programmer. I picked up PHP when I decided to redo the filebrowser and I chose it again for Vanilla. My reasons are simple: everyone and their dog can run PHP/MySQL. If your server doesn't have php or mysql, you can install them for free on just about any operating system. In my mind it was all about reaching the largest audience possible.
  • +1 for common sense :D
  • I can't wait for the day that Ruby on Rails is installed on just about every webserver.
  • Kosmo: I think it's pretty easy to port from PHP to ASP. I know enough PHP to read it and understand the logic behind it, and can recreate the same functionality in ASP. Of course, it'd be a bad idea (and damned near impossible) to do a line-by-line 'translation', but a conversion of the logic using the strengths of the language is easily done.
  • minisweeper: More or less true. ChiliASP (sp?) is there but costs money, isn't feature complete, but exists. So, aprat from that, yes -- you're right.
  • camcam
    edited September 2005
    mark: I agree with you. Except that, there are a few of us 'stuck' with windows hosting with no php available. Anyway, it's not really the reason I wanted to port it -- I just like a wee challenge and am trying to get better at PHP. If it's actually useful to others (however few) then great.
  • MarkMark Vanilla Staff
    I don't think that task fits into the "wee challenge" category. More likely I would classify that task in the "massive undertaking" category :)
  • Ah. Well I'm just using the usual Scots thing of being a little understated. And, since my wife's waters have just broken (half an hour ago), I may be pushed for time over the next wee while! ;-P But, I know I've had to write that damned "class-to-represent-table" code a bunch of times, and anything to cut down on that would be a God-send.
  • MarkMark Vanilla Staff
    Wow! Congratulations! I'll post the class generator when I'm not feeling quite so hung over :)
  • /me loves that cams wifes waters broke half an hour ago and he paused to browse vanilla. That *has* to be a 'these people love the product' type quote.
  • Grats cam!
  • lol, congrats cam :D
  • I think that Vanilla needs its own recovery group. Vanilla Anonymous?
This discussion has been closed.