Slashdot Mirror


Exploring Active Record

An anonymous reader writes "Everyone knows that no programming language is a perfect fit for every job. This article launches a 'new series by Bruce Tate that looks at ways other languages solve major problems and what those solutions mean to Java developers. He first explores Active Record, the persistence engine behind Ruby on Rails.'"

266 comments

  1. In a comparison, Ruby suffers for one big reason by CRCulver · · Score: 4, Insightful

    By looking at Active Record Java developers can be happy and thankful they have a language taking good advantage of Unicode, unlike Ruby which treats users of non-ASCII alphabets (the overwhelming majority of people on Earth) as second-class citizens thanks to poor Unicode support.

  2. Anyone else Railed-out? by lifeisgreat · · Score: 4, Interesting
    Has anyone else played with Rails and been turned off?

    I've volunteered to create a recipe-wiki-site-thing for a friend, and coming from a background in C and SQL there was just too steep a curve to map a procedural train of thought and pre-planned SQL onto the Rails way of doing things. I already created the database schema, wrote all the SQL to get the information I want, have a lot of HTML written for the general template, and was looking at abandoning much of it for controllers, models, automagic foreign key relationships, automagic methods popping out of thin air.. I wanted more control I guess.

    So I've done most of the site in PHP instead. Direct, to the point, fast enough (though I'm thinking about a rewrite in C for a pure CGI/FastCGI binary), a minimum of automagic hand-holding - just start each page with sanity checking, authorization, the SQL the page needs and nothing more, and then format the output. No wondering how many hundred methods have been created that I don't know about, what happens when a record is deleted/updated (I'll let the database handle null/ignore/cascade thankyou) or whatever else Rails is doing behind my back.

    I'm a C guy - I don't like things being done that I don't explicitly ask for. I want init() functions. I want implicit declarations. Heck I don't even like C++ for fogging-over-functionality with inheritance, virtual functions and overloading.

    Ranting aside, I can see how Rails would mesh with a lot of people. But it's definitely not for me, and I guess (hope) a few other nutjobs around here.

    1. Re:Anyone else Railed-out? by MLopat · · Score: 0

      Well said. Its exactly these kind of programming models that lead to bloated and largely unmainatainable code. In my experience, these technologies are well suited to quick and dirty projects and the programmers that assume them. You can turn a working product out pretty quickly, but extending the functionality and debugging become anything but trivial tasks.

      Guess that makes me a fellow nutjob.

    2. Re:Anyone else Railed-out? by eyeye · · Score: 2, Insightful

      So I've done most of the site in PHP instead... just start each page with sanity checking, authorization, the SQL the page needs

      TBH It just sounds like you don't know what you are doing.
      --
      Bush and Blair ate my sig!
    3. Re:Anyone else Railed-out? by syntaxglitch · · Score: 1

      You must've really HATED ActiveRecord's pluralization thing. Heh.

    4. Re:Anyone else Railed-out? by I+Like+Pudding · · Score: 1

      Here is your problem: you don't hate Rails. What you hate are frameworks, architecture, and anything even remotely meta. PHP is perfect for you: just roll your own framework and persistance layer every goddamn time and make all the web devs cry. That you are even considering rewriting this in C speaks volumes.

    5. Re:Anyone else Railed-out? by ziplux · · Score: 1
      lifeisgreat wrote: I already created the database schema, wrote all the SQL to get the information I want, have a lot of HTML written for the general template, and was looking at abandoning much of it for controllers, models, automagic foreign key relationships, automagic methods popping out of thin air.. I wanted more control I guess.

      It sounds like you come from a background where you mix business logic, business objects, and presentation into the same file. I suggest that you take a step back and re-examine your design choices. Controllers, modules, and views aren't exclusive to Rails; you'll find them wherever a goood, sane, well-designed code lives. If your original system was designed with MVC in mind, moving it to Rails should have been easy.
      lifeisgreat wrote: just start each page with sanity checking, authorization, the SQL the page needs and nothing more

      What if you forget a single function call at the beginning of one of those pages? Do you suddenly allow objects to be populated with rogue data? Rails has things like filters that make sure certain methods get executed before all actions in a given controller.
    6. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      If you make a simple recipe-wiki-site-thing in C I will personally come to your house and shoot you :-)

      Why not make it in x86-assembler while you're at it. Hell, make your own web-server running on a custom made OS.

      A site like that is perfect for dynamic languages like PHP,Ruby,Python etc.

    7. Re:Anyone else Railed-out? by I+Like+Pudding · · Score: 3, Insightful

      What sort of programming models? Frameworks? How in God's name does a framework reduce maintainability as compared to some C programmer's PHP spaghetti code?

    8. Re:Anyone else Railed-out? by soundofthemoon · · Score: 3, Insightful

      If you don't like it, don't use it. Like every other tool/framework/system ever developed, Rails will work for some and not for others. I've found Rails to be extremely productive and maintainable, but I'm an OOP die-hard and the approach is easy for me to grok.

      One thing I like about ActiveRecord is that it is database agnostic. If I need to, I can move my app from MySQL to Postgres to Oracle with very little effort. The other thing I like is that it provides a clean separation between data storage and business logic. Database programmers seem to hate that approach because it shifts the center of gravity away from the database and toward the web app. This is great for maintainability of application code, but I don't know how well it works for sharing data among multiple apps. I don't know if anyone has gotten ActiveRecord models to support the same level of integration as you can get with multiple apps running off of one database - I think there needs to be more work done to enable that, but I expect to see that work done fairly soon.

      The other cool thing about ActiveRecord is the use of metaprogramming, as discussed in the FA. I don't think we'll ever see a Java persistence layer that is as functional and easy to use as ActiveRecord, because the kind of metaprogramming tricks that Ruby enables are so much harder to do in Java.

    9. Re:Anyone else Railed-out? by ziplux · · Score: 3, Insightful

      Um...sorry, I have to disagree. Using a well-known framework makes a project anything but unmainatainable. Let's say a project is written with a framework, and the original developers no longer supports it, or he leaves your company, or whatever. At the very least there are many people out there with a basic understanding of the framework, and thus a basic understanding of the code. You can hire a Rails consultant and be fairly confident that he will be able to pick up where the old developer(s) left off. Try doing that with some custom framework (or, even worse with no framework at all). I know from personal exerience that it is very difficult to pick up a new framework; it can take weeks, and even after that it's not totally intuitive.

      Furthermore, Rails promotes good coding and design habits. While you may not agree with Model-View-Controller (not sure why, but that's a personal choice I guess), at least Rails imposes some design pattern on the developer. Without this, an inexperienced developer will be able to write completely unmaintainable code.

    10. Re:Anyone else Railed-out? by Dante+Shamest · · Score: 2, Informative
      I want init() functions.

      90% of the time, when you call an init() function, you're going to call a free() function too. Let C++ do the grunt work for you. Use the RAII pattern.

      Put your init() code in the constructor and your free() code in the destructor. That way you won't forget to call free().

      Heck I don't even like C++ for fogging-over-functionality with inheritance, virtual functions and overloading.

      You don't have to use those C++ features if you don't want to. You can program in C-style in C++ if you wish. virtual and inheritance are optional. These days templates do most of what inheritance and virtual functions can do. And I don't understand why you would dislike overloading. Aren't you tired of thinking up names for functions that do the same thing, but just take different number of arguments?

    11. Re:Anyone else Railed-out? by lifeisgreat · · Score: 3, Insightful
      It sounds like you come from a background where you mix business logic, business objects, and presentation into the same file. I suggest that you take a step back and re-examine your design choices. Controllers, modules, and views aren't exclusive to Rails; you'll find them wherever a goood, sane, well-designed code lives.

      A background of incompetence? Funnily enough when I picked up PHP, your disaster scenario was what most people seem to do without thinking about it. In my case, the MVC components are, respectively, PostgreSQL, HTML templates and PHP.

      If your original system was designed with MVC in mind, moving it to Rails should have been easy.

      I think you'll find that most Rails developers hold that it's much easier, cleaner and safer to start a project with Rails in hand, rather than graft Rails onto a pre-existing database.

      What if you forget a single function call at the beginning of one of those pages? Do you suddenly allow objects to be populated with rogue data? Rails has things like filters that make sure certain methods get executed before all actions in a given controller.

      Error checking and testing suites aren't impossible for a C developer to comprehend, you know.

    12. Re:Anyone else Railed-out? by lifeisgreat · · Score: 1

      He wants it ready to explode into a hugely popular money-making machine, so I'm at least planning for the possibility.

      And if you've designed your site engine and presentation well, there's an astonishingly small difference between PHP querying a database and formatting a HTML template with the output, and C querying a database and formatting a HTML template with the output. Apart from speed of course.

    13. Re:Anyone else Railed-out? by lifeisgreat · · Score: 2, Insightful
      One thing I like about ActiveRecord is that it is database agnostic. If I need to, I can move my app from MySQL to Postgres to Oracle with very little effort.

      That's all well and good, for a subset of database functionality. ActiveRecord reminds me of wxWidgets - smoke and mirrors, bloat and lowest common denominator functionality. But don't get me wrong, for a great many jobs it's adequate and there for the taking.

      The other thing I like is that it provides a clean separation between data storage and business logic.

      That's really just a matter of the intelligence/discipline of the developer. Inexperience can mitigate the benefits of any technology, and believe me I've seen code to prove it.

    14. Re:Anyone else Railed-out? by LuminaireX · · Score: 2, Funny

      What if you forget a single function call at the beginning of one of those pages? If its like any other programming error, I go back and fix it

    15. Re:Anyone else Railed-out? by ziplux · · Score: 2, Insightful
      In my case, the MVC components are, respectively, PostgreSQL, HTML templates and PHP.


      If you wanted to, you could turn your HTML templates into RHTML (Ruby HTML). If you PHP really was just acting as a controller, it should be easy to re-write that in Rails, as it uses the same design pattern. As far as custom SQL, it's easy to keep that in Rails (although it's not really the "Rails way"); you can execute arbitrary SQL statements just like in PHP.

      Ultimately, I think we all code in what we're comfortable with. To many programmers, Rails fits their mind well because of the MVC pattern used, and in general the way Rails handles everything.

      However, I still think custom frameworks are the root of all evil for anything but the smallest projects. Do you, a single developer, really have the guts to say that your framework is better than something that has been developed by a core team of 15 over about 2 years? Do you really think that your framework is that great, that you're willing to have to train someone else to use it, when you could just leverage the work of the community? Creating a custom framework is, in all but the most obscure cases, a supreme act of selfishness.

      Next think you know...you'll be rewriting everying. You, the uber code, know best! Heck, we can write it all in C! Just rewrite all the good stuff that you take for granted in PHP. Why use PHP's session handling when you can roll your own? Oh, right, there's a whole slew of security issues there and you're likely to fuck up some small detail and open up some nasty hole where one user can get to another's session. Etc, ad nauseam.
    16. Re:Anyone else Railed-out? by k2r · · Score: 1

      > sanity checking, authorization, the SQL the page needs and nothing more,

      Don't repeat yourself:
      http://c2.com/cgi/wiki?DontRepeatYourself

      k2r

    17. Re:Anyone else Railed-out? by lifeisgreat · · Score: 1

      What caliber web-devs are we talking about, where any sane persistence technique in a database-backed environment, or god-forbid a SQL query here and there, requires more than a trivial amount of time to comprehend? This isn't exactly challenging stuff as far as programming goes. It still amazes me just how much code people write for web apps these days. Most of my app's size and dev-time have gone to HTML templates, most of the mental effort went into the database and associated triggers/functions, and practically all the scripts do is make SQL queries presentable.

    18. Re:Anyone else Railed-out? by slashbart · · Score: 1

      Yep, I did

      I was very enthusiastic at first, but after a few days that went away. The render_partial stuff can lead to very hard to track bugs, where you're not sure what object you're in. I've had one bug where I literally put a debug statement on every line of a partial template function in order to find out what went wrong. It turned out that I'd forgotten two (), and was now instantiating a variable instead off accessing the setter function. Which leads me to a problem I have with Ruby: the fact that function calls do not need (). Syntactically this is confusing.
      Ok, I was a Ruby newbie, but I'm a very experienced programmer, using currently C, C++, Tcl, Python, Java, PHP, Awk, and some others.
      This automagic stuff of Rails might seem nice, but i'd hate to use it on a larger project; the lack of visibility of which functions exist will lead to major problems.

      Bart

    19. Re:Anyone else Railed-out? by lifeisgreat · · Score: 1
      Ultimately, I think we all code in what we're comfortable with. To many programmers, Rails fits their mind well because of the MVC pattern used, and in general the way Rails handles everything.

      A friend of mine is self-employed creating web pages for local businesses. I pointed him towards Rails (how he hadn't heard of it I'll never know) and he couldn't be happier. Also, since I've pretty much abandoned it as a platform I won't be who he calls for support! =)

      However, I still think custom frameworks are the root of all evil for anything but the smallest projects. Do you, a single developer, really have the guts to say that your framework is better than something that has been developed by a core team of 15 over about 2 years? Do you really think that your framework is that great, that you're willing to have to train someone else to use it, when you could just leverage the work of the community? Creating a custom framework is, in all but the most obscure cases, a supreme act of selfishness.

      Horses for courses. Should I start my site with an enterprise java framework just in case it needs to scale to 2,000,000 concurrent users? What if 90% of the visitors will be speaking a language that $framework has terrible support for? What if my framework is so popular it gets much more attention from hackers creating automated attacks?

      Look I'm not against frameworks, it's just that when I design a project I go into it with specific goals, and more often than not the available free frameworks to support it (be it a web page, video codec or cd image converter) either are slow, bloated, buggy or just suck to use.

      Next think you know...you'll be rewriting everying. You, the uber code, know best! Heck, we can write it all in C! Just rewrite all the good stuff that you take for granted in PHP. Why use PHP's session handling when you can roll your own? Oh, right, there's a whole slew of security issues there and you're likely to fuck up some small detail and open up some nasty hole where one user can get to another's session. Etc, ad nauseam.

      PHP's session handling isn't exactly a bastion of coding glory to hold up. Look I appreciate your point, it's just that there are way more crappy frameworks out there than good ones. Not that I'm saying Rails is crappy, it's just not there for me and my personal coding style. Other crappy frameworks of note include wxWidgets, SDL, Allegro, MFC, GTK, DirectShow.. well you get the idea. Crappy code is often subjective, but ultimately rolling one's own framework is a cost-benefit equation that'll come out differently for everyone. Once you involve multiple people in a coding exercise, that equation begins to quickly swing in favor of a pre-existing solution, often regardless of how crappy it happens to be.

    20. Re:Anyone else Railed-out? by JulesLt · · Score: 4, Insightful

      Which bit is causing you the problem - Ruby or Rails? My understanding is that Rails is simply providing, well, Rails to give you a rapid framework for your Ruby app - provides you with a web page that's a 'default form' along with the related MVC code. It's similar to other frameworks that provide default pages from ORM mapped classes in other languages, but I thought it was Ruby, rather than Rails, that was getting people excited.

      I'm an 'SQL' guy myself and I'm not convinced by ORM tools - or at least the way they're being hyped as a solution for having to understand the DB (Newsflash : SQL is supposed to be an abstract query language so that the developer doesn't need to understand the DB - and look how that worked - answer : Mostly it does, but when it goes wrong you're dealing with a black box). I also think that the view of many Java (and Ruby) developers that a DB provides 'persistence' is wrong. It's a failure to understand relational theory - which at least, unlike most object modelling techniques, has a firm mathematical foundation. It's also a failure to use the tools provided to you (and when Bruce Tate complains about Java productivity, this tendency of Java developers might be part of the problem - it's 'not invented here' syndrome).

      You could have used Ruby rather than PHP (a comparison I'd like to see) and I also think that there is much to be said for the MVC structure compared to shoving everything into each page.

      It feels a bit clunky in the current paradigm (pages generated on the server and refreshed to the client, client events sent to server) but it works very well as a design, and I can see it becoming more important again as browser apps support more dynamic features - getting back more towards a client-server architecture with the model on the server, view on the client. (Or more likely a local model for performance and some form of background syncing).

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    21. Re:Anyone else Railed-out? by LarsWestergren · · Score: 1

      Has anyone else played with Rails and been turned off?

      I've seen one or two... here for instance. I've yet to try it myself, but I'm looking forward to it... when things have calmed down a bit on my current project. I've been a bit turned off by the constant one-sided evangelizing by some of the enthusiasts though.

      --

      Being bitter is drinking poison and hoping someone else will die

    22. Re:Anyone else Railed-out? by shmlco · · Score: 4, Insightful
      "Inexperience can mitigate the benefits of any technology..."

      Inexperience and ignorance. And it sounds as if it applies to you and to this situation. I don't see how you can rant against "bloated" technologies you never bothered to learn. Without that knowledge, you don't understand everything that's happening behind the scenes and, since that scares you, you stick with the subset of the developmentatl universe you do know, no matter how appropriate, or inappropriate, it may be to the problem at hand.

      I strongly suspect that once you've moved on to other victims, the next developer the guy hires will take one look at your carefully-crafted optimum solution, shudder, and then rewrite the whole thing.

      --
      Any sect, cult, or religion will legislate its creed into law if it acquires the political power to do so.
    23. Re:Anyone else Railed-out? by ubernostrum · · Score: 4, Insightful

      I've volunteered to create a recipe-wiki-site-thing for a friend, and coming from a background in C and SQL there was just too steep a curve to map a procedural train of thought and pre-planned SQL onto the Rails way of doing things. I already created the database schema, wrote all the SQL to get the information I want, have a lot of HTML written for the general template, and was looking at abandoning much of it for controllers, models, automagic foreign key relationships, automagic methods popping out of thin air.. I wanted more control I guess.

      So... you basically wrote the application (minus the controller), and then started thinking about using a different platform? Is it any surprise that you didn't want to switch over to Rails (disclaimer: I'm not a Rails guy. In fact, I work for the competition)?

      So I've done most of the site in PHP instead. Direct, to the point, fast enough (though I'm thinking about a rewrite in C for a pure CGI/FastCGI binary), a minimum of automagic hand-holding - just start each page with sanity checking, authorization, the SQL the page needs and nothing more, and then format the output. No wondering how many hundred methods have been created that I don't know about, what happens when a record is deleted/updated (I'll let the database handle null/ignore/cascade thankyou) or whatever else Rails is doing behind my back.

      OK. It's not like somebody's holding a gun to your head and saying you have to use a framework. Personally, I see a lot of use cases where a framework makes development a lot simpler and easier to manage, because so much of the tedious overhead of web-app development has already been done for you. Think of the framework in terms of an operating system you're programming for: rather than writing all your own device drivers, routines for drawing stuff on the screen, accepting keyboard/mouse input, etc., you've let someone else solve those problems and you're just using the provided APIs to hook up the logic that's unique to your application. And with a framework, rather than write database drivers, routines for accepting and routing input, etc., you've let someone else solve those problems and you're just using the provided APIs to hook up the logic that's unique to your application. Using a web framework is no different, really, than using any other shared library.

      As for all the cruft you complain about, when was the last time you used every single bit of functionality provided by a shared library you linked a C application against? Or is it only bad to draw in automagical functions you won't use when the application isn't being compiled? ;)

    24. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      I'm turned off by the fact that development in Rails is like a gimpy version of development in Lisp. I am, however, glad that people are starting to figure shit out almost half a century later.

      Now, maybe, we can start making some progress :).

    25. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 1, Informative

      I'm not a Rails expert, but Ruby is one of the few languages that has a built-in complete line-by-line trace mode.

      ruby -rtracer myprogram.rb

      See here for instructions.

      This prints a complete line-by-line trace of the execution of your program. You can use this to work out exactly what paths were taken by the code (I can imagine it would be very big for rails, but grep is your friend :)

    26. Re:Anyone else Railed-out? by oldCoder · · Score: 2, Insightful
      Rails is still suffering growing pains. After that is over, it will have the problems of maturity. Rails has a lot of good ideas, and leveraging Ruby is one of them. But Rails is not well documented. It's almost as if the Rails devlopers have never seen really professional documentation and are happy to just look at the Rails source for information. For example, the API docs don't have a search box.

      I think Ruby and Rails are about the right ideas for our current and near future environment -- cheap cpu's, tight schedules, evolving web standards, clueless users, heterogeneous client hardware (browsers and pda's) and ever faster networks.

      And, by the way, the current Ruby implementation is not quite as mature as the current Perl or even Java implementations. This will change. The sweet spot for using Rails isn't today, it's the next 5 years or so. So now would be a good time to get the experience.

      Not to knock PHP, it lets just anybody put together a dynamic web site without having to know too much. It's a straightforward system ideal for power users who don't want to be computer scientists but who need to build out their ideas. I have a neighbor who's expertise is in marketing and home products who is building his own product line with PHP. Ruby would be beyond him. Who knows, he might just strike it rich with PHP.

      --

      I18N == Intergalacticization
    27. Re:Anyone else Railed-out? by vhogemann · · Score: 1

      So, you like to re-invent the weel.

      Thats ok, sometimes I like to thinker too and understand how things work at the core level, but when you do that you waste too many time doing things that already has been made, and thats not cool when youre working serious project.

      Rails is about speed, is about getting your job done in less time, with less effort.

      --
      ---- You know how some doctors have the Messiah complex - they need to save the world? You've got the "Rubik's" complex
    28. Re:Anyone else Railed-out? by LarsWestergren · · Score: 1

      I'm turned off by the fact that development in Rails is like a gimpy version of development in Lisp. I

      Hehe... yes, speaking of fanatic evangelists, no one has even gotten close to beat the Lisp people. I don't know, maybe it is a FANTASTIC language. it is just... all this smug superiority pisses me off. :-)

      --

      Being bitter is drinking poison and hoping someone else will die

    29. Re:Anyone else Railed-out? by yokem_55 · · Score: 1

      As for rails documentation, the freely available stuff is widely disbursed, and disorganized. The real thing is the Agile Web Development with Rails book by Dave Thomas and DHH, of which the pdf version can be purchased for ~$22USD. The book is excellent, and provides a fairly comprehensive overview of rails development, but I can't help but wonder if the utter lack of comprehensive, good, free, docs isn't the result of the sales push for this book. Granted, this is an open source project--go set up a docs wiki and go nuts.

      --
      ...and IN SOVIET RUSSIA, beowulf clusters imagine 1, 2, 3 profit!!!! jokes made out of YOU!!!
    30. Re:Anyone else Railed-out? by MemoryDragon · · Score: 1
      Well the JPA simplifies to a big degree the mapping instead of having a class and a xml descriptor describing every field you normally have @Entity public class Table { @Id Integer id; .... so things have become easier, but there are certain limitations of course

      you have the java inherent setters and getters, which blow up your code (although the usually are generated, no one normally codes them by hand

      something like a query over a method is not possible you still have to go over the persistence api

      the apis persist, lock, save, update hell was carried over straight from hibernate, but persist and merge ease things to a certain degree, thank god.

      In the end rails has caused a lot of momentum im the java world, there are several interesting projects going on, Seam, Trains, FacesFreeway, they all try to follow the rails approach of trying to simplyfy as much as possible. And thank god Struts is out of the game in all these approaches due to the fact that scaffolding needs a component tree!

    31. Re:Anyone else Railed-out? by heinousjay · · Score: 1

      Well, sure, if all you do is treat the app like a window to a database, I guess you aren't really writing anything. Feel free to use whatever outdated technique you like.

      The thing is, a lot of us out here in this field are writing actual applications that do a lot more than just select giant recordsets and format them. We need more than a hero coder who wants to do everything his way, because we aren't dealing with tiny little form-and-report one-offs that any monkey could write.

      You, of course, don't have to believe this. Your argument already shows your propensity for thinking your use case is the only real one. Just ignore us, we'll be on our way forward while you sit in one place.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    32. Re:Anyone else Railed-out? by Decaff · · Score: 2, Interesting

      One thing I like about ActiveRecord is that it is database agnostic. If I need to, I can move my app from MySQL to Postgres to Oracle with very little effort.

      You can move your app, but how much effort is there in moving your data model? For serious apps, quite a bit. Oracle has seriously different types of columns and restrictions on columns from Postgres or MySQL, and if you want to use really efficient SQL, you have to use SQL that is hard to port (MySQL has only recently got subselects, for example).

      This is why I think working in the opposite way to Rails - designing your data model in terms of classes and letting the ORM product generate a schema from that (still DRY, but in the other direction) makes far more sense - I can move my apps between those databases with no effort at all.

    33. Re:Anyone else Railed-out? by Local+Loop · · Score: 2, Interesting

      I agree with you, mostly. Rails is a god-awful mess under the hood. The programmers really abuse the language features (especially the ability to re-open objects) to the point where it is nearly impossible to trace through the code to figure out what is really going on.

      I tried it, ditched it and refuse to use it anymore. The last straw for me was the lack of respect for backwards compatibility in their version upgrades -- I had gotten halfway through a small a project and then they changed the API drastically!

      As for the methods they create behind your back, let's just call it what it is: Self Modifying Code. How the heck am I supposed to debug code that doesn't exist at design time?!?

      I too am a procedural guy. I used to write windows programs in C (Delphi now) and am currently doing a lot of embedded work in C. But there are some nice advantages to OOP for web development. For example:

      1. It's nice to have a common base class with a before() function that can handle auth and logging for the entire app.
      2. I can release app upgrades to beta users by copying, renaming and modifying a controller object and view directory
      3. Reusable GUI components!

      I am such a convert to (light, simple, uncomplicated) OOP that I have written my own Perl MVC framework to let me do it easily.

      But I feel that Rails' implementation of MVC is simplistic and naive. Also, despite all the hype, they haven't solved any NEW problems in web app development. For example, when is somebody going to tackle:

      1. standardized, cross-app, cross language/framework logins
      2. monolithic, parameterized page components that can easily be re-used in other apps
      3. easy support for query direction across replicated DB backends
      4. built in support for session sharing across multiple servers (with the session data kept in the DB, not in memory

      So yes, I am a fellow nutjob, but I have seen light of OO web development.

    34. Re:Anyone else Railed-out? by somersault · · Score: 2, Insightful

      Ah I think you've just hit the nail on the head as to why I'm finding programming concepts less interesting these days .. well I've always known that HTML is boring, but making everything so verbose, full of tags and structure does tend to detract from the actual job of getting things done. I do appreciate the benefit of classes and structuring code etc, but ever since going to uni I've kind of lost my drive to actually do any coding projects that I'm not being paid for.

      --
      which is totally what she said
    35. Re:Anyone else Railed-out? by Fahrenheit+450 · · Score: 1

      Think of it this way. Lisp fans are a lot like Yankees fans. You might hate them for being so smug, and you might revel in picking on the one or two large failures associated with the object of their affection, but when it comes right down to it, they've got some very good reasons for being smug.

      And for the record, the Yankees can go screw. Go Tribe!

      --
      -30-
    36. Re:Anyone else Railed-out? by Nelson · · Score: 1
      Yep


      It's nice. Ruby is nice too, I like it. I guess there are 3 things that stand out to me, Rails is still a toy compared to j2ee, I've been doing "opensource" professionally for nearly 10 years and good enough usually isn't good enough. There seems to be a lot of consultant types pushing the rails way and it's because they've never finished anything.


      Second, I'm skeptical of religion in technology. Ruby and rails has a ton of religion going on. Enough that it's not just advocacy, it's crossing over in to that place where there are a lot of believers that it's a silver bullet. It is in a consulting type way but nobody has ever maintained a rails app.


      Third, and this might be a couple of issues. Engineering died in the last decade (or maybe it's just in a coma) and things like agile (which is really just a formal declaration that engineering is hard so we're not going to do it) have really taken hold. I read and worked through the Agile Web with Rails book and in the "getting serious" section they spend a nice little couple of paragraphs explaining how if you hit the db every page and share nothing then you scale because you can put dbs in clusters and they are fast; it's really kind of laughable if you've ever worked on that problem there is a difference between running on a cluster and requiring a cluster to run. Never mind the fact that j2ee exists to really kind of provide tools to solving that problem. That's how it scales, but when you start to kick people about it they just say you don't really need to scale hat much anyways, 37signals uses it how's that for scaling! There is this culture of non-engineering surrounding rails, there is almost contempt for it. You bring it up and they talk about how they turned ajax on in a couple lines of code; try that in j2ee. Now it's great if you're banging out a quick app and then you take your money and walk away but it's not real. Along with that, different is good kind of comes up a lot, they like to use lighttpd over apache, because it's easier to configure and then there is this lore that it's 50x faster; now I've beat on apache a lot, it's not easy to configure but the 50x part, I simply don't believe that in any meaningful way, it's bullshit. There are a lot of details that just get glossed over, it's easy to talk, and software engineering is all about the details. I'm not debunking it all there are definitley uses but the problems it's claiming to solve haven't been solved and I don't think the community fully understands them in the first place. It's easy to say that the guys who wrote the pragmatic books run their web site on it and they get a lot of hits so it scales and just move on. The whole ruby on rails community, from my experience isn't in favor of engineering, they are in favor of feeling, things feel good and so they must be and they move on. Feelings are nice but at the end of the day someone is paying an engineer to make it work. And if you really want to get all touchy feely, you can bang out apps seriously fast in Seaside, Zope, Django, Turbogears, and even with some of the IDEs and tools in J2EE with EJB3 and such; I'd like to see a meaningful discussion, not about feelings, about all of that. Clean code isn't engineering, doing things quick isn't engineering, it's all of that plus making it work, supporting it, making it do what you say it will do.

    37. Re:Anyone else Railed-out? by Forbman · · Score: 1

      PostGres->Oracle is not nearly as bad as MySQL->anything else.
      SQLServer->Oracle, SQLServer->DB2, DB2->Oracle, etc. doesn't happen all that much. If only more databases supported DOMAINs, i.e., CREATE DOMAIN UserID as integer.

      DeZign for Databases is pretty good at slurping in a database schema from one platform, and after changing the target platform, converting the schema to the desired database system.

      As far as "hard to port" SQL, unless you're using MySQL or old versions of databsae apps, this isn't too much of a problem for most SQL heads, even when you throw in database-specific functions or idioms.

      And it all depends on how much trigger/stored proc code you have to migrate. Tables/Views are pretty simple to move.

      For most application developers, for whom SQL is a 4-letter word, that would be about 0 right there.

    38. Re:Anyone else Railed-out? by Vaevictis666 · · Score: 2, Insightful
      lack of respect for backwards compatibility in their version upgrades -- I had gotten halfway through a small a project and then they changed the API drastically!

      This is an unfortunate side-effect of working in a pre-1.0 environment, regardless of what it was. I believe the current plan is to not break any APIs until 2.0 hits (and maintain the 1.x branch for security updates once 2.0 hits)

      As for the methods they create behind your back, let's just call it what it is: Self Modifying Code. How the heck am I supposed to debug code that doesn't exist at design time?!?

      Firstly, it's not self modifying code, it's metaprogramming. Self-modifying code changes during runtime. Metaprogramming (and all the class-method shortcuts you have available for ActiveRecord and ActionController subclasses) writes code for you, just like C preprocessor macros, but once it's loaded it's done. As far as debugging, I've been working in rails since July last year, and haven't needed a debugger once. Break your methods into small bitesize chunks, and write a decent test suite alongside - If something's wrong, small methods make it easier to isolate, and your tests will tell you exactly what the problem is.

      But I feel that Rails' implementation of MVC is simplistic and naive. Also, despite all the hype, they haven't solved any NEW problems in web app development.

      That's entirely true. Rails doesn't solve any new problems. It's just an MVC. What's special about it is that it gets out of your way with a minimum of fuss, allowing you to spend more time solving your problems, rather than getting the framework to do what you want.

      For example, when is somebody going to tackle:
      1. standardized, cross-app, cross language/framework logins
      4. built in support for session sharing across multiple servers (with the session data kept in the DB, not in memory

      Point 1 is being worked on as a plugin to rails, but I'm not sure I'm entirely sold on the idea. Point 4 is already done in rails, you can set one config variable (commented out in environment.rb in a default rails install) and use either your existing app database or an instance of memcached on another server.

      I'm not sure what you're getting at with 3 (I would assume that should be the job of a load-balancer or the database itself), and I'm not sure I want to see 2 at all...

    39. Re:Anyone else Railed-out? by Decaff · · Score: 1

      As far as "hard to port" SQL, unless you're using MySQL or old versions of databsae apps, this isn't too much of a problem for most SQL heads, even when you throw in database-specific functions or idioms.

      That is easy to say until you are dealing with tens of thousands of lines of legacy SQL.

      And it all depends on how much trigger/stored proc code you have to migrate. Tables/Views are pretty simple to move.

      Not really - just look at the range of different column types in PostgreSQL or Oracle - converting is not trivial, especially when you have BLOBs or CLOBs.

      My point is that there are well-established and highly successful ways to avoid all this - I find it hard to believe that in 2006 we are still writing new application code that uses SQL directly (like Rails).

    40. Re:Anyone else Railed-out? by cygnus · · Score: 2, Insightful

      actually, you can generate DDL from an OO class definition in Rails by using migrations, which is the built-in way Rails handles updating databases to the current version. you do "script/generate migration " and a skeleton gets generated for you, and then you fill it out. then just run "rake migrate" and DDL is run that generates your tables. here's a writeup of it.

      --
      Just raise the taxes on crack.
    41. Re:Anyone else Railed-out? by swimmar132 · · Score: 1

      The vast majority of web apps out there DON'T need to scale beyond one machine. Rails uses the exact same approach for scaling (share nothing) that Yahoo, Google, Live Journal, etc use.

      Rais provides *excellent* support for unit, functional, and integration tests. You can prove the software does what you want it to do.

      It's funny you knock on agile stuff. Tests are good. Giving the customer something that they actually want is good. That's all agile methodologies attempt to do.

    42. Re:Anyone else Railed-out? by Local+Loop · · Score: 1

      I was talking about debugging rails itself, not my code. At the time I was using it,
      1 year ago, there were plenty of bugs and undocumented side effects in the framework.

      I believe that Rails does qualify as self-modifying. There is code doesn't exist at design time. Nor can I step into with a debugger at run time, because there is no associated source file.

      There's got to be a better way to handle that.

      Regarding #1 (login standards), wouldn't it be nice if you could go to Freshmeat, cherry-pick an email program, calendar, link manager, bug-tracker and file sharing software, all written by different developers in different languages, throw it all together and have a custom groupware app for whatever business you are in?

      As for #2, maybe I wasn't clear, I am talking about self-contained components that have no awareness of the app they are in, but can take parameters (for example the name of the table they should use). Like OLE controls on windows. It's more of a challenge in a web environment, but it could be done in a much better way than it is now.

    43. Re:Anyone else Railed-out? by I+Like+Pudding · · Score: 2, Insightful

      What caliber web-devs are we talking about, where any sane persistence technique in a database-backed environment, or god-forbid a SQL query here and there, requires more than a trivial amount of time to comprehend?

      Use of a framework requires zero time to comprehend if you are familiar with it. I was mainly thinking of extending the codebase, though. The bigger the codebase, the worse a handrolled framework gets. I currently work on a large perl web app with a handrolled framework, and even trivial things like adding a couple pages are just a kick in the dick. Major changes are hell.

      I had to add some code to track items added and removed from the cart a year and a half ago. This took me over a month because I had to:

      - Insert code before and after every change to the cart. Logically, I should add this in one place - the model's add, remove, and modify item methods. Oops, SQL might modify shit behind my back without hitting the object model, so that's out.
      - Store the carts's previous state to make sure I didn't double-report changes. There's no session to store anything in the app's framework, so I had to use cookies. This lead me to find out that headers had already been sent by the time I had tried to set the cookie. OOPS. Guess I need to write an output caching layer. Then I had to track through massive amounts of handrolled framework to find every piece of code that was bypassing my cache by calling print() instead of $context->print(). Then I had to alter them to take a context. Then I had to set the context for every single template used by the cart, because half the templates didn't share common init code. Output caching should be handled out of the box.

      This isn't exactly challenging stuff as far as programming goes.

      No, not when you've set the bar so low that "it works" is your justification. I don't want things to work, I want them to work beautifully, scale, extend easily, and get rid of all the Repetitious Shit like "select total from orders where order_id='1234'" by replacing it with Good Shit like order = Orders.find('1234').

      It still amazes me just how much code people write for web apps these days.

      Because you are insane. The web is just an interface; the backend can do anything and often does.

      most of the mental effort went into the database and associated triggers/functions, and practically all the scripts do is make SQL queries presentable.

      That's because you've pushed your business logic into the DB, which makes baby Jesus cry.

      I'm still wondering about the C rewrite as well. I'd love to know how your app became CPU-bound before it became IO bound. The Rails solution to this would be to start template caching, not rewriting everything in C.

    44. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0
      Unit testing doesn't prove anything. Proving is quite a bit different.

      Agile isn't the only thing that does unit testing.

      What's with the statement about most apps not needing to scale?

    45. Re:Anyone else Railed-out? by Civil_Disobedient · · Score: 1

      Completely agreed. I'm currently working on a large-scale project using Tapestry/Hibernate as a MVC framework, and I am astonished just how much code has to be written to do even the most minimal of database requests or updates. Sometimes you don't need the entire object to be persistent. It doesn't matter that it can scale to 10,000 concurrent users when, realistically, only 10-20 will ever be using it.

      I've yet to see a truly pure MVC. I honestly don't think it can be done. The view/controller interface in particular never goes as cleanly as they advertise, especially if you're trying to do "fun stuff" like AJAX. Give me PHP any day of the week.

    46. Re:Anyone else Railed-out? by AuMatar · · Score: 1

      You do realise that some of the world's biggest websites, such as yahoo.com and amazon.com, are written largely in C and C++, right?

      --
      I still have more fans than freaks. WTF is wrong with you people?
    47. Re:Anyone else Railed-out? by Decaff · · Score: 1

      actually, you can generate DDL from an OO class definition in Rails by using migrations, which is the built-in way Rails handles updating databases to the current version. you do "script/generate migration " and a skeleton gets generated for you, and then you fill it out. then just run "rake migrate" and DDL is run that generates your tables.

      I know about this, and definitely approve - it is a big step forward for Rails into becoming a modern approach! Actually, I find it rather amusing - it involves basically the kind of configuration files that earlier versions of Rails stated were to be avoided and were unnecessary (just because the config files are written in Ruby does not make them any less config files!).

      However, it is still way behind other products. Firstly, it is limited to only a few databases out of the box. With my Java ORMs I can almost any database with a modern JDBC driver (and that is a lot).

      Contrary to the article you provide, seeing data-safe schema upgrades done automatically does not 'blow my mind', as I was doing that with a Java JDO product years ago!

      Also, this in no way overcomes the limitations of Rails use of restricted native SQL - a very poor substitute for having a portable standardised query language (like JDOQL) that is dynamically translated to optimised vendor-specific SQL at run time. Java products have been able to do this for years.

      Rails may be advanced and exciting for developers who have used less structures systems, perhaps based on PERL or PHP, but for many of us it has a long way to go to catch up with where modern ORM products were years ago.

    48. Re:Anyone else Railed-out? by swimmar132 · · Score: 1

      I don't understand why you think Migrations are configuration files. What makes something a configuration file? What makes something not a configuration file?

    49. Re:Anyone else Railed-out? by swimmar132 · · Score: 1

      I rarely use SQL in my Rails apps. Pretty much only need it when I need to optimize something, which doesn't happen too often.

    50. Re:Anyone else Railed-out? by Decaff · · Score: 1

      I don't understand why you think Migrations are configuration files. What makes something a configuration file? What makes something not a configuration file?

      Migrations contain data about columns and their types. This is in a Ruby script.

      Java JDO has files that contain data about columns and their types. This in an XML file.

      Looks the same to me. Just because what you do with the data in Rails migrations is explicitly stated in the files makes no difference in my view.

      Why the horror about configuration files? They can be a huge benefit, isolating your code from changes.

    51. Re:Anyone else Railed-out? by dubl-u · · Score: 2, Interesting

      I've volunteered to create a recipe-wiki-site-thing for a friend, and coming from a background in C and SQL there was just too steep a curve to map a procedural train of thought and pre-planned SQL onto the Rails way of doing things.

      For which, I salute you.

      Personally, I'm a big OO guy; for anything beyond a thousand lines of code, I feel the object-oriented approach makes maintenance much, much easier.

      But what makes me bat-shit crazy is people who feel like you do but aren't smart or independent enough to be honest that either a) they don't really get OO yet, or b) they get it but prefer to work otherwise. So they go and write a bunch of semi-procedural crap in an OO language, half-assedly using the various OO features wrongly. I've heard this called "procedural object oriented programming" or POOP, and it is so much worse than either good procedural code or good object-oriented code. And honestly, 75% of the Java code I get asked to review is POOP.

      So I seriously and unironically salute you for knowing what works for you, and valuing good code over following the latest trends.

      And a little P.S. to my fellow Java developers: If you have a lot of objects with data and no behavior (just getters and setters), or a bunch of objects with no data and lots of behavior, then that is not object-oriented programming. The first is a struct; the second is a function library. Object = data + behavior. If you aren't sure whether you're doing OO work, read Domain-Driven Design.

    52. Re:Anyone else Railed-out? by brpr · · Score: 1

      I believe that Rails does qualify as self-modifying. There is code doesn't exist at design time. Nor can I step into with a debugger at run time, because there is no associated source file.

      That isn't self-modifying code, that's generation of code at runtime. Runtime code generation is ugly (better to do it at compile time with macros, as in Lisp), but it's not self-modifying code. "Self-modifying code" is usually used to refer to assembly language hacks where you (say) overwrite an adress in part of your code to change where a jump instruction jumps to.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    53. Re:Anyone else Railed-out? by lifeisgreat · · Score: 1
      Inexperience and ignorance. And it sounds as if it applies to you and to this situation. I don't see how you can rant against "bloated" technologies you never bothered to learn. Without that knowledge, you don't understand everything that's happening behind the scenes and, since that scares you, you stick with the subset of the developmentatl universe you do know, no matter how appropriate, or inappropriate, it may be to the problem at hand.

      That's how I picked up PHP in the space of 2 hours and have nearly completed the project..

      Look I'm not against frameworks, but first impressions stick. Rails just wasn't worth the gear shifting for now, and I'm still waiting for that killer maintainable extendable Rails app to appear and justify the investment.

      I strongly suspect that once you've moved on to other victims, the next developer the guy hires will take one look at your carefully-crafted optimum solution, shudder, and then rewrite the whole thing.

      Unless he recreates the database Rails will give him problems too. I found a bug that specifying acts_as_tree and calling a list of ancestors triggers an infinite loop when you have a node that references itself as the parent (root node) due to an absent error check. That was fun to track down. Not a problem if you craft everything around Rails's way of doing things, but after that, an ignored ticket on the bug, several other bugs reminiscent of a 1.0 release and little to no incentive, I found something that would get the job done quickly instead.

      For a multi-person job I'd go ahead and learn whatever framework was mandated by the majority, be it Rails, WebOjects or UnCommon Web. For myself, I like getting jobs done quickly and cleanly, and PHP met that for this task.

    54. Re:Anyone else Railed-out? by lifeisgreat · · Score: 1

      Ah yes, POOP =)

      Glorious isn't it, that first recoil of horror when you see someone's C++/Java baby you've been called on to maintain/patch, and as the seconds pass you begin to realise just what you're in for.

      And cheers for finding something that gets the job done for you. Too many people seem to care about languages and other minutae these days, good design and planning takes a back seat.

    55. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      2 hours to finish the project in PHP?
      PHP == quick and clean?

      ok... there you go. I'll be praying for you.

    56. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      It is all right to be pissed off by smug superiority.

      But that should never be a good reason to ignore
      what could be a fantastic productivity tool.

      Speaking personally, my recent interest in Lisp, Smalltalk,
      and Ruby has rekindled my interest in programming -- my
      chosen profession. (I've done Java for ten years)

      Remember, every single community (e.g. the Java community a'la
      The Server Side) seems smugly superior to outsiders.

      Separate the technoloy from the core tech. Become an adopter.
      Don't be smug. Change the culture from the inside. Or don't.

    57. Re:Anyone else Railed-out? by lifeisgreat · · Score: 1

      Good to see you posting here - I'm very much looking forward to a 1.0 release of Django, if only so more people will have it as a hosting option. My experience with it was much more pleasant than Rails.

      And I think you know exactly what kind of guy I am after that library linking point =) - yes, I do get very frustrated when libraries have poor modularization, and linking them for a handful of functions adds 2+ MB to your app (hello wxwidgets/qt). I suppose rapid development is the name of the game these days, an old hack with wild ideas about good cpu/memory usage is out of style.

    58. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      The 2 hours consisted of becoming familiar enough with PHP to have grasped the environment, drawing up the app structure, and mapping data flows. Coding came afterwards.

    59. Re:Anyone else Railed-out? by Decaff · · Score: 1

      I rarely use SQL in my Rails apps. Pretty much only need it when I need to optimize something, which doesn't happen too often.

      It is not just how you use SQL, it is how Rails uses SQL transparently - it is still a non-optimal subset of SQL rather than the rich full-featured and optimised SQL that other ORM systems generate.

    60. Re:Anyone else Railed-out? by dubl-u · · Score: 1

      Glorious isn't it, that first recoil of horror when you see someone's C++/Java baby you've been called on to maintain/patch, and as the seconds pass you begin to realise just what you're in for.

      Heh. After a couple of very unpleasant mop-and-bucket jobs on hideous code bases, I now just have two rates. Writing new code or maintaining good code costs X, and cleaning up shitty code is 1.5x to 2x depending on the level of horror. Sometimes they say yes, sometimes they say no. Either way, I'm ok with it. A month off in Mexico restores my spirits wonderfully.

    61. Re:Anyone else Railed-out? by Just+Some+Guy · · Score: 1
      Database programmers seem to hate that approach because it shifts the center of gravity away from the database and toward the web app.

      Even though I'm hardly a DBA, I hate that approach for the exact same reason. In my company, we don't have the privilege of rolling out a database that supports only one application. Instead, we have a huge legacy application written in Visual FoxPro, the web stuff that I've written in Python, and some lightweight apps (like custom image viewers) written in various .NET languages. We're moving more and more logic into the database - PostgreSQL on a beefy server - because that's the only component common to all these systems, and because that's were a lot of it belongs.

      --
      Dewey, what part of this looks like authorities should be involved?
    62. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      OO fails with the same reason given for failures in communism. "They didn't do it right." That's a huge failing of OO. We need to figure out an OO language, approach, framework, something that does not allow it to be done incorrectly. Until we find a way to not let OO be implemented incorrectly 75% of the code the you see will definitely be POOP.

      The OO people, me included, have failed OO. I've been working on some new techs that defer just about everything to the computer. It uses a lot of inference, rules, etc but even it requires good modeling (and it has to fight against people that want to control everything - controlling everything is about as anti-OO as you can get).

    63. Re:Anyone else Railed-out? by swimmar132 · · Score: 1

      Say that's true. When does it matter? And how does Rails prevent you from changing it?

    64. Re:Anyone else Railed-out? by TemporalBeing · · Score: 1
      Heck I don't even like C++ for fogging-over-functionality with inheritance, virtual functions and overloading.

      You don't have to use those C++ features if you don't want to. You can program in C-style in C++ if you wish. virtual and inheritance are optional. These days templates do most of what inheritance and virtual functions can do. And I don't understand why you would dislike overloading.
      While I personally like function overloading, there can be a case for not using it when a function that could be named the same and take different parameters does completely unrelated things. Sometimes it is good to have a different name instead of using overloading. It's balancing the two that is tricky - neither should be completely tossed-out or ignored.
      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    65. Re:Anyone else Railed-out? by Decaff · · Score: 1

      Say that's true. When does it matter?

      Suppose someone taught you how to drive a car, but would not let you go beyond third gear, as not all cars have more gears - would you be content? Of course not! So why are you happy with Rails only using 3 of the gears with its SQL?

      And how does Rails prevent you from changing it?

      Rails doesn't - you can always implement your own automatic sensing of database capabilities and patch in use of extra SQL where feasible.

      But this is really dumb! There are products that do all this for you - why should you have to do this yourself? It is so primitive.

    66. Re:Anyone else Railed-out? by killjoe · · Score: 1

      If SQL actually delivered what it promised then maybe there would be no need to ORM but since each database vendor insists on creating their own language we need ORM.

      Having said that ORM also allows for faster re-factoring. If you change a field name in your table you don't have to hunt down all your SQL statements, you just change your mapping and you are done.

      --
      evil is as evil does
    67. Re:Anyone else Railed-out? by killjoe · · Score: 1

      Alas you are presuming all that goodness you got with java comes at no cost. That's not true. It comes at the cost of developer productivity. You will probably disagree with that statement but the legion of java programmers who have used rails tell us otherwise.

      --
      evil is as evil does
    68. Re:Anyone else Railed-out? by swimmar132 · · Score: 1

      I haven't been constrained by Rails's SQL generation yet.

      And you didn't answer my question. When does it *really* matter?

    69. Re:Anyone else Railed-out? by aCapitalist · · Score: 1

      There's a reason they are called Smug Lisp Weenies.

      Don't worry though. The AC is just parroting crap he's seen on the net and has never done anything meaningful in Lisp.

      If Lisp was the greatest thing since sliced bread it would have gained more acceptance. Or maybe the smug lisp weenies are busy wanking on how great their language is instead of actually producing stuff - like RoR.

    70. Re:Anyone else Railed-out? by zardo · · Score: 1
      The problem is not with SQL, it's the resultset being returned as a 2 dimensional dataset every time. In the OOP world, if you take a giant grid and do stuff with it, your comitting a crime. A resultset object is not properly normalized either. What you want are Orders, Persons, Addresses.

      Ideally I would like to program with no persistence layer at all, i.e. an object oriented database. I haven't thought that through enought though, for now, the Object/relational abstraction actually works out quite well, I can get in and modify data and it's not very hard at all to visualize the abstraction, the only thing that is not represented well is inheritance.

    71. Re:Anyone else Railed-out? by Decaff · · Score: 1

      I haven't been constrained by Rails's SQL generation yet.

      Sorry if this sounds impolite - but I think you have, but you just don't know it yet :)

      And you didn't answer my question. When does it *really* matter?

      When performance really matters. I deal with transactions of hundreds of thousands of records, and they need to be fast. This requires optimised SQL.

      Also, maybe it is just me, but if my boss has spend thousands on a high-performance database with lots of features which can improve performance, I would feel foolish if I didn't use them!

    72. Re:Anyone else Railed-out? by Decaff · · Score: 1

      Alas you are presuming all that goodness you got with java comes at no cost. That's not true. It comes at the cost of developer productivity.

      No, it doesn't. I can design my classes visually and have the schema generated at the click of a mouse. The debate about developer productivity with dynamic vs static languages has been going on for decades, and has come to no conclusion one way or the other. Simply to state that Ruby is more productive to deny the existence of that ongoing debate, and is without foundation.

      You will probably disagree with that statement but the legion of java programmers who have used rails tell us otherwise.

      Legion? That is a strong statement, and requires evidence. Sorry, but I just don't believe it without firm numbers.

    73. Re:Anyone else Railed-out? by rossifer · · Score: 1

      Engineering died in the last decade (or maybe it's just in a coma) and things like agile (which is really just a formal declaration that engineering is hard so we're not going to do it) have really taken hold.

      Software engineering was an unfortunate experiment that attempted to segregate the value of high-level design from low-level design from coding. It's a bad plan because it makes poor assumptions about what software development really is (hint: it's not similar to either making widgets or building a bridge).

      I prefer agile processes to engineering processes because lots of up-front effort does not mitigate the actual risks of delivering a web service, or many other classes of modern application. The risk is fast moving competitors, and if you wait to code until you've designed, and wait to design until you've got all the requirements, I've just eaten your lunch.

      There is this culture of non-engineering surrounding rails, there is almost contempt for it.

      Be careful that you don't confuse "non-engineering" with "non-designed". Though I happen to agree with you in this case for either meaning, there's a subtext running throughout your post which assumes that anyone who disdains "software engineering" is also against skilled and effective design. Personally, I feel that effective design is the first skill of software development (and you already know what I think about software engineering :).

      Further, this awareness of the importance of design is widespread. Advocates of agile processes acknowledge that agile projects absolutely depend on experienced and highly skilled designers in order to have any chance at success. What agile processes don't do is require designers to create a design document which can be passed on to the coders. (The designers are also the coders, and important info about the design may be written down somewhere, but only if that's known to be a useful practice.)

      Regards,
      Ross

    74. Re:Anyone else Railed-out? by JulesLt · · Score: 1

      I can still see the benefit of ORM even if SQL did deliver on it's promise, because there is so much repetition in mapping tables to classes, that it looks like an area ripe for automation.

      However I do think that even if SQL was absolutely standard, there would still be issues (and thus issues in any abstract layer based on top of it). If the vendors could make their SQL always take the most performant path possible, they would - the problem is the age-old one of trying to get a computer to choose the most appropriate algorithm for a task - you can use heuristics and get a pretty good match most of the time (and an ORM layer will also do this) but if you could do it 100% of the time - we'd be out of a job. (Once we get a real AI then it might happen).

      What concerns me is when developers seek to turn things from time-savers (replacing tedious repetitious work that they do understand) into a replacement for problem-solving - 'well, we don't need to worry about that layer any more'.

      (One thing I think would be useful would be an ORM layer to spit out classes for Java, the .NET languages, Ruby, etc, as the D/B changes - but that might be because I see more systems with multiple languages in front, than systems with multiple D/B behind).

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    75. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      Can you point to any high quality off the shelf software that was agiled?

    76. Re:Anyone else Railed-out? by JulesLt · · Score: 1

      I agree with the first point - that's what an ORM should be used for. What I'm seeing is a tendency in some quarters to hope that you can just use an ORM and not have to deal with the database at all. I'd like to see more use of object databases - they seem a logical answer when people are using a d/b for nothing more than storing/querying objects - but they have their disadvantages - there are some things that are trivially easy in a relational system that are complex in OO - generally group ops.

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    77. Re:Anyone else Railed-out? by ikarys · · Score: 2, Informative

      Rails is MUCH more than an ORM tool with default forms. It provides you with database versioning, Scriptaculous integration (including AJAX stuff (stupid buzzword)) Elegant field validation, Mailing, Kickass MVC, Unit testing, Fairly advanced cache model, Beautiful syntax etc etc etc And combined with ruby gems (like plugins that will update/install with ease), its just too good to pass up. Every aspect of it is elegant, except unicode, and cross database transactions .... And.. i love the fact that google/yahoo will buy your company if you use it :)

    78. Re:Anyone else Railed-out? by CableModemSniper · · Score: 1

      This is why I think working in the opposite way to Rails - designing your data model in terms of classes and letting the ORM product generate a schema from that (still DRY, but in the other direction) makes far more sense - I can move my apps between those databases with no effort at all.

      If you want to do web apps in ruby in that style, you should try Nitro + Og.

      --
      Why not fork?
    79. Re:Anyone else Railed-out? by CableModemSniper · · Score: 1

      It turned out that I'd forgotten two (), and was now instantiating a variable instead off accessing the setter function. Which leads me to a problem I have with Ruby: the fact that function calls do not need (). Syntactically this is confusing.

      There's an easy solution to this particular problem, just ALWAYS use ().

      --
      Why not fork?
    80. Re:Anyone else Railed-out? by Local+Loop · · Score: 1

      That isn't self-modifying code, that's generation of code at runtime. Runtime code generation is ugly (better to do it at compile time with macros, as in Lisp), but it's not self-modifying code. "Self-modifying code" is usually used to refer to assembly language hacks where you (say) overwrite an adress in part of your code to change where a jump instruction jumps to.

      I know what it is. I've done it professionally (long ago). I was using the term out of it's normal context to make a point.

      The running program modifies itself by adding functions. Ergo, self modifying. It's ugly any way you slice it. It's also unnessecary, and born strictly of laziness and cleverness, two of the worst engineering sins.

      I thought those days were gone for good. Now a bunch of too-clever children are making the same mistakes all over again.

    81. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      If Lisp was the greatest thing since sliced bread it would have gained more acceptance.

      Because the best technical solution always wins. Have you been living in a cave, by chance?

    82. Re:Anyone else Railed-out? by rossifer · · Score: 1
      Can you point to any high quality off the shelf software that was agiled?

      I do happen to know of a few cases:

      1. Quicken uses agile processes for many of their retail products, though I can't say for certain exactly which retail products are definitely agile and which are not.
      2. Symantec and McAfee both heavily rely on XP practices for their various products, including their anti-virus offerings.
      3. Almost all of the linux distributions that you can buy have thousands of open-source sub-projects, the vast majority of which are agile to one degree or another.

      (please do not consider mention on this list a recommendation of any product, I don't particularly care for Norton or McAfee Anti-Virus)

      I personally feel that retail boxed software is a relic of a bygone era, of the same source that gifted us with software engineering. I usually walk right by those sections in stores, preferring to browse online for downloadable software, and usually choosing an open-source offering over anything I have to pay for.

      The only retail software products I've bought in the last five years were all Adobe Photoshop (7, CS, CS2). And I have no idea how agile Adobe is.

      Regards,
      Ross
    83. Re:Anyone else Railed-out? by killjoe · · Score: 1

      Somebody else on this topic has already linked to several studies that show how much programmer productivity increases with dynamic languages.

      As a Java advocate I know you are neither interested in studies nor testimonials from anybody so I won't bother hunting the post down or giving a half a dozen links. Needless to say Google is your friend and show you lots of those.

      --
      evil is as evil does
    84. Re:Anyone else Railed-out? by Decaff · · Score: 1

      If you want to do web apps in ruby in that style, you should try Nitro + Og.

      Exactly! That is a far better approach. However, it is still missing out on the portable query language capability of other ORMs, but it is a far more modern and sensible approach than Rails.

    85. Re:Anyone else Railed-out? by Decaff · · Score: 1

      Somebody else on this topic has already linked to several studies that show how much programmer productivity increases with dynamic languages.

      Yes, I have seen such studies. I have seen the same sort of studies 10 years ago. And 20 years ago. There is nothing new about them. To say that 'programmer productivity increases with dynamic languages' is a naive oversimplification of a very complex issue. There are major advantages to dynamic languages. There are also major advantages to statically typed languages. There is no simple answer as to which is more productive, and anyone who says there is has not researched the subject enough.

      As a Java advocate I know you are neither interested in studies nor testimonials from anybody so I won't bother hunting the post down or giving a half a dozen links. Needless to say Google is your friend and show you lots of those.

      Google is also our friend and will show how static typic is a real benefit for long-term maintainability, how it allows a wider range of refactorings of code and how it assists with group development.

      I am not a Java advocate (I am also a Ruby and Smalltalk user), and even if I were, to suggest I am not interested in studies or testimonials is condescending. I am an advocate of a mature and practical approach to development. It is rather amusing to see developers putting forward the same old arguments about dynamic languages as if they had discovered something new :) You haven't. The same arguments were put forward for the use of LISP and Smalltalk 20 years ago.

    86. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      I also think that the view of many Java (and Ruby) developers that a DB provides 'persistence' is wrong. It's a failure to understand relational theory

      Amen! Databases are best described as "attribute managers" IMO. Persistence is just one of many features attrib mgrs. can provide.

      relational theory - which at least, unlike most object modelling techniques, has a firm mathematical foundation.

      I don't think having a math foundation by itself makes something "good". For one, math does not have to reflect the real world (it only has to be "internally consistent"). The important thing that separates OO from relational is that relational is bound to certain rules while OO is not. These rules result in more consistency across shops and across developers. OO's inconsistency is very similar to the "navigational databases" that motivated Dr. Codd to invent relational. The only big difference I see between navigational DB's and OO is the introduction of behavior. But putting behavior into spehgetti still makes for spehgetti.

      can see it becoming more important again as browser apps support more dynamic features - getting back more towards a client-server architecture with the model on the server, view on the client. (Or more likely a local model for performance and some form of background syncing).

      I don't think a distinction should be made between the server and the client. If it is decided to say join a two tables on the client instead of the server, it should not require a complete code overhaul. A virtual (local) table and a "real" table on the DB should generally be swappable if needs change. Virtual/temp local tables can be a really nice feature.

    87. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      If SQL actually delivered what it promised then maybe there would be no need to ORM but since each database vendor insists on creating their own language we need ORM.

      How is that worse than rolling your own DB-like-thingy for each app/shop/developer? Seems that being 80% similar is better than being 5% similar.

      There are a lot of things I don't like about SQL (we should have better relational languages), but it's net advantages still outweigh roll-your-owns.

    88. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      The problem is not with SQL, it's the resultset being returned as a 2 dimensional dataset every time. In the OOP world, if you take a giant grid and do stuff with it, your comitting a crime. A resultset object is not properly normalized either. What you want are Orders, Persons, Addresses.

      But what the user wants to see tends to be relative and intertwined. If you want to see the addresses where orders are shipped, you are not in one-to-one-per-noun world view anymore. OOP does not handle relativism very well for this reason.

      object oriented database.

      These are generally a variant of the Navigational Databases that existed in the 60's. Dr. Codd replaced them and I'm glad he did. They were the Goto's of data structuring. Now OOP gives us a wad of objects that point to other objects or objects wads. No thanks, not for me. Relational gives a more consistent mental framework. In OOP I only see spehgetti: a big sea of objects. If there is a mental way to get a handle on all these, nobody has written a consensus guide. Similarly, maybe Goto fans had a system(s) to keep them strait in their head. However, they never documented it so that to us it looks like spehgetti. If you want to be the first to document OO's big picture, be my guest.

    89. Re:Anyone else Railed-out? by killjoe · · Score: 1

      "The same arguments were put forward for the use of LISP and Smalltalk 20 years ago."

      Yes and they were and are still true. Smalltalk, lisp, ruby, pyton etc are all more productive then java.

      Sorry to let you in on the secret.

      But hey don't mind me, go ahead and fiddle with your XML config files. No skin off of my teeth.

      --
      evil is as evil does
    90. Re:Anyone else Railed-out? by tumbaumba · · Score: 1

      I also think that the view of many Java (and Ruby) developers that a DB provides 'persistence' is wrong. It's a failure to understand relational theory - which at least, unlike most object modelling techniques, has a firm mathematical foundation.

      It is true that simple mapping of relational data structures brings us to some degree to pre-relational days (i.e. databases which stored data as tree structures, objects and what not). However it is somewhat mitigated by the fact that underline storage is still RDBMS and relational logic could still be incorporated in views, which would in turn could be mapped to whatever object structure we use. Not to mention that fact that majority of applications could do just fine with database as simple back end store after all.

    91. Re:Anyone else Railed-out? by Anonymous Coward · · Score: 0

      Yahoo uses PHP, Google uses Python (at least Google Groups) and Slashdot uses Perl. All three sites fit the description of "hugely popular money-making machines"

      When you start thinking "I have to use C to gain more speed", you are better off thinking "How can I cache this".

      Use the database to manage the articles, but write them to disk for improved performance. Disk-space is cheap, and provides the ultimate solution for speed.

    92. Re:Anyone else Railed-out? by JulesLt · · Score: 1

      I think that would certainly be one solution - something that worked as an object database for OO developers but allowed relational access (afterall, the point of SQL is that it should be independent of the underlying implementation). You'd effectively be putting the object-relational mapping on the other side. I can see a lot of advantages in this approach - you could integrate better with multiple OO languages - i.e. define your class in something akin to UML and spit out Java, Ruby, ActionScript, etc variations - and of course you could change the implementation of the D/B model without affecting the calling code. (You could already manually achieve something like this).

      I'd also agree entirely with your last point - it's pretty much what Bruce Tate is getting at in 'Beyond Java' - that RoR is a better solution for the 'web page in front of d/b' type app which is the vast majority of apps out there - if what you want IS just object persistence then an object database is probably a better answer than an RDBMS.

      The corollary to this is that in some cases, Java is more appropriate than Ruby, and in some cases a properly designed relational D/B is the correct solution - in the last two years I've seen someone take the 'objects serialised as XML' approach, which made sense for the initial requirement, then 3 months later the client wanted a summary of an attribute contained on a bottom node of the XML, across hundreds of objects. Ran like a dog (as in 20-30 seconds). Once we mapped it into the database the query took .5 seconds. (It's not rocket science as to why - it's always going to be quicker to parse an essentially fixed and flat record structure than a variable nested one).

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    93. Re:Anyone else Railed-out? by JulesLt · · Score: 1

      I guess compared to Java, SQL is still far less portable (in syntax and implementation), so I can see why it causes pain if you are used to writing in portable languages. (If you're willing to ignore all the 'avoid X as doesn't work on Tomcat' type stuff).

      Definitely about time for a better relational language to emerge - SQL was, after all, just the first go, rather than definitive. I presume you've seen Date and Darwen's Third Manifesto?

      http://www.thethirdmanifesto.com/

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    94. Re:Anyone else Railed-out? by JulesLt · · Score: 1

      What I've seen so far is pretty cool (been playing with it at home, but only following tutorials rather than trying ti build something of my own) - and the whole thing (Ruby and Rails) does, indeed, seem to have the 'elegance' that good programmers love.

      What I was interested in was how many of those advantages are Ruby (gems and the syntax are) and how many are Rails (MVC).

      I brought up the ORM thing though because the whole thread is about ActiveRecord and reading some Ruby community blogs, inc. DHH's, there seems to be a hostility towards relational databases - I sense that some OO developers see them as a 'problem' that can be solved (many are probably too young to remember the problem that relational databases DID solve).

      My view is that an RDBMS is a solution, just as OO is a solution, and functional programming is a solution (concurrency). The key thing, of course, is understanding what your problem is, while programmers will often start with their tool, and cast the problem to fit. (I am as guilty of that as anyone - we don't re-evaluate our tools every project, and often people come to us because of our experience in language X - if they wanted a .NET solution they will have gone somewhere else).

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    95. Re:Anyone else Railed-out? by JulesLt · · Score: 1

      I do think the mathematical foundation helps - ignoring SQL itself (Date and Darwen would love to replace it) what it boils down to are set operations, which in turn can be translated into logical ones. For me, relational seems to come from the standpoint of 'if we can cast data structure into set theory, then we have this whole body of knowledge that we can apply'. I even tend to forget this myself - writing a complex sub-query before remembering the 'MINUS' set operator exists.

      That said, I may have come across as too anti-OO - I'm not at all. It's obviously a fantastic answer for dealing with certain programming problems - GUI interfaces spring to mind as a start. As someone else hinted in another reply, in relationland we talk about the set of CHAIRS and in OO we are more interested in a CHAIR and it's behaviour. Both are valid answers to different problems, it's just deciding which one is the MAIN problem of your app.

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    96. Re:Anyone else Railed-out? by Decaff · · Score: 1

      Yes and they were and are still true. Smalltalk, lisp, ruby, pyton etc are all more productive then java.

      Sorry to let you in on the secret.


      Don't you read posts before replying? As I said, this has been a matter of debate for decades, and to say that the argument has been won one way or another is simplistic. But, I guess you don't mind being simplistic.

      But hey don't mind me, go ahead and fiddle with your XML config files. No skin off of my teeth.

      Why some developers have such a strange revulsion for XML files is beyond me. However, if you do suffer from this weird affliction, you may want to educate yourself and find out that modern Java APIs don't need them - the language has been extended to allow configuration information as annotations.

    97. Re:Anyone else Railed-out? by ubernostrum · · Score: 1

      I'm very much looking forward to a 1.0 release of Django, if only so more people will have it as a hosting option. My experience with it was much more pleasant than Rails.

      You and me both.

      And I think you know exactly what kind of guy I am after that library linking point =) - yes, I do get very frustrated when libraries have poor modularization, and linking them for a handful of functions adds 2+ MB to your app (hello wxwidgets/qt). I suppose rapid development is the name of the game these days, an old hack with wild ideas about good cpu/memory usage is out of style.

      I think that in the case of web frameworks, the OS analogy is apt; most OS APIs provide a lot of functionality that a particular application will never use, but in order to be general-purpose enough to support all the applications that will run on the OS, all that functionality needs to be there. Or one could quote the old adage about MS Word, that 90% of the features are used by only 10% of the users, but it's a different 10% for each feature.

      And, FWIW, Rails isn't nearly as bad as, say, some of the Java frameworks when it comes to cluttering up your symbol tables with tons of methods you probably won't use ;)

    98. Re:Anyone else Railed-out? by killjoe · · Score: 1

      I have told you there have been numerous studies that show the productivity gain from functional and dynamic languages. You simply have chosen to ignore those studies.

      I am happy that after a decade of fiddling XML files while the rest of us were busy coding you have finally caught up. I predict in another decade you will no longer have to type everything three times as in Customer myCustomer = new Customer() and that's the shortcut. I have seen the same thing typed as much as five times depending on the complexity of the lookup and the injection.

      --
      evil is as evil does
    99. Re:Anyone else Railed-out? by Decaff · · Score: 1

      I have told you there have been numerous studies that show the productivity gain from functional and dynamic languages. You simply have chosen to ignore those studies.

      I have told you that there have been numerous studies over decades that disagree with that conclusion. You simply have chosen to ignore this. As I said, this is a highly complex issue. This debate was going on intensely in the 80s, with Pascal and C++ vs Smalltalk and LISP. Let me repeat - there was no winner! Both sides had good arguments. The same arguments are being put forward with C++ and Java vs Ruby and Python - nothing has changed, and there are no new arguments. There are major issues about maintainability and testability (both negative and positive) regarding static and dynamic languages; there have been unmaintainable coding disasters in both types of language, raising the issue of what developer productivity actually means for long-term projects. There have been reports showing how some constructs in some dynamic languages mean that unit tests can fail to provide coverage of certain things, and major functional tests are required (which typically take a lot longer in dynamic languages). There have been reports showing how many important refactorings simply can't be done in some dynamic languages. As I said, this is complicated, and simply quoting a few studies just doesn't do the debate justice.

      I am happy that after a decade of fiddling XML files while the rest of us were busy coding you have finally caught up.

      Firstly, XML has a significant and important place as part of coding. Secondly, it has been widely used by dynamic languages with some of the best implementations of parsers being in Smalltalk.

      I predict in another decade you will no longer have to type everything three times as in Customer myCustomer = new Customer() and that's the shortcut. I have seen the same thing typed as much as five times depending on the complexity of the lookup and the injection.

      Customer myCustomer = new Customer();

      Is not a shortcut. It is a very well-established requirement of static typing. Why repeat the type here? Because of the possibility of inheritance....

      Customer myCustomer = new CustomerSubclass(); Is also allowed.

      So why define the type of 'myCustomer'? Why can't it be implied?

      Because you then always know in the code what the type is, allowing type-safety and a whole range of refactorings.

      If you prefer dynamic development, you don't need this, but if you want to use the full features of static typing, it is neither verbose nor repetetive.

      You may have seen declarations of variables done three times, but it that is way out of date. Modern Java use means you don't have to type anything three times right now; you really, really don't. For example, I am currently developing using a Java ORM. I declare my field in one place in the class, and all the accessors, configuration and schema are maintained for me automatically. I use the DRY principle and get what I consider to be the major advantages of type safety.

      If you want to keep bashing static languages based on how they were five years ago, fine (the fact that many developers still use them like that does not help, I admit).

      I realise that keeping up to date with these developments is hard, but it is worth it! Things have moved on!

    100. Re:Anyone else Railed-out? by zardo · · Score: 1
      I don't think you're making much sense. OOP doesn't handle many-to-many relationships very well? I don't know what your idea of OOP is, but in ruby, we have iterators.

      Orders.addresses.each do |address|
      address.do_stuff
      end

      So far no OOP database has hit the mark, the problem is it is mostly tied to one language. Most of the cross-platform OOP databases don't do anything more than relations and single-column indexing. What needs to happen is all of the features of a particular RDBMS need to be implemented IN THE LANGUAGE the OOP database was designed to support, so for example, instead of selecting all addresses from orders in the state of California or Nevada in SQL, you'd just say

      Orders.addresses.each do |address|
      next unless ['CA', 'NV'].include?(address.state)
      end

      This is basically what the RDBMS does when you SELECT ... WHERE state IN ('CA', 'NV') but it would be optimized in the program code. Oracle wants you to write your entire application in the database, I want the database to be in my application, that's what OOP databases should focus on.

    101. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      Oracle wants you to write your entire application in the database, I want the database to be in my application, that's what OOP databases should focus on.

      If the DB was optimized for one language, then sharing across languages and apps would be more difficult. You would be trading SQL for say Ruby as your query language. Then anything else that wanted to use the data would have to use Ruby. SQL may not be the best a relational (or any query) language can be, but let's think this thru before making Ruby the new query language standard for sharing info.

    102. Re:Anyone else Railed-out? by arief_mulya · · Score: 0

      Hmm... I'm thinking more of less the same way.

      But a little different is, I still believe that Rails is also a Good Thing (TM). Maybe not at all good for me. But yet, rails didn't out to conquer the world. Just a few percent of them.

      Anyway, I'm still searching for some "framework" in C + SQL to create a fully blown Web Based Database application which also maintainable and fun to work with. Still can't find them.

      Anyone upto the task? Or is there one/some already that I've missed?

    103. Re:Anyone else Railed-out? by zardo · · Score: 1
      Ruby fits into the dynamically typed languages category. There are few other popular languages in this category, and they can all be represented as frontends to parrot (which means perl, ruby). Statically typed OODBMS's would be fundamentally different, but could be tied into microsoft .net (mono) and support all languages in the family. There are already a few oodbms's out there for C++, I don't use C++ anymore though.

      The DB wouldn't have to be optimized for one language, it would just have to have an optimizer for the language you want to use it with. It'd be like a client API, except much more complicated.

    104. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      Do you have examples of how multiple different languages would query data from such?

    105. Re:Anyone else Railed-out? by BigGerman · · Score: 1
      >> rails has caused a lot of momentum im the java world

      Yep. These days you can get everything Rails can get you (and tons more) in Java by mixing and matching things like Spring, Hibernate 3, Spring MVC, Middlegen, .. and deploy on simple Tomcat (not on expensive app server) with security, unlimited scalability, universe of libraries, etc.

      Rails is a good framework and Ruby is an excellent language, nevertheless.

    106. Re:Anyone else Railed-out? by zardo · · Score: 1
      Well the constructs in any given language are the same, loops and what not. Some languages have shortcuts to do what they want, SQL has "cursors" that you can use to loop through resultsets.

      While a language like ruby could make use of iterators to type things faster, like Order.each(:order_by => 'date_received') do |order| in PHP for example you'd probably have to do something like foreach( Order::find(['order_by' => 'date_received']) as $order ) {

    107. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      Well the constructs in any given language are the same, loops and what not.

      But one of the selling points of query languages is that first, the server can do all the work (such as looping) for you. It is often faster to join two or more tables near the data source than on the client because doing so on the client often requires sending the entire entity's data to the client. Same with filtering. If your request only asks for say 100 records out of a million-row table, then only the matches are sent across the network. If the client (or local language) does the filtering, then the entire set has to come over.

      Second, it can calculate the optimum processing path. Relational languages tend to ask for what you want instead of how to get it so that the machine can determine how to get it and find the best path so that you don't have to. Indexing, for example, is for the most part hidden away from the SQL user (querying app).

    108. Re:Anyone else Railed-out? by zardo · · Score: 1
      The server in this case would be built into the programming language. There's nothing magic about SQL, in fact, it's just a hacked down version of any decent procedural programming language.

      If you knew how complex the SQL query optimizer was, for any given database, you'd know that the same could be implemented in any programming language. Selecting the right indexes to use, table order, all that... nothing magic about SQL, in fact there is a lot wrong with it.

      C++ is also optimized you know, you can write C++ code in a number of different ways, often times the compiler will reduce different C++ styles to the same machine code. Programming languages have so much in common with SQL it would make sense to combine them. You could practically emulate SQL in ruby.

      Order.select([column1, column2], :join => Person, :where => (Order.person_id == Person.id)).print_as_grid

    109. Re:Anyone else Railed-out? by Tablizer · · Score: 1

      It is poor effort and support factoring to build a query/DB system for *every* common language. Plus, data is often shared among different languages and tools. It appears you are trying to reinvent 100 different query languages to mirror specific languages (let alone different versions). To me that just does not make sense and is a lot of effort. I would rather see the effort put into replacing SQL with a better query language (singular).

  3. Wrong Mentality by MLopat · · Score: 4, Interesting

    People, and usually not developers, are still caught up in the idea of a programming language instead of the concept of applying an API or SDK to a task. My favorite example of this is the often held C++, C#, Visual Basic debate -- everyone has their syntax preference, but at the end of the day its the paradigm you apply that matters and not the language.

    A politician giving an address in German instead of French is not more effective as his points will still remain the same. The language isn't the tool, the intention is the tool.

    1. Re:Wrong Mentality by shutdown+-p+now · · Score: 1
      You are right to an extent, but ignoring the language issue entirely is also not a good idea. While syntactical differences are hardly important, semantics of the language can change a lot of things for the better (or worse), and strongly shape the 'paradigm' (compare e.g. JSP to SISCweb).

      And yes, language is a tool, actually. So is an SDK or a framework. So choose your tools wisely.

    2. Re:Wrong Mentality by Anonymous Coward · · Score: 0

      Bullshit. The problem is languages that restrict you so far as not to be able to solve a problem elegantly. Thus comparing C++ to C# and Visual Basic just shows how moronic your point is.

    3. Re:Wrong Mentality by ceeam · · Score: 0, Flamebait

      The language is the tool, sorry. Delphi is more powerful (tool) than VB. Python is more powerful (tool) than Java, etc. No matter what PHBs think.

    4. Re:Wrong Mentality by Anonymous Coward · · Score: 0

      why the hell was this modded interesting?

    5. Re:Wrong Mentality by NitsujTPU · · Score: 1

      That debate only really seems at all applicable in Windows, however, I should point out that those languages are very different animals. C++ is not only syntactically different, and semantically different, but its capabilities are actually different. C++ has no garbage collector, C# does, for instance, unless you're talking about managed C++, and things of that nature.

      See... it's not JUST language, though it doesn't play as major a role as people like to think.

    6. Re:Wrong Mentality by Tim+C · · Score: 1

      As I understand it, even in Managed C++ you have to enclose blocks that you wish the garbage collector to be aware of in "__gc { ..... }" or somesuch.

    7. Re:Wrong Mentality by juhaz · · Score: 1

      but at the end of the day its the paradigm you apply that matters and not the language.

      Given turing-completeness, of course you can apply anything you come up with any language, but if you need to go badly against the grain of the language to apply your chosen paradigm, it will be much more work than if you'd used language whose semantics fit that paradigm naturally, and of course that ends up hampering your productivity.

      At the end of the day, some languages are better suited for some paradigms than others, so they matter.

  4. rails by prockcore · · Score: 1

    I like rails, but the poor apache integration sucks.

    But ActiveRecord is awesome. Most of us build databases that work like objects already.. so an object oriented interface to your database is very easy to use and maintain.

    1. Re:rails by syntaxglitch · · Score: 3, Funny

      Meanwhile, people who actually understand the value of and principles underlying relational databases grit their teeth and fight the urge to beat people with blunt objects.

      Not me, though. I never "got" relational database theory and am quite content to give people nightmares with my naive object-biased approach. :)

    2. Re:rails by ziplux · · Score: 1
      the poor apache integration sucks.


      Can you elaborate on this? What is so poor about using FastCGI? It works really well on my server. Just because it's different than standard Perl or PHP CGI does not make it "poor" integration.
    3. Re:rails by chrysalis · · Score: 1

      Well, Apache integration doesn't suck, you just have to spawn Ruby through the FastCGI interface. And it's definitely worth it, even for PHP, using FastCGI is really not a bad idea.

      RoR also perfectly works with Lighttpd and unless you absolutely have to use Apache, you should have a look at it. Its lightweight, modular and speedy. Since I migrated from Apache, I never looked back.

      --
      {{.sig}}
    4. Re:rails by Grim+Leaper · · Score: 1

      There's a joke somewhere in there about an object-biased person beating up someone with a blunt relational database...

  5. Re:In a comparison, Ruby suffers for one big reaso by syntaxglitch · · Score: 4, Interesting

    Kind of ironic, really, given that Ruby actually comes from a country that uses a non-ASCII alphabet... well, not really an alphabet at all, actually.

  6. Uhhh.... by wbren · · Score: 4, Funny

    Everyone knows that no programming language is a perfect fit for every job.

    I program in raw machine code. It's a perfect fit for every job, every time!

    --
    -William Brendel
    1. Re:Uhhh.... by wanorris · · Score: 2, Insightful


      I program in raw machine code. It's a perfect fit for every job, every time!


      How's client-side web page scripting working out for you?

    2. Re:Uhhh.... by MindKata · · Score: 0

      "I program in raw machine code. It's a perfect fit for every job, every time!"

      And how is that "Hello World" Operating System coming along ;)

      --
      There are 10 kinds of people in the world... those who understand binary and those who don't.
    3. Re:Uhhh.... by A+beautiful+mind · · Score: 2, Funny

      Bah, that's nothing! The first rule of starting a programming project:

      Get five tons of sand and then...

      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    4. Re:Uhhh.... by Ziviyr · · Score: 5, Funny

      I guess the answer for that is "works great on IE!"

      --

      Someone set us up the bomb, so shine we are!
  7. Still looking for an IDE by bogaboga · · Score: 3, Funny
    I am still looking for a Ruby IDE on either Linux or Windows. May be I am looking for what does not esist, but my sense of an IDE is something like Access/VB for Microsoft's Jet Database Engine.

    Here, we simply drag and drop then program the logic behind all those widgets we've dragged onto the form. I also looked for something in relation to Python but could not find anything! I taught VB myself using this method. Current IDEs I have looked at make things confusing. Am I looking for what does not exist? Hope not!

    1. Re:Still looking for an IDE by gnud · · Score: 2, Informative

      - http://wiki.python.org/moin/IntegratedDevelopmentE nvironments
      If you need a drag'n'drop gui editor, try Eric (pyQT( or BoaConstructor (wxWindows).

    2. Re:Still looking for an IDE by lifeisgreat · · Score: 3, Informative

      Try RadRails - it's the best Rails-specific IDE I found during my brief searching. I noticed a few bugs, but at least it's still being developed.

    3. Re:Still looking for an IDE by k2r · · Score: 4, Funny

      > Here, we simply drag and drop then program the logic behind all those widgets
      > I taught VB myself using this method.
      > Current IDEs I have looked at make things confusing.

      Nothing personal but: This explains much of the VB code I had the misfortune to see in my life.

      k2r

    4. Re:Still looking for an IDE by Anonymous Coward · · Score: 1, Insightful

      If you've got the time, you might want to try to learn how to really code instead of looking for a better crutch...

    5. Re:Still looking for an IDE by killjoe · · Score: 1

      What you have done leads to unmaintable code. Since the greatest part of the software development lifecycle is the debugging, maintaining, and refactoring part using VB actually is a drain on the productivity of your team when you measure the entire lifecycle of your application.

      Sure it only takes a day to slap controls in a form and bind some controls to a SQL statement but good luck trying to find a bug or refactor when you decide to change a field name.

      --
      evil is as evil does
    6. Re:Still looking for an IDE by MemoryDragon · · Score: 1

      Java Studio Creator 2 is your friend... Exactly what you are looking for, and it is free.

    7. Re:Still looking for an IDE by Chaoticmass · · Score: 1

      I find the strength VB's IDE, the thing I wish other IDEs for other languages had most, is Intellisense. I like when I design my own classes and then use them that it shows me whats public to the class, helps me make sure I didn't leave something public that shouldn't be. I like it when I'm using an unfamiliar class/dll/control that it shows me what it's exposing. I like that if I mis-type the name of something, and the intellisense doesn't show up, then I know I made a typo somewhere.

      Intellisense is good, but I've become too dependant on it. I also dont like to be locked to one platform anymore with closed source tools. Currently exploring python as an alternative. Everyone gives VB shit, but I think VB (classic VB) is like a powerful sports car, it is just all too often kiddies hop in and drive straight into a telephone pole. Most of the people who are capable of good things with VB either do so quietly and no one notices thier good work, or they do thier good work in other languages.

    8. Re:Still looking for an IDE by aCapitalist · · Score: 1

      This was modded funny, but Microsoft continues to dominate because they actually know that a lot of people want this and so provide it.

    9. Re:Still looking for an IDE by moexu · · Score: 1

      Komodo is a cross-platform IDE that handles scripting languages nicely. Komodo 3.5 has support for Ruby and Rails. Not free as in beer but cheap for personal use.

      --
      "Seek first to understand." - Socrates
  8. Now, more buzzword-friendly? by Animats · · Score: 0, Flamebait
    "Active Record", I gather, is some kind of database wrapper. That's useful, but it's not a breakthrough. I've done similar things in Perl; one of them drives Downside's financial statement extractor. Admittedly, object-oriented Perl 5 is textually clunky, but adequate.

    This "let's use all-new terminology and claim we have something new" stuff is annoying. Especially for what are, really, rather minor improvements.

    1. Re:Now, more buzzword-friendly? by wanorris · · Score: 1

      Active Record is just the name of the persistence layer used in Rails, not some attempt to call persistence a new technology.

      I don't want to start a language war, because there are a lot of things that Perl is very good at. But I've done medium-scale application development in object-oriented Perl, and I came away from the experience convinced that object-oriented Perl just doesn't work very well above a certain scale -- very few of the things that make it easy to abstract things and work with multiple developers on a common project are there. As always, YMMV based on particular circumstances.

      Ruby's syntax is similar to Perl for a number of areas, but the object orientation is a lot cleaner. Neither Ruby the language nor Rails the framework is perfect, but it can be a very productive toolkit for MVC web applications.

    2. Re:Now, more buzzword-friendly? by ziplux · · Score: 2, Informative

      An object-relation mapping (ORM) that "just works" and uses reflection on the database to produce business objects without the developer writing more than 3 lines of code is anything but a minor improvement. ActiveRecord is also more than an ORM. It allows developers to declare that an object "acts as a list," which then allows the object to be sorted in an array. There are many other such "meta-programming" constructs in ActiveRecord.

      It also gives you a lot of stuff for free; migrations from one database schema to another, for example, are wrapped in ActiveRecord calls and are thus database-agnostic. You don't have to worry about packaging one SQL update file for MySQL and another for Postgres and another for MS SQL. The console is really cool too...it allows you to interactively play with your objects. You can even run it in 'sandbox' mode, so that all of your changes are rolled back when you're done playing.

    3. Re:Now, more buzzword-friendly? by I+Like+Pudding · · Score: 1

      You haven't the slightest idea what you are talking about. It said right in the article it was an ORM - you're acting like it was hiding this fact in order to hype it up. I guess we have reached the pinnacle of ORM design, anyhow, because Animats already wrote something similar in Perl. Have you ever used ActiveRecord? I have; it's quite an interesting ORM, unlike others I have used before due to the heavy reliance on polymorphic method naming.

      Really, did you even read the article?

    4. Re:Now, more buzzword-friendly? by badmammajamma · · Score: 0, Flamebait

      Cool, and how well does Active Record's cache work in a clustered environment? Oh, nevermind...AR doesn't support database caching and lets not even get started on clusters. N+1 got you down? lol...sorry but this crap is so amatuer hour I don't know where to start. I can't wait for Rails enthusiasts to get their heads out of their asses. Have fun with your new toy!

      Seriously, this tool existed a long time ago...it's called Microsoft Access. Access is better though. You can do drag and drop for your screens.

      --
      Any man who afflicts the human race with ideas must be prepared to see them misunderstood. -- H. L. Mencken
    5. Re:Now, more buzzword-friendly? by scottyboy · · Score: 1

      I think that you're missing the point. There's more to ActiveRecord than just DB wrapping: It's Ruby's strengths of reflection and meta-programming, and being able to dynamically add methods and properties to objects at runtime that allow ActiveRecord to really fly, and that is why people get excited about it. Sure you can still do these things in Perl, but it's more painful.

    6. Re:Now, more buzzword-friendly? by Trigulus · · Score: 1

      whats the matter.. you couldnt understand RoR? Your statement about access is so far off base that I doubt you have ever read more than crappy slashdot posts about it. you have fud packed so far up your ass its coming out of your mouth.

      --
      If something exists that does not need a creator (god) then why must the cosmos need one?
    7. Re:Now, more buzzword-friendly? by thrills33ker · · Score: 3, Insightful

      Oh, get over it. Does this have to happen any time anything developed less than 10 years ago is mentioned on slashdot? Ruby on Rails being the current favourite example. Here is how it goes every time...

      Article: "here is a link to an interesting review of (insert technology here)".

      Random guru: "That's nothing! I wrote something similar myself 6 years ago using perl/punchcards/blood from my own hand!"

      Elitist Java developer: "Hahaha! You amateurs! How does your pathetic toy deal with redundant HA database clusters in a real-time mission-critical enterprise environment with a 5-nines uptime guarantee? Come back when you've grown up!!"

      And so on. Personally, I'm a big fan of Ruby on Rails. I'm rather bored of seeing it compared to Java, a language I have never used. I moved to RoR from PHP, and let me tell you, its like a breath of fresh air. Yes, I could develop the exact same websites using PHP, but it involves writing a lot more code. Aren't computers supposed to do mundane work for us? Why make life difficult for yourself - I'm interested in results, not in worrying about whether I've escaped my SQL queries correctly using some function I had to write myself because PHP can't even do that properly.

      Bottom line - RoR means better sites with less work. And that means more time to concentrate on making sites better for users, which is really what its all about.

    8. Re:Now, more buzzword-friendly? by 16K+Ram+Pack · · Score: 1
      Actually, the poster is right.

      I worked on mainframe 4GL systems nearly 20 years ago that could do screen to record mapping. Likewise, MS Access has had the same functionality for a long time.

      The point is that ActiveRecord type technology is nothing new, nothing revolutionary. It's also very seductive, until you actually start using it for real, and find that in a lot of environments you don't simply do a table read/table update for a lot of applications. You often need to take a view of data across many tables, or do updates that are more complex.

    9. Re:Now, more buzzword-friendly? by mini+me · · Score: 1
      You often need to take a view of data across many tables

      What's so hard about that?
      @table1 = Table1.new(params[:table1])
      @table2 = @table1.build_table2(params[:table2])
      You're not confusing ActiveRecord with Scaffolding are you? Nobody uses the latter in the real world.
    10. Re:Now, more buzzword-friendly? by Local+Loop · · Score: 1

      Do you use any of the Class::* modules?

      I use Class::MethodMaker. It's nice for declaring member variables but OO is pretty clunky it perl 5, and Perl 6 doesn't seem much better.

    11. Re:Now, more buzzword-friendly? by badmammajamma · · Score: 1

      My comment about Access is admittedly a bit of a stretch but everything else is spot on. It's a toy. Not there's anything wrong with toys just so long as the Rails fanatics are willing to admit it (which of course they aren't). I'm guessing most of them don't even understand what I was talking about in my original post.

      --
      Any man who afflicts the human race with ideas must be prepared to see them misunderstood. -- H. L. Mencken
    12. Re:Now, more buzzword-friendly? by 16K+Ram+Pack · · Score: 1

      no, I'm thinking more about retrieving a much more complex data query than that.

    13. Re:Now, more buzzword-friendly? by Trigulus · · Score: 1

      there is nothing stopping you from doing whatever query you wish to do. why does everybody assume that the simple example stuff in the demos and crappy articles are all that RoR has to offer. Do some research before completely dismissing something as a toy. I have been programming database applications for more years than most slashdot posters have been alive and I see a ton of value in RoR. No it is not for every situation but its damn sure a good fit for most. Most peoples opposition seems to stem from they cant grok it in an instant so it must be crap. I found the learning curve to be about 2 weeks and have found nothing I cant acheive in a elegant and efficient maner. RoR is the most well thought out framework I have ever used and I have used a ton. Its not perfect but what is? If you dismiss it you are missing out. Once you understand the internals of the framework you will be better off when developing in other platforms as well.

      --
      If something exists that does not need a creator (god) then why must the cosmos need one?
    14. Re:Now, more buzzword-friendly? by 16K+Ram+Pack · · Score: 1

      I hear where you are coming from, and I'm not dismissing RoR out of hand. I'm just saying that sometimes frameworks can be very seductive, and that demos can often make things appear as a shortcut.

    15. Re:Now, more buzzword-friendly? by dubl-u · · Score: 1

      Aren't computers supposed to do mundane work for us? Why make life difficult for yourself - I'm interested in results, not in worrying about whether I've escaped my SQL queries correctly using some function I had to write myself because PHP can't even do that properly.

      A note for the job-seekers out there: When I'm hiring, this attitude is the number one thing I look for. Why? Because a developer who automates away the boring parts of the job has much more energy and brainpower to devote to the important work. There are a lot of people who know how to program, but it's a distressingly small percentage who understand that their job isn't programming, it's making things happen, and doing that better and better.

    16. Re:Now, more buzzword-friendly? by thrills33ker · · Score: 1

      So, are you hiring? :-)

    17. Re:Now, more buzzword-friendly? by Run4yourlives · · Score: 1

      Cool, and how well does Active Record's cache work in a clustered environment?

      Why don't you build one and find out? If you don't have one, what the hell are you worried about that for?

      It's like asking how well you toyota will withstand the pressures of the antartic climate... who the fuck cares?

  9. Re:In a comparison, Ruby suffers for one big reaso by Anonymous Coward · · Score: 0

    eh?

  10. Until.. by Anonymous Coward · · Score: 0

    You want to port it to the embedded 6502 in your special elite gizmo device.

  11. language matters a great deal by idlake · · Score: 4, Insightful

    everyone has their syntax preference, but at the end of the day its the paradigm you apply that matters and not the language.

    The differences between C++, C#, and VisualBasic are far deeper than syntactic. C#, for example, guarantees fault isolation, while C++ does not. C# has full reflection, while C++ does not. Programmer productivity in different languages can be orders of magnitude different.

    Of course, most working programmers have the same superficial view of programming languages as you do and will make the same glib and ill-informed analogies to natural languages that you did. That's why people keep choosing C and C++, believing the differences to other languages to be merely syntactic, and then producing code that crashes, silently mangles data, and has gaping security holes.

    Fortunately, the herd mentality is driving even people who don't know what they are doing away from C/C++. Even your own company bills itself as a .NET development house. You may not understand why C# is better for you than C++, your productivity may not increase, but the fact that you have switched means that your software will ultimately still cause fewer problems.

    1. Re:language matters a great deal by NitsujTPU · · Score: 2, Insightful

      Ask developers at Microsoft if they developed Vista in 100% C# before taking that perspective young man, you might be surprised at the response that you get.

    2. Re:language matters a great deal by idlake · · Score: 3, Interesting

      Ask developers at Microsoft if they developed Vista in 100% C# before taking that perspective young man, you might be surprised at the response that you get.

      Thank you for illustrating my point.

      Microsoft has, in fact, hired many of the top language designers of the world because they think languages matter.

      Microsoft has been pushing hard for a move to managed runtimes.

      And Microsoft's severe problems with their previous C/C++ efforts are the reason for that.

      So, lots of people at Microsoft have come to the conclusion that languages matter a great deal, and that's why they are investing probably hundreds of millions of dollars in that.

    3. Re:language matters a great deal by AArmadillo · · Score: 2, Informative
      Programmer productivity in different languages can be orders of magnitude different.
      Most studies show that this is blatantly untrue -- programmer productivity is generally independent of language chosen. In other words, given an 'average' programmer with X years of experience in their language, they will take about the same amount of time to complete a given task in their language.
    4. Re:language matters a great deal by aricusmaximus · · Score: 4, Informative

      Most studies show that this is blatantly untrue -- programmer productivity is generally independent of language chosen.

      Excuse me? Which studies?

      Certainly not this one:

      http://page.mi.fu-berlin.de/~prechelt/Biblio/jccpp rt_computer2000.pdf

      Nor this one:

      http://www.erlang.se/publications/Ulf_Wiger.pdf

      Nor even this one:

      http://www.theadvisors.com/langcomparison.htm

      And this well-regarded programmer certainly doesn't agree that the choice of language doesn't matter:

      http://www.mindview.net/WebLog/log-0025

      I tell you what -- interview a group of experienced programmers for a prospective project to write a database-backed web application with complex requirements. Tell them that they will be required to program in assembly language because "most studies show that... programmer productivity is generally independent of language chosen." Record their responses and post them to Slashdot.

    5. Re:language matters a great deal by rk · · Score: 1

      Will you provide references to these studies? I'm a much better C programmer than a Perl programmer (with fifteen years to seven years ratio of working in them regularly), but I guarantee you that if you ask me for a web application using CGI and say I can write it in C or Perl, I'm going to write it in Perl, I'm going to deliver it sooner, and it will have fewer bugs when I do.

      Of course, if I have free reign to do it they way I'd like to, I'd do it in either PHP or mod_python, and deliver it even sooner, and I only have a couple years with PHP and about five with python. Maybe I'm a mediocre C programmer and a freakin' awesome Python programmer, but I've gotten too many compliments on the readability and reliability of my C code over the years to think that's the case. I would generally rate myself as a very good programmer but not a great programmer. These four languages all have their strengths and weaknesses and they work better or worse for different things.

      I acknowledge that my experiences are merely anecdotal, but my personal and observational experience still trumps a vague "most studies" claim.

    6. Re:language matters a great deal by Q2Serpent · · Score: 1

      Would this still be true if you had CGI libraries in C?

          #include <cgi.h>
          #include <db.h>

          int main() {
              if (param("file_id")) {
                  char *cols[] = { "id", "file", NULL };
                  record *r = db_select(cols, "file_table");

                  if (r && row_count(r) == 1) {
                      do_something_with_file_data(row_value(r, "file"));
                  }
              }
          }

      Now, I'll agree that some languages have better *libraries* for this sort of thing, and the syntax does help *some*, but really, if you had the right libraries in C, it would not be orders of magnitute easier to write, and you may get some speed benefits to boot.

      It's not just about the language.

    7. Re:language matters a great deal by aCapitalist · · Score: 1

      Most studies show that this is blatantly untrue -- programmer productivity is generally independent of language chosen. In other words, given an 'average' programmer with X years of experience in their language, they will take about the same amount of time to complete a given task in their language.

      I call bullshit on that. The studies that are usually touted say that the number of lines of code that any particular developer writes in any language will be roughly equivalent, not that it will take about the same amount of time to complete a given task irregardless of the language.

      But that should be obvious. Assembly compared to Ruby for manipulating some text?

    8. Re:language matters a great deal by NitsujTPU · · Score: 1

      Ok. I've heard that, but what are your sources citing problems with C/C++? I've heard about equally that they are unable to do a great deal of what they would like in C#. I can't claim firsthand knowledge, but, this was from someone who has firsthand knowledge.

    9. Re:language matters a great deal by idlake · · Score: 1

      Ok. I've heard that, but what are your sources citing problems with C/C++?

      I'm not sure what you are asking for. There is a literature going back 20 years about trying to make C and C++ type safe. Microsoft themselves has come up with several (research) modifications trying to fix C and C++, until they finally gave up and adopted C#. Look around the Microsoft Research web site for their past efforts.

      I've heard about equally that they are unable to do a great deal of what they would like in C#

      C# has full pointer manipulation support, so I can't imagine how they felt constrained.

      That isn't to say that C# is the best programming language for all applications. In fact, for some specialized applications, one does need languages without garbage collection and without reflection (but 99% of the programmers out there aren't writing such applications).

      And as a purely practical matter, one often has to choose C or C++. I've been a C and C++ programmer for about two decades. But that's knowing full well the limitations of those languages. The primary reason for choosing C or C++ is their popularity, not their design.

    10. Re:language matters a great deal by NitsujTPU · · Score: 1

      I'm actually not sure either. It was just outside my area enough to where I didn't really pursue the topic.

    11. Re:language matters a great deal by Anonymous Coward · · Score: 0

      In other words, given an 'average' programmer with X years of experience in their language, they will take about the same amount of time to complete a given task in their language.

      Riiiggghhhht. A higher-level language that makes it easier to map the requirements to an implementation isn't going to help at all. Nope, no improvement in the tools we use to develop software will improve our productivity. This is evidenced by our lack of improvement since the old days of punchcards.

    12. Re:language matters a great deal by Phleg · · Score: 1

      On the other hand, studies have shown that the number of bugs in code is strictly tied to the number of lines of code, thus giving favor to more terse languages.

      --
      No comment.
  12. ActiveRecord for the New Developer by Anonymous Coward · · Score: 1, Informative

    I have to give a shout-out to Ruby on Rails and database handling - specifically for the new developer. I've seen clients of mine (whom I consult and help deploy Rails apps) new to OO latch on to ActiveRecord very quickly, and the rapidly growing support (and marketing!) for the Rails community is promising for its long-term success.

    Kudos to Yukihiro, David, Dave, Thomas, and the hundreds of others who have put together Ruby and the Rails framework to help developers grow the Web 2.0.

    ~William
    www.RailsHosting.org

    1. Re:ActiveRecord for the New Developer by Anonymous Coward · · Score: 0

      Long as we're on the subject of randomly linking things in a promotional manner, I have to counter your Web 2.0 mention with a dash of http://fuckweb2.com.

  13. No kayaking for once! by LarsWestergren · · Score: 3, Funny

    I'm amazed, a whole article by Bruce and not a single anecdote about kayaking. His writing is improving. :-)

    --

    Being bitter is drinking poison and hoping someone else will die

  14. Really a time saver by pmontra · · Score: 4, Interesting

    I recently wrote two applications that included a registration form, validation checks, sending email with a URL to click to confirm the registration and finalizing the registration.
    I wrote the first one in Java and the second one with Ruby On Rails, to learn the language and experiment with the framework. The Rails application needed half as much time to be coded than the Java one, despite being totally new to Ruby and to Rails.
    The merit goes almost entirely to ActiveRecord and expecially to the validation feature.
    Another time saver is Ruby's being interpreted instead of compiled. That saves a few time at every change to the code, even if strong type checking at compile time would have occasionally saved me a lot of time. It's difficult to assess if I gained or lost time.
    What I'm looking forward to now is a good ActiveRecord implementation for Java because Rails is great but Ruby's syntax is really appalling. Even Perl (admittedly one of my languages of choice) looks more consistent. On the other side, halving development time is something that tempts me a lot. Java on Rails would be great.

    1. Re:Really a time saver by supersnail · · Score: 1

      This would be possable in theory.

      But your talking java programers here. Look at what the java community has come up with to solve the same problem -- JSP, plus struts, plus JDBC
      but that proved inadequate so they stacked the whole mighty ediface of J2EE
      on top of it.

      That the Java communuty could come up with a simple clean usable
      solution for anything is no longe feasable.

      If you want to see a Java programmer self-combust just set the following
      simple task:
      "Define 'bloat' in less than 9000 words".

      --
      Old COBOL programmers never die. They just code in C.
    2. Re:Really a time saver by MemoryDragon · · Score: 1

      something like Seam? took me around 20 lines of application code to develop a simple blogger with master detail view...

  15. Rails rocks (but isn't a silver bullet) by PetriWessman · · Score: 5, Informative

    I've been playing around with Rails and AR quite a bit lately, and it has changed the way I think about programming in many (positive) ways. I come from a heavy Java / J2EE background (do that for a living, serverside systems), and Ruby + Rails is a breath of fresh air. Ruby is simply a wonderful language, there is something very "zen" about it, and Rails is inspired. Sure, it builds on a lot of old concepts, but the brilliance is where it leverages the power of the Ruby language to do things in very efficient and nice ways.

    Yes, there is a lot of "black automagic" involved in Rails. It's where the power is, and you can override pretty much everything is you want to. If you're uncomfortable with magic stuff happening behind the scenes and don't want to learn Ruby so you really understand that magic, Rails might not be for you.

    I'd claim that pretty much every serious programmer (VB scripters don't count :) should learn Ruby, at least the basics. It might not become your new favorite language (like it has for me), but it will give you a fresh new perspective on how to code stuff.

    Ruby does have a few downsides:

    • There is no Unicode support. For a language coming from Japan that's surprising (and sucks). I'm given to understand that fixing this is in the roadmap for Ruby(?).
    • It's an interpreted language (like Perl, Python etc), so if speed really is an issue for you then it's not a good choice (for most things nowadays, Ruby is more than fast enough)
    • The scoping of variables in blocks is a bit funky.
    • Some of the organization in the standard libraries is a bit weird, and there is some repetition of functionality. I think this is due to historical reasons (std lib code has evolved over the years)

    (there are probably more, but I'm still only learning the language)

    As for Rails, well, again there are downsides. Nothing is perfect.

    • No Unicode support (inherits Ruby weakness). For web apps, this really sucks.
    • Poor localization support in general (again, sucks).
    • ActiveRecord is nice, but works best for from-the-ground-up projects. Integrating with a legacy schema might get ugly, a mapping layer (like Java's Hibernate) would work better there.
    • No support for clustering and other heavy-lifting technologies. If you're building a seriously big app, Rails might not be the optimal choice. But face it, 99% of web apps don't need stuff like that. Right tool for the job, and all that
    • Still a young framework, and evolving. This is both good and bad. Bad, since the framework is changing while you code. Good, since it means that bugs (and maybe the above weaknesses, too) are getting fixed.

    So: it's not a silver bullet. Nothing is. But for a large majority of the modern-day web app use cases, it's very nice, productive and, well, elegant. It lets you to do quick prototypes and keep your code clean, you don't end up with the insecure and ugly mess most PHP apps end up being.

    1. Re:Rails rocks (but isn't a silver bullet) by Peter+Cooper · · Score: 1

      The lack of Unicode support isn't such a major deal. Most applications developed in Rails just push information around from database to user and vice versa without needing to 'do' much with it. Unicode will 'go through' a Rails application just fine. It's not as if your non ASCII text will suddenly disappear or get changed (unless your logic sets out to do this).

    2. Re:Rails rocks (but isn't a silver bullet) by MemoryDragon · · Score: 1

      Well rails is a very good framework + toolset, but like every other enforcing toolset which tries to cover a lot of ground by automating stuff it has a huge problem, follow the road and you are set, if you cannot follow the road you are screwed. That is pretty much the problem with all toolsets which give you a lot of expert automation. A perfect example for this in the java world is maven, an excellent tool, but even the maven documentation says, use the structures provided by maven otherwise you will have a rough ride. In the end you always will have to make a decision between verbosity (which general solutions usually have and only can be covered to some degree by a language for framework) and automatisation which means enforcing a certain road to follow and if you find out that the road does not work for you once the application is finished to 70% you really have a problem on your hands. And thus a framework like Rails, or Seam, Trails or Seaside you name it, always has to be cleanly evaluated if you can apply it, there is no hammer for all, and things which might work for small stuff might become desastrous once things become bigger, customer demands rise and the team becomes bigger.

    3. Re:Rails rocks (but isn't a silver bullet) by consumer · · Score: 3, Informative

      I don't know about Python, but Perl and more recent versions of PHP are not interpreted. They are compiled to opcodes and then the opcodes are executed. With a persistent environment like mod_perl, you are always running the compiled code after the inital load. Both of them have much better base language performance than Ruby does at this point. I expect that Ruby will eventually work this way too.

    4. Re:Rails rocks (but isn't a silver bullet) by Antity-H · · Score: 1

      Actually it's not so simple. With ruby and rails, the length method of string "breaks" on unicode string, since it returns the number of bytes and not the number of characters. Thus even if the user typed 5 characters he could get a message saying "input too long, maximum length allowed 7 characters" and there he is lost.

      see http://www.fngtps.com/2006/01/encoding-in-rails for more.

    5. Re:Rails rocks (but isn't a silver bullet) by revscat · · Score: 3, Informative

      Well rails is a very good framework + toolset, but like every other enforcing toolset which tries to cover a lot of ground by automating stuff it has a huge problem, follow the road and you are set, if you cannot follow the road you are screwed.

      I have seen this complaint lodged many times, and at first I was concerned about it because of this, but I have yet to actually run into it. Rails is flexible enough that all the conventions it uses are overridable, and if you know of any exceptions to this please let me know, because I am still evaluating it. For example: by default AR assumes your primary key column is named id, but you can override that per-table if you like, or globally via environment.rb:

      ActiveRecord::Base.primary_key_prefix_type = :table_name_with_underscore

      Similarly, while AR expects plural table names, you can override that with the following:

      ActiveRecord::Base.pluralize_table_names = false

      So I don't agree with the (overly stated, IMHO) belief that Rails falls on its face when you move outside its conventions. My experience does not match this.

    6. Re:Rails rocks (but isn't a silver bullet) by ChaosDiscord · · Score: 1
      I don't know about Python, but Perl and more recent versions of PHP are not interpreted. They are compiled to opcodes and then the opcodes are executed.

      Have you ever considered how those opcodes are executed? I assure you that in the common case the generated opcodes are not native instructions for your CPU.

      If by interpreted you mean, "parsing each line of code as it's needed" and by not interpreted you mean "on startup compiling the code to an intermediate representation that is more efficient", I suppose it is true that Perl, Python, and PHP are not interpreted. But I'd be shocked if that wasn't true for Ruby as well.

    7. Re:Rails rocks (but isn't a silver bullet) by consumer · · Score: 1

      Sure, I realize that it gets compiled to an intermediary format, not to machine code, but it still makes a huge difference. The way Ruby lags behind the others in performance is frequently discussed on blogs and mailing lists. Ruby does not currently compile to bytecode, although according to Wikipedia this is planned for an upcoming release. Wikipedia also says that Python is compiled to bytecode.

    8. Re:Rails rocks (but isn't a silver bullet) by HiThere · · Score: 1

      But this is the way that MOST interpreted languages have worked, back to the days of UCSD Pascal. Even prior to that I think that there were tokenized Basics. That's the way interpreters *usually* work, and calling them compilers is obscurantism. They have a compiler as a piece of them, but that's hardly the same thing. (For that matter, in Python, if you so choose, you can turn parse, compile, and execute into separate steps. You need to use library routines to accomplish this, but look under parser and "abstract syntax tree". [The error message handling could be improved, but there's rarely any need to do things this way.])

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    9. Re:Rails rocks (but isn't a silver bullet) by consumer · · Score: 1

      Java compiles to bytecode, but people still call it a compiled language. The only difference is that Perl doesn't keep the intermediary format around on disk afterward. I would agree though that the distinction between compiled and interpreted is less clear and less important than it was in the past. The main point is that these other languages compile to an intermediary format and Ruby doesn't, which contributes to it being slower than the rest.

    10. Re:Rails rocks (but isn't a silver bullet) by HiThere · · Score: 1

      There are those who call Java a compiled language. It is, look at gcj (actually even there I think only a large subset of java is compiled, and a part ends up being interpreted [see gij]). I call Sun's java an interpreter, however. That many call it a compiler proves the efficacy of marketing.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  16. Re:In a comparison, Ruby suffers for one big reaso by Fweeky · · Score: 1

    The current engine's something like a decade old, so it's hardly surprising. Ruby 2 is supposed to greatly improve support for Unicode, along with just about everything else.

  17. Java is not the perfect language for every problem by wysiwia · · Score: 1

    What a revolutionary insight of a Java-follower! Congratulation, when looking at all these language flamewars, its extra ordinary that anybody can mention this and even be published by a company which bases their SW business on Java.

    I'd like to give Bruce Tate or IBM some tips in which direction they might venture to get more insight:

    - Web-Clients: HTML + Javascript with the Dojo toolkit (http://dojotoolkit.org/)
    - Web-Servers: PHP/Perl/Ruby/..., whatever you like
    - Binary applications: C++ with the wxWidgets framework (http://www.wxwidgets.org/)
    - Database: SQL with ... (not enough knowlegde to make recommendations)

    There are probably many more areas with recomendations but not from me, so just add your own. But think there isn't a perfect language for everthing so it should be now clear that one needs a multi language strategy to become or stay successful.

    O. Wyss

    --
    See http://wyoguide.sf.net/papers/Cross-platform.html
  18. Now, if he could apply the same wisdom to SQL, etc by expro · · Score: 2, Insightful

    What turns me off is forcing you to store all your data persistence into SQL and relational tables, when it is clearly a hierarchy of objects. Why does everyone think they have to do that? The software would function much more simply and the data would typically work better without it.

  19. Re:In a comparison, Ruby suffers for one big reaso by Trejkaz · · Score: 1

    Maybe it's okay with things like EUC-JP and SHIFT-JIS but not okay with Unicode... who knows, I've put off reading that part of the book for ages.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  20. Re:In a comparison, Ruby suffers for one big reaso by Trejkaz · · Score: 1

    Java though, treats people who want to use UTF-32 as second-class citizens. It's perverse too... we were all taught in University that Java supported Unicode, and then it was only in the real world where we discovered that it didn't support things like surrogate pairs. And don't try to tell me that 16 bits is enough bits to store every character you'll ever want to display or print.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  21. Re:In a comparison, Ruby suffers for one big reaso by syntaxglitch · · Score: 1

    I'm pretty sure it does in fact use one of those sort of schemes, which have been in common use in Japan for much longer than Unicode has existed. I'm not certain though, as my grasp of Japanese is far too tenuous to worry about being able to type it. :)

  22. My favourite by Trejkaz · · Score: 2, Insightful

    "Hahaha! You amateurs! How does your pathetic toy deal with redundant HA database clusters in a real-time mission-critical enterprise environment with a 5-nines uptime guarantee? Come back when you've grown up!!"

    Rails is scalable, but not in an interesting fashion at all. You want more processing power, you run more instances. Where's the fun in that? I love it in Java land, where creating something scalable inevitably means exciting things like building a single JVM that runs on multiple machines, or wrapping things in five layers of EJB so that they can work across multiple machines.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
    1. Re:My favourite by LarsWestergren · · Score: 1

      I love it in Java land, where creating something scalable inevitably means exciting things like building a single JVM that runs on multiple machines, or wrapping things in five layers of EJB so that they can work across multiple machines.

      No, it doesn't inevitably mean that. You can make an application more scalable by moving from threads and blocking sockets to non-blocking IO channels for instance. What you are talking about is clustering. Those are two possible approaches with Java, but there are plenty more.

      --

      Being bitter is drinking poison and hoping someone else will die

    2. Re:My favourite by dubl-u · · Score: 1

      Rails is scalable, but not in an interesting fashion at all. You want more processing power, you run more instances. Where's the fun in that? I love it in Java land, where creating something scalable inevitably means exciting things like building a single JVM that runs on multiple machines, or wrapping things in five layers of EJB so that they can work across multiple machines.

      To be fair, you can only stretch the PHP/Rails "run more instances" paradigm so far; it just shifts the burden to the database. Scaling then becomes a painful exercise in database magic. To me, that's the tail wagging the dog. Databases are supposed to make things easy, and when they stop doing that, it's time to rethink your architecture. I think it's no accident that Google, the world's best company at scaling, is not a big database user.

      Of course, that's not to say that Sun's retarded enterprise approaches are any better. I have made great money ripping out inappropriately applied EJB cruft, although probably not quite as much money as the dolts who spent a lot of time putting them in. It appears that a lot of people would rather fail using the dominant paradigm than spend a little time thinking and experimenting.

    3. Re:My favourite by swimmar132 · · Score: 1

      It's fairly rare that you're going to need to scale the database beyond one machine. So, I'm not too worried about it.

    4. Re:My favourite by Trejkaz · · Score: 1

      Well, everyone should have been on non-blocking IO channels for the past few years or so anyway, and besides, I was joking in the first place, in case you didn't notice.

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
    5. Re:My favourite by dubl-u · · Score: 1

      It's fairly rare that you're going to need to scale the database beyond one machine. So, I'm not too worried about it.

      Yes. If success is not a problem that keeps you awake at night, then Rails-style (or PHP-style) direct-to-database approaches are generally fine. When that turns out not to be the case, it's good to have a plan besides "give the DBAs and database vendors all of our money".

    6. Re:My favourite by swimmar132 · · Score: 1

      Hm. What type of an application would max out an optimized and tuned postgres running on a 32 core machine with, say, 16 gigs of memory?

    7. Re:My favourite by dubl-u · · Score: 1

      Hm. What type of an application would max out an optimized and tuned postgres running on a 32 core machine with, say, 16 gigs of memory?

      At a guess, any of the top 1000 websites, plus a lot of specialized applications. I have personal knowledge of the setups of 5 in the top 100, and none of them are putting all their eggs in one basket.

      Moreover, the cost of hardware like that goes up exponentially with capacity, meaning your profit margins get worse and worse as you grow, rather than better and better. Plus it's hard for every developer to have one of those on their desktop, meaning that doing performance tuning becomes much more complicated.

      Remember that the world's best scalers, Google, use (and have always used) racks of commodity hardware. In their lobby they have some of their first-gen hardware, and it's all dirt-cheap commodity stuff.

  23. Re:In a comparison, Ruby suffers for one big reaso by Sircus · · Score: 2, Interesting

    I've recently been writing a project with Rails, using MySQL as the backend. Supporting UTF-8 has been no problem at all. UCS-2 support may well be lacking, but it's certainly not like you can't support people with non-ASCII alphabets.

    --
    PenguiNet: the (shareware) Windows SSH client
  24. Re:In a comparison, Ruby suffers for one big reaso by LarsWestergren · · Score: 2, Informative

    Java though, treats people who want to use UTF-32 as second-class citizens.

    Java has support for Unicode 4 since Java 5, released september 2004.

    --

    Being bitter is drinking poison and hoping someone else will die

  25. Re:Now, if he could apply the same wisdom to SQL, by Decaff · · Score: 3, Interesting

    What turns me off is forcing you to store all your data persistence into SQL and relational tables, when it is clearly a hierarchy of objects. Why does everyone think they have to do that? The software would function much more simply and the data would typically work better without it.

    It is great to see that developes are finally beginning to see the downsides of Rails!

    The thing is, not everyone does think they have to do that! There are perfectly good high-performance ORM systems that do allow you to work with a hierarchy of objects and use rich but portable query languages - examples are Hibernate, JDO and the soon-to-be released JPA (Java Persistence Architecture).

    They are as DRY (don't repeat yourself) as Rails, as with quality implementations you can automatically generate schemas from objects, or get object hierarchies generated from schemas, and they don't have to rely on endless configuration files (you can define minimal relational information as annotations in your objects).

    Also, unlike Rails, they are extremely portable. You aren't restricted to a subset of SQL to get portability. You can use a full and rich query language (like JDOQL 2.0) and that is automatically translated to high-performance vendor-specific SQL for whatever database you are using. Even if you don't want portability, the ability to do this means you get high-quality SQL largely automatically.

    Unlike Rails, they work extremely well with both legacy schemas and schemas that are shared with other applications a developers.

    Unlike Rails, some of these APIs (JDO) don't restrict you to relational systems - you can persist just as easily to things like object databases, SOAP services, LDAP, text files, filesystems etc., without changing a single line of code, and all the while using a rich query language!

    These products and APIs are available right now, have open source implementations and have been used successfully by a very large number of developers for years.

    My view is that they make Rails look primitive.

  26. Re:In a comparison, Ruby suffers for one big reaso by kahei · · Score: 4, Interesting


    Yes, Ruby and it's author have an interesting attitude to string representation in general and Unicode in particular. It's partly what inspired me to write this:

    Psychology of Unicode in Japan

    It's really been a very interesting struggle between people's psychological and I.T. needs -- a struggle that's pretty well over now, but has left behind things like Ruby's way of doing things.

    --
    Whence? Hence. Whither? Thither.
  27. Re:Now, if he could apply the same wisdom to SQL, by MemoryDragon · · Score: 1

    Well lets say it that way, I have been using hibernate for quite a while and it has a lots of quirks, the most annoying aspects of it, for many is: a) many to many mappings which simply need more documentation, the best way to do is is to enforce surrogates on the many to many tables otherwise you will often run into implicit clashes via compound keying (rails already enforces it, hibernate does not, it is not documented but after many hours of trying to fix this problem on a compound key I came to the conclusion there is no sane other way to handle it)

    b) The whole locking, merge save, update, persist api is a huge mess, which was carried over to a big degree into the whole jpa, partially also caused by a huge lack of documentation in exactly this critical area. (90% of all problems regarding saving usually circle around the lock persistence functions and many to many resolution)

    Having to juggle with lazy non lazy objects, with merge, save, update, lock, persist wich all do almost the same but not exactly the same, with referencing issues on many to many relationships etc... Is nothing I would call a walk in the park either.

    I was at a conference a while ago where one of the people hosting the conferences said, that one thing many frameworks simply have lost is the KISS principle, and the guy clearly said, the perfect example is Hibernate where someone has to be an expert in it to be able to handle it. And Hibernate is considered to be the one of the easier ones in the java world. And no this guy knew what he was talking about, I have used hibernate very often and I agree with him.

    JPA, Hibernate etc... are very powerful apis, but they are way to complex for a RAD approach and they all have huge areas where they need to be cleaned up instead of being carried over to the next API. The biggest one of them IMHO are the areas mentioned.

  28. Re:Now, if he could apply the same wisdom to SQL, by Decaff · · Score: 1

    JPA, Hibernate etc... are very powerful apis, but they are way to complex for a RAD approach and they all have huge areas where they need to be cleaned up instead of being carried over to the next API. The biggest one of them IMHO are the areas mentioned.

    Good post, but I would disagree with some points. I don't think Hibernate is the easiest API - I far prefer JDO. Secondly, you don't have to use all that locking or use of lazy objects - you can use it in a very simple manner. The use of those features is for optimisation. Finally, if you want great documentation, use something other than Hibernate - JPOX and Kodo are JDO implementations with superb documentation.

    No matter what some of the issues are, I don't think anyone can deny that the Java approaches have far more power and flexibility than Rails, if you want to move beyond simple RAD tasks.

  29. Everyone knows that no programming language.... by Anonymous Coward · · Score: 0

    Everyone does NOT KNOW that no programming language is a perfect fit for every job. I am so sick of this truism that is not true. There are plenty of great languages that work well on any job. The problem is the implementations and the runtime environments. If C++ ran in a web page in a browser, who would need javascript, for anything, ever? I'm not advocating for C++, if you like lisp the same would be true if it were just available to you when and where you were coding. It is mono-think implementation of each language that shoehorns it into only one piece of footware.

  30. Re:Now, if he could apply the same wisdom to SQL, by MemoryDragon · · Score: 1

    You bring up a point here with using something else, until recently Hibernate was the only OSS based implementation of an ORM system usable and coming close to being a standard and having good tools, now that JPA is out, we have finally a good number of them all based on JPA:

    Hibernate, KODO JPA, Toplink JPA all OSS based on various licenses. Due to the issues mentioned I will probably move away from Hibernate towards something else.

    The main problem with Kodo simply used to be the price which was way too high for small developments, and still is if you need KODO JDA, but the JPA implementations are there now or will be there soon and usuable for a budget.

  31. OK... how SHOULD it be done then? by meringuoid · · Score: 1
    I do a lot of quick-hack Access / VBA stuff at work. Usually I start by designing the tables, relationships, queries, reports etc, and then put together a GUI afterwards. I prefer to keep as much code as possible in separate modules rather than in the form itself - mainly because I forget the stuff's there otherwise, and you wind up with fossil code left behind from long-since deleted controls - but the grandparent sounds like he's doing similar things.

    Apart from its inherent inadequacies compared to 'real' databases, what's the big disaster area about Access? What do people do horribly wrong, and what's the wonderfully better approach?

    --
    Real Daleks don't climb stairs - they level the building.
    1. Re:OK... how SHOULD it be done then? by killjoe · · Score: 1

      "What do people do horribly wrong, and what's the wonderfully better approach?"

      It's not impossible to do decent access development but it's very hard. Why? To start with VBA does not support inheritance. Since inheritance is the cornerstone of OOP development you are starting off on a bad foot right there. VBA objects don't support static methods, this means that you can't call methods from gui elements without resorting to writing plain old modules.

      I have had the distinct misery of both writing and maintaining access applications. It's a write only platform. You can slap together disposable crap fast but if you need to pick it up again in a year or god forbid you need to maintain it from day to day you are better off sticking needles in your eyes.

      --
      evil is as evil does
  32. Re:Now, if he could apply the same wisdom to SQL, by Decaff · · Score: 1

    Due to the issues mentioned I will probably move away from Hibernate towards something else.

    I use a JDO product (Kodo) for very large transactions (hundreds of thousands of records), and it works very well and fast. Hibernate was, according to the developers, not intended for this sort of use - which I interpreted as a coded way of saying 'it is too hard to run write our stuff to run efficiently like that and we aren't bothering' :)

    Hibernate is extremely popular, but, in opinion, far from the best. The Kodo OSS implementation of JPA is something I am eagerly awaiting!

  33. Re:Now, if he could apply the same wisdom to SQL, by MemoryDragon · · Score: 2, Interesting

    Well KODO is considered to be the best persistence layer for java around, I am glad that Bea decided to opensource the KODO EJB3/JPA layer under an Apache license. And I agree Hibernate is subotimal, there are issues with performance in certain areas, there are issues with mass data, and the whole many to many handly in combination with some of the Hibernate core people (not Gavin King he always is nice) in the JBoss forums gives it the rest. I cannot await to move away from Hibernate towards EJB3 JPA based on Kodo.

  34. i don't like the Active Record pattern by WeAreAllDoomed · · Score: 2, Interesting
    i reject the notion that "the db *is* the model". that's crap - the db is the db. it's where you store the model.

    accordingly, things i dislike about active record:

    1) it seems to mirror tables pretty directly;

    2) i don't think the objects you work with in code should know how they are stored - this means they don't inherit or mix-in any database code at all. there should be separate classes that handle this.

    this holds for other languages too, of course. python in this case:
    cn = <a database connection>
    ticketStorage = TicketStorage(cn)
     
    # get list of this year's unpaid tickets
    startDate = datetime(2006, 1, 1)
    endDate = datetime(2006, 12, 31)
    tickets = ticketStore.getUnpaid(startDate, endDate)
     
    # show the tickets
    for ticket in tickets:
      print "unpaid ticket number %s was issued on %s" % (ticket.number, ticket.date)
     
    ... (do some stuff with tickets)
     
    # save changes to database
    ticketStorage.save(tickets)
    a Ticket may consist of data aggregated from several tables; the client code doesn't care about that. the TicketStorage class worries about storage.

    now, inside TicketStorage, you might use your ORM of choice, or access the DB directly, or whatever. the point is, the public methods of TicketStorage draw the line in the sand between the code using the Ticket objects and anything storage-related.

    that's my preference from a design perspective, anyway.
    --
    free software, open standards, open file formats, no software patents.
    1. Re:i don't like the Active Record pattern by Forbman · · Score: 1

      1) it seems to mirror tables pretty directly;

      Well, that's how most people tend to code on top of databases. I'm sure you can point to lots of great examples as to how this is bad, so fire away.

      2) i don't think the objects you work with in code should know how they are stored - this means they don't inherit or mix-in any database code at all. there should be separate classes that handle this.

      Great, because your model objects that use ActiveRecord don't know how they're stored in the database, either, short of the interface methods provided to them thru inheritance from ActiveRecord::Base. Nor does ActiveRecord::Base, really. It "mixes in" the storage details for a given adapter as specified in the configuration file. The specific adapter class has all the parameterized/dynamic insert-update-delete SQL in it, if that indeed is what is used. It could just as well be cursor-oriented access directly against the DB's client interfaces as well. Only matters really to the people who code the adapter classes.

      a Ticket may consist of data aggregated from several tables; the client code doesn't care about that. the TicketStorage class worries about storage.

      But...what if I have another application that hits the database, and can't know about your TicketStorage class? For DBs where stored procs return datasets, it would make more sense to store the logic in the database... Or codge a view that does some of it, too (with instead of triggers to put stuff in the right places). Funny, ActiveRecord can interface with a view just this way, too.

    2. Re:i don't like the Active Record pattern by WeAreAllDoomed · · Score: 1
      Well, that's how most people tend to code on top of databases. I'm sure you can point to lots of great examples as to how this is bad, so fire away.

      primarily because it tightly couples the storage mechanism to the domain classes. the domain classes should be unaware of how they're stored. this isolates any change in storage mechanism to the storage layer. maybe you have to change the contructor of the storage classes in the controller layer, but that's about it.

      But...what if I have another application that hits the database, and can't know about your TicketStorage class? For DBs where stored procs return datasets, it would make more sense to store the logic in the database... Or codge a view that does some of it, too (with instead of triggers to put stuff in the right places). Funny, ActiveRecord can interface with a view just this way, too.

      you can push stuff into the db as needed - stored procedures etc. - and deal with it in the storage classes. also, the other application will be coming from the same overall design documents, so if you're forced to reimplement some storage-related functionality, it's all driven from the same source.

      my primary point is that i don't like to see storage-specific code in the controller layer. these frameworks that automatically throw data straight from the db to the html form make me feel uneasy, because you lose the isolation between layers that way. that kind of code belongs in a library, imo - the web programmer should just have to ask for what he wants, and receive collections of pure domain objects in return, free of any storage semantics.

      --
      free software, open standards, open file formats, no software patents.
    3. Re:i don't like the Active Record pattern by fuzzylollipop · · Score: 1

      You are right, the db schema should NOT be the object model and vice versa, the object model should not dictate the db schema! It might work for TOY applications, but for real world large scale applications it just doesn't work. And guess what, a relational database is not the only source of data! Matter of fact for all high performance massively scaleable systems even the most expensive relational database will be the bottle neck to throughput and blocking of processing. If you have thousands of database tables ( ERP systems for example ) you can't have one object per table it just doesn't make sense. ActiveRecord Pattern doesn't scale out past TOY applications, anything with complex join rules and complex storage rules where things have to all save or none, or some updates, inserts can fail but others can't or don't just doesn't work with ActiveRecord pattern.

    4. Re:i don't like the Active Record pattern by swimmar132 · · Score: 1

      Do all real world, non-TOY applications have thousand of tables? Is the database the bottleneck in all real world, non-TOY applications? You seem to think so.

      And why don't you think Rails can handle data sources other than a relational database? It does perfectly fine.

    5. Re:i don't like the Active Record pattern by swimmar132 · · Score: 1

      I mean, Jesus Christ.

      It's like saying "All real cars need a 1000hp engine and 30k tires, because all non-TOY cars need to go 200mph in 8 seconds", when all I want is a freaking car to get me to work every day. Or perhaps I want a truck to go camping with or move some stuff.

    6. Re:i don't like the Active Record pattern by WeAreAllDoomed · · Score: 1
      It's like saying "All real cars need a 1000hp engine and 30k tires, because all non-TOY cars need to go 200mph in 8 seconds", when all I want is a freaking car to get me to work every day. Or perhaps I want a truck to go camping with or move some stuff.

      i appreciate the reply of the person who backed me up - but i don't think "toy" application is the right word to use. this is really a question of development model and application architecture - not whether one approach or another can be used for heavy-duty systems.

      technically, you could use either, i guess; but even with trivial applications that i might start out with a quick-n-dirty approach, i find i rather quickly start trending toward a more rigorous design, and i would have saved myself some time had i started out that way to begin with.

      --
      free software, open standards, open file formats, no software patents.
  35. Hooray! He uses Migration! by Greyfox · · Score: 1
    Most of the quick tutorials you see on the Internet don't use Migration. I think it's a lot better to go that way than to write a bunch of .sql files -- it allows you to switch database engines without worrying about the inconsistencies in the SQL between them and its rollback functionality is very useful.

    People just getting in to rails and ruby are not likely to have done more than scratched the surface of what ActiveRecord is capable of. This is a great introductory article, but I'm curious just how far you can push ActiveRecord.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    1. Re:Hooray! He uses Migration! by matchboy · · Score: 1

      Coming from a Perl, Python, and PHP background... making the transition up a letter in the language world has made my life much easier. Rails is hot right now and there is a huge shortage of quality Rails developers. RailsConf 2006 sold out in just a few days and Canada on Rails is coming up in just over a month. For RailsConf, my team is taking the train from Portland, Oregon to Chicago, Illinois... via the The Argon Express. My whole development and consulting career went 150% Ruby on Rails in less than a year!

      rails++

      --

      Robby Russell
      PLANET ARGON
      Robby on Rails
    2. Re:Hooray! He uses Migration! by Forbman · · Score: 1

      Even better, if you use something like DeZign for Databases, a database-neutral ERD program, it's pretty easy to switch your table schema from one database system to another (stored procs, triggers, etc. are not translated, however...)

      People keep talking about this, but be honest: how often does it happen in practice? Not too often.

  36. It is... by autopr0n · · Score: 1

    In fact, rather then ASCII Ruby was designed with SHIFT-JIS, a sort of japanese ascii.

    --
    autopr0n is like, down and stuff.
    1. Re:It is... by Anonymous Coward · · Score: 0
      autopr0n is like, down and stuff.

      What happened?

  37. UTF32? by autopr0n · · Score: 1

    Well, java is older then utf32, but whatever.

    --
    autopr0n is like, down and stuff.
    1. Re:UTF32? by Trejkaz · · Score: 1

      But you see, there is a little thing we in the software industry call "planning for the future." For instance, if they had made String an abstract class, they could have later expanded it to work with UTF-32 strings, in the same way that InetAddress now works for IPv6 addresses (for that matter, they could have then supported ASCII strings without an encoding overhead.)

      --
      Karma: It's all a bunch of tree-huggin' hippy crap!
  38. Re:In a comparison, Ruby suffers for one big reaso by revscat · · Score: 1

    Fascinating write up. I had no idea there was such a debate even going on. Excellent work.

  39. Everyone? by Anonymous Coward · · Score: 0

    " Everyone knows that no programming language is a perfect fit for every job."

    I truly, deeply wish this was the case.

  40. ActiveRecord Pattern has never scaled out! by fuzzylollipop · · Score: 1

    The ActiveRecord pattern is NOT new, and it won't scale out past a few dozen tables. Never has, there is a REASON that it is not a successful pattern in ALL languages. For TOY applications, it might be fine, but for say something like an ERP system with thousands of tables, it just won't scale out performance or maintanence wise, never will.

    1. Re:ActiveRecord Pattern has never scaled out! by swimmar132 · · Score: 1

      You're free to use a different ORM with the rest of Rails if you're not happy with AR.

      And oddly enough, the AR pattern has worked perfectly fine on non-toy applications.

    2. Re:ActiveRecord Pattern has never scaled out! by Anonymous Coward · · Score: 0

      The ActiveRecord pattern isu NOT new, and it won't scale out past a few dozen tables. Never has, there is a REASON that it is not a successful pattern in ALL languages. For TOY applications, it might be fine, but for say something like an ERP system with thousands of tables, it just won't scale out performance or maintanence wise, never will.

      Here are the words you emphasized: NOT, REASON, ALL, TOY

      I am of the opinion, that the writing itself should convey the
      emphasis. Persuasive arguments persuade. Capitalization (like
      random exclamation points) makes your argument seem weaker.

      It also doesn't help that you offer no evidence to your assertions.
      In fact, I suspect that your post was auto-generated by a flame-bot.

    3. Re:ActiveRecord Pattern has never scaled out! by kchrist · · Score: 1

      Let me guess, you're a Java developer in danger of losing his job.

      I mean, reading this and the similar comment you posted to another thread, you're coming off as pretty defensive. I don't usually see people so passionately against something unless it's threatening them in some way...

  41. Re:In a comparison, Ruby suffers for one big reaso by swimmar132 · · Score: 1

    How, precisely, does Ruby not support Unicode? What can't you do in Ruby wrt Unicode that you want to do?

  42. Hey dipshit... by Run4yourlives · · Score: 1

    "Everyone knows that no programming language is a perfect fit for every job."

  43. Re:Now, if he could apply the same wisdom to SQL, by kpharmer · · Score: 0

    > Also, unlike Rails, they are extremely portable. You aren't restricted to a subset of SQL to get portability.
    > You can use a full and rich query language (like JDOQL 2.0) and that is automatically translated to
    > high-performance vendor-specific SQL for whatever database you are using. Even if you don't want portability,
    > the ability to do this means you get high-quality SQL largely automatically.

    Great, "rich query languages" that wrap richer query languages. That are highly portable across databases, but themselves are not portable across application layers (do *any* reporting tools support them? is there an ANSI standard for ORMs?)

    When a developer needs to run adhoc queries in order to diagnose problems with data in a database, to test impacts of schema migration, etc - do they write SQL or application code? Keep in mind that these are not likely to be simplistic queries...

    If you want all the flexibility of SQL, does it make sense to completely wrap one language in another - when you really don't get 100% portability? Or is this really just a solution that slightly simplifies things for 50% of the problem space - for those developers who refuse to learn SQL?

    Seriously SQL isn't the greatest language in the world, but I have a hard time understanding why anyone that works with database applications can't handle complex queries. It's like someone working on the linux command line that refuses to learn bash. Or like a web developer that refuses to learn HTML and just uses FrontPage instead.

    And aside from the "When in Rome" argument, consider the benefits of learning a data-oriented approach to working with data. SQL is more different from java, python or ruby than lisp is. One of the best things a programmer can do is to to become fluent in multiple different types of languages. Compare SQL's set-based logic to lisp or python. Learn to think of data in terms of sets and aggregates instead of just one row at a time. Until you do that you'll never understand reporting, which is really about how to answer basic business questions. But maybe that's why we've never seen a powerful reporting tool come out of the java community?

  44. thread.article(parent.id).getPoster() == +1 Funny!

  45. Re:In a comparison, Ruby suffers for one big reaso by pilkul · · Score: 4, Insightful

    I'm not sure I get your neutral tone in that document. Even though the Unicode standard has certain minor flaws and is not entirely perfect for Japanese needs, do you really believe the arguments put forth by the Japanese nationalists at all justify the total rejection of Unicode in favor of some incompatible local standard? To me this seems a very clear case of politics getting in the way of sound technical decisions.

  46. Re:Now, if he could apply the same wisdom to SQL, by Decaff · · Score: 2, Informative

    Great, "rich query languages" that wrap richer query languages.

    No, in some cases the portable query language is more featured that the language it wraps. JDOQL implementations can provide rich querying even on systems with no built-in query language (like filesystem storage).

    That are highly portable across databases, but themselves are not portable across application layers (do *any* reporting tools support them?

    Of course they are. There are reporting tools like JasperReports that can use Hibernate Query Language directly.

    is there an ANSI standard for ORMs?)

    There are JCP standards for Java ORMs that are fully supported by many vendors.
    Is there any modern standard for SQL that is fully supported by any vendor? No.

    When a developer needs to run adhoc queries in order to diagnose problems with data in a database, to test impacts of schema migration, etc - do they write SQL or application code? Keep in mind that these are not likely to be simplistic queries...

    They can use either. Why on Earth are you assuming that these portable query languages are restricted to simplistic queries?

    Seriously SQL isn't the greatest language in the world, but I have a hard time understanding why anyone that works with database applications can't handle complex queries.

    You are missing the point. Of course they can handle complex queries. What they don't want to have to do is to re-implement thousands of those complex queries in order to migrate to another database product.

    It's like someone working on the linux command line that refuses to learn bash. Or like a web developer that refuses to learn HTML and just uses FrontPage instead.

    No. The portable query languages aren't less rich than SQL. They are simply portable. That is the big difference.

    And aside from the "When in Rome" argument, consider the benefits of learning a data-oriented approach to working with data.

    Who says this isn't the case?

    SQL is more different from java, python or ruby than lisp is. One of the best things a programmer can do is to to become fluent in multiple different types of languages. Compare SQL's set-based logic to lisp or python. Learn to think of data in terms of sets and aggregates instead of just one row at a time. Until you do that you'll never understand reporting, which is really about how to answer basic business questions.

    This is completely irrelevant. Portable query systems in Java are data-oriented, and work with sets and aggregates just like SQL. The difference is that they are 100% portable.

    But maybe that's why we've never seen a powerful reporting tool come out of the java community?

    No - you have never seen a powerful reporting tool. This does not mean there aren't any. There are plenty.

    JasperReports is a good one.

    I think posters really need to do some more research before commenting on matters like this - I keep reading posts like this that bear little relation to reality.

  47. What if you don't need to scale out? by WebCowboy · · Score: 2, Interesting

    The ActiveRecord pattern is NOT new, and it won't scale out past a few dozen tables.

    How many applications out there have more than a few dozen tables? I'd have serious concerns with a system that had a single application, with a single database, comprising of hundreds of tables. In reality such systems are quite rare--for every massive ERP implementation there are hundreds or thousands of smaller applications where Ruby on Rails' Active Record model would work very well.

    For TOY applications, it might be fine, but for say something like an ERP system with thousands of tables, it just won't scale out performance or maintanence wise, never will.

    There are other approaches to system design as well--how about applying a modular "UNIX philosophy" to an enterprise system with several
    distinctly defined "TOY applications" each dealing with a smaller number of tables, all loosely coupled together? Even big, old accounting systems are broken into "modules" after all (which historically are more tightly coupled with the main system but still deal solely with a smaller subset of tables/files).

    I, for one, like "toy applications". I don't think I've ever heard a developer get real enthusiastic about implementing or maintaining an ERP system--not the way a manager or marketing person does anyways. Come to think of it I don't know a lot of enthusiastic end users of such systems either. Perhaps a mega-corporation saves a lot of time and makes its business more efficient with its mega-ERP systems, however, feeding and caring of that beast is still tedious and annoying--it's just less tedious, annoying and expensive than dealing with mistakes, redundancies and general idiocy an enterprise has to deal with in the absence of a good business management system.

    One thing is certain: there are different tools suited to different jobs, and Ruby on Rails/Active Record is best suited to smaller-sized applications where everything is developed from the ground up. Saying it lacks legitimacy because it cannoy scale to handle apps of gigantic proportions or properly interface to complicated, arcane legacy systems (ALL contemporary ERP systems in production use today are "legacy systems" IMHO) is like saying the familiar operator interface of an automobile is a failure because it cannot "scale out" to handle "real" vehicles like high-speed super-trains, jumbo jets or spacecraft. Over 90% of us never need to scale out past four wheels going up to 125km/h and carrying a couple of passengers.

    And don't get me started on performance: Java was widely criticised for its performance, as were PHP and Perl for being interpreted and "slow"...however the use of all of those in very high-volume, demanding production systems. The hardware is out there to handle it now, and I've never heard people complain that Rails or Active Record are way too slow to handle the tasks asigned to them.

  48. Hmm... by autopr0n · · Score: 1

    That stuff sounds really interesting. Do you have links for some of the research? I've heard of hibernate, but not the JPA. Is that going to be part of the standard JRE? I hate having my code rely on goofy 3rd party add-ons.

    --
    autopr0n is like, down and stuff.
    1. Re:Hmm... by Decaff · · Score: 3, Informative

      That stuff sounds really interesting. Do you have links for some of the research?

      Yes. The best place to look is the specifications at the JCP.

      JDO 2.0 is

      http://www.jcp.org/en/jsr/detail?id=243

      EJB 3.0 (including JPA) is

      http://www.jcp.org/en/jsr/detail?id=220

      I've heard of hibernate, but not the JPA. Is that going to be part of the standard JRE? I hate having my code rely on goofy 3rd party add-ons.

      JPA is going to be a standard part of J2EE, but can be used stand-alone with JRE. There are many vendors providing implementations - Sun, Oracle, JBoss, BEA, JPOX, Versant. A significant number of these are going to be open source (JBoss, Oracle, BEA). Hibernate is also going to provide an implementation of JPA.

  49. Data can be looked at in a number of diffrent ways by autopr0n · · Score: 1

    Well, what are you storing in your database? A simple hierarchy is captured pretty well with a standard, relational database with foreign keys. If you think of trees as a subset of graphs, and a relational database as a graph, you can see that any tree can be encoded as a relational database, you just need a table for every separate type of object. Going further, you can also see that any and all graphs can be expressed as a relational database, just have a "node" table and an "edge" table. (and probably an attributes table for attributes of nodes and edges, to store your data). In memory, you may end up with something much more complicated then a tree, with lots of back links and whatnot. That can't be encoded as a tree, but it can be encoded as a relational database. (I'd love to see someone come up with a graph query language. Get ready for NP-complete queries!) --- Personally, I think relational databases are great. Not because they're 'the way data is' but because they require the programmer to actually sit down and *think* about the data they are saving, and make something that's comprehensible. On the other hand, if they can just save whatever and have it persist, then you might end up with god knows what in your files. Different programs, and even worse: different versions of the same programs might not be able to read the tree properly. On the other hand, yes, it would be much easier to write the code in the first place if you didn't have to write a DAL to convert your objects to queries and vice-versa.

    --
    autopr0n is like, down and stuff.
  50. Re:Data can be looked at in a number of diffrent w by autopr0n · · Score: 1

    Ouch.

    There were linebrakes in that when I hit the "submit" button...

    --
    autopr0n is like, down and stuff.
  51. Re:Now, if he could apply the same wisdom to SQL, by kpharmer · · Score: 0

    >> Great, "rich query languages" that wrap richer query languages.

    > No, in some cases the portable query language is more featured that the language it wraps. JDOQL
    > implementations can provide rich querying even on systems with no built-in query language (like filesystem storage).

    That makes sense - and does sound somewhat valuable.

    > Is there any modern standard for SQL that is fully supported by any vendor? No.

    The ANSI SQL standard has levels of compliance. For typical queries on typical databases (not perhaps mysql which often disregards ANSI) the standard is well supported.

    > What they don't want to have to do is to re-implement thousands of those complex queries in order to migrate to another database product.

    Hmm, having perform many ports between database products I can honestly say that I've never bumped into this problem outside of SQL Server/Sybase stored procedure insanity. The most often case is 10% of your queries might require a tweak. 1% might require a rewrite. So, to avoid this you wrap the entire language in an entirely new language? That itself can't support 100% of the features of the first, and isn't usable by everything that supports the first?

    >>But maybe that's why we've never seen a powerful reporting tool come out of the java community?

    > No - you have never seen a powerful reporting tool. This does not mean there aren't any. There are plenty.
    > JasperReports is a good one.

    After doing reporting for twenty years across many projects I've seen most reporting tools out there. If you consider JasperReports powerful then you really don't understand reporting. It's just a report painter - not much different technology than we were using in 1989, and that Crystal Reports has provided for 10+ years. It's the wrong way to deliver reporting, rather than use metadata-driven reporting that can automatically allow the users to wander through an n-dimensional cube of data, the programmer laboriously creates individual reports. Yuck.

    > I think posters really need to do some more research before commenting on matters like this
    > - I keep reading posts like this that bear little relation to reality.

    Hmm, I think people should actually learn how to use databases before coming up with ingenious work-arounds like:
        - Object Oriented Databases - that can't handle sequential scans, reporting, searching.
        - Hierarchical Databases - reinventions of technology thrown away in the 80s.
        - XML as a database - completely misses concepts of ACID, concurrent users, sequential scanning
        - wrappers to help programmers avoid learning the lingua franca of databases (SQL)

    Sorry to be so negative towards your point, but I've been on multiple J2EE projects where programmers adopted some brilliant idea like OODBMS, container managed pesistence, or sometimes just EJBs - only to discover later that the way that the java community thinks about data only covers about 50% of its needs.

  52. Re:In a comparison, Ruby suffers for one big reaso by HiThere · · Score: 1

    Remember that a large part of the resistance that people have to learning a computer language has to do with how difficult it was to learn the last one.

    When it's difficult to learn to do something, one doesn't want to write off that investment. Do you still use a qwerty keyboard? So do I. But I'm well aware that other keyboards are easier and faster. If you press me, I'm likely to make up an excuse, but the real answer is I don't want to invest the time involved in relearning touch typing.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  53. Re:Now, if he could apply the same wisdom to SQL, by Decaff · · Score: 1

    After doing reporting for twenty years across many projects I've seen most reporting tools out there. If you consider JasperReports powerful then you really don't understand reporting.

    The poster was asking to hear about a product that allowed use of an ORM portable query language; that is the reason for mentioning JasperReports.

    Hmm, having perform many ports between database products I can honestly say that I've never bumped into this problem outside of SQL Server/Sybase stored procedure insanity. The most often case is 10% of your queries might require a tweak. 1% might require a rewrite.

    Hmm, well, I deal with this on a daily basis. It is nothing like you describe. I am involved in porting projects that take months, and I know many others who have had to deal with the same issues.

    So, to avoid this you wrap the entire language in an entirely new language? That itself can't support 100% of the features of the first, and isn't usable by everything that supports the first?

    The languages are standardised, and they can support all features.

    Hmm, I think people should actually learn how to use databases before coming up with ingenious work-arounds like:
            - Object Oriented Databases - that can't handle sequential scans, reporting, searching.
            - Hierarchical Databases - reinventions of technology thrown away in the 80s.
            - XML as a database - completely misses concepts of ACID, concurrent users, sequential scanning
            - wrappers to help programmers avoid learning the lingua franca of databases (SQL)


    I am not talking about these! I am not talking about OOP, hierarchical databases, or XML.

    I am talking about SQL-like languages (that DO require you to understand SQL and its concepts - this is, of course, essential) but allow true effective portability.

    Sorry to be so negative towards your point, but I've been on multiple J2EE projects where programmers adopted some brilliant idea like OODBMS, container managed pesistence, or sometimes just EJBs - only to discover later that the way that the java community thinks about data only covers about 50% of its needs.

    This is why I was talking about more research needed by posters, as if you think that modern ORMs force any of the above solutions, you are way out of date. I am not talking about OODBMS or container managed persistence! I am talking about rich, lightweight object/relational mapping systems that allow full use of the underlying databases.

  54. So, you wrote the app... then... by bradleyland · · Score: 1

    "I already created the database schema, wrote all the SQL to get the information I want, have a lot of HTML written for the general template, and was looking at abandoning much of it for controllers, models, automagic foreign key relationships, automagic methods popping out of thin air.. I wanted more control I guess."

    So, you wrote most of the app, then started looking at frameworks, then you were dissapointed when the framework didn't mesh with the work you'd already done.

    I'm not looking to be the great defender of rails, but I'm very surprised that your post was modded +4, Interesting. Rails is meant to eliminate a lot of the work you had already done (mostly the SQL stuff). Their mantra is convention over configuration. If you prefer control of course rails isn't going to be for you.

  55. Re: gee... by Cryptnotic · · Score: 1

    That's kind of funny since I've written programs that parse Japanese text using Ruby and I have actually switched the code and database between EUC, SJIS, and UTF-8 with no problems. As far as I know, you can't use UCS-2, but UCS-2 is deprecated anyway since you can't encode the whole Unicode space in it anyway.

    --
    My other first post is car post.
  56. Re:In a comparison, Ruby suffers for one big reaso by billcopc · · Score: 1

    don't try to tell me that 16 bits is enough bits to store every character you'll ever want to display or print.

    Okay, I won't, but can you tell me why I would need more than 16 bits to store a single character ? Why the hell do we need so many characters in the world ? Are there so many ways to say "Hello" that we need millions of characters to communicate with our neighbors ? I'm not saying everyone should speak english (I'm french myself), but eventually the various dialects will condense into more portable languages.

    Maybe in a few decades, maybe in a century.. sooner or later the concept of unity will be more than just words on the back of a student flyer, and we will want to understand others no matter what land they hail from. Why should a computer understand 4 billion characters when humans only use a few hundred at best, for most of us just a few dozen.

    --
    -Billco, Fnarg.com
  57. Re:Unicode teh suck in ruby's country of origin by rubycodez · · Score: 1

    You Unicode fans might like to know that Japanese in Unicode is not done well, it leaves much to be desired for computation/sorting/searching in the three character/pictograph sets in use by average literate Japanese person. Other encodings are prefered and more useful

  58. Re:In a comparison, Ruby suffers for one big reaso by Trejkaz · · Score: 2, Insightful

    Okay, I won't, but can you tell me why I would need more than 16 bits to store a single character ? Why the hell do we need so many characters in the world ? Are there so many ways to say "Hello" that we need millions of characters to communicate with our neighbors ? I'm not saying everyone should speak english (I'm french myself), but eventually the various dialects will condense into more portable languages.

    Of course. For example, we don't need to runic characters in real life, however if you wanted to write a textbook on Anglo-Saxon linguistics, you'd be up shit creek if those characters weren't in there. Same goes for any given language.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  59. That's the real trick, isn't it? by rk · · Score: 2, Insightful

    You're right, that the language itself is not the only thing that matters. Extra libraries to work with makes life much more pleasant.

    But what's under the hood of that do_something_with_file_data? In this fairly trivial example, there's not much difference between a do_something_with_file_data in C versus Perl.

    Nice code examples deleted 'cause of /. stupid lameness filters inserting random spaces, even when I had spaces nearby. GRRRR! Suffice to say both were functionally equivalent and of about the same length: about 8 lines for reasonably readable code that output reasonable, though not strictly standards-compliant, HTML.

    For more complicated web work, however, I would still maintain that there are better languages than C (and Perl for that matter) to be doing the work. I'm not for a moment suggesting that I can replace what would take me a year in C with a day's work in Python (excepting the library issues), but I think that the so-called "scripting languages" are faster to develop many types of applications even without the library advantages they have.

    Execution speed arguments are less a function of the language itself than a function of those environments the languages themselves typically operate in. There are python, perl and Java compilers and I'm sure somebody has made a C interpreter for some strange reason. Most applications do not need to be as efficient as possible by virtue of the fact that a lot of them sit in an idle state most of the time anyway. There are notable exceptions (scientific computing, games, etc.), but there you're going to be writing as close to the hardware as you dare and maybe even C is too much of a luxury and you'll have to write assembly.

    I agree that a language choice, given appropriate and featurewise compatible libraries existing for the task at hand, isn't usually going to make a many orders of magnitude difference in development speed. I do still contend however that appropriate languages to the task at hand can save you a decent slice of project time. My gut instinct would be to say the average would be around 20 to 30. Not massive, but noticeable on the bottom line. Sometimes that choice will even be C. And some things still need the raw power of C. Not bagging on C at all, here! It was the fifth language* I learned, after TRS-80 Extended Color Basic, 6809 Assembly IBM 360 Assembly, and Pascal. Of those five, it's the only one I still use at all, much less remember, and I still love hacking on it.

    I will concede that my gut is not (perhaps) as accurate as a study, but my only point was to say I will still trust my experience over a random stranger on Slashdot waving "studies" around without any reference to what they're referring to.

    *- FORTH was sixth. I've forgotten it, too.

  60. Re:In a comparison, Ruby suffers for one big reaso by revscat · · Score: 1

    It's called "objectivity". He should be applauded, not condemned, for writing something so balanced. You came to the conclusion that the Japanese are being unnecessarily stubborn regarding Unicode. So did I. I think that says something given the fact that neither of us believe he took a stance on way or the other.

  61. Re:In a comparison, Ruby suffers for one big reaso by pilkul · · Score: 1

    Yes, I'm not criticizing him about it especially. I was mostly trying to poke him into giving his opinion, since he seems better-informed than I am.

  62. Re:In a comparison, Ruby suffers for one big reaso by billcopc · · Score: 1

    Okay good point, but why not just use a dedicated runic font for that specific purpose ? We already have those, they're just poorly supported in general-purpose software. Why the hell would general-purpose applications need to know foreign charsets ? Just because a handful of people want a feature does not mean the whole world should change the way they write code just to accomodate that minority. Unicode is such a big deal yet I can't justify the need in my daily computing tasks. Even if I spoke a foreign language that requires non-latin characters, I would simply use that specific font, I don't need the other 2700 languages along with it. I think it would be far easier for an application to support two or three individual charsets than 32-bit character spaces.

    --
    -Billco, Fnarg.com
  63. Re:Unicode teh suck in ruby's country of origin by aevans · · Score: 1

    Yes. About the only use for Unicode is keeping track of your Elvish and Klingon dipthongs in the same character set. 2 byte words is enough for China and Japan has their own system that works. Meanwhile, everyone uses ascii except when representing pictograph characters.

  64. Re:In a comparison, Ruby suffers for one big reaso by Trejkaz · · Score: 1

    Okay good point, but why not just use a dedicated runic font for that specific purpose ?

    For semantics. An application that processes text won't deal with fonts. If it did deal with fonts, it would still need a way to convert the bogus text into a real representation, and for that representation, we would use Unicode.

    --
    Karma: It's all a bunch of tree-huggin' hippy crap!
  65. Re:In a comparison, Ruby suffers for one big reaso by Anonymous Coward · · Score: 0

    Look, you ignorant slobs, UCS-2 is incomplete due to its lack of support for real characters in one real, living language, and I'm startled if you can't guess which one!

    GB-18030 is the string you want to google...

  66. Re:In a comparison, Ruby suffers for one big reaso by aevans · · Score: 1

    have you ever used unicode?