A Pro*C WTF



  • I was looking through a Pro*C, and I was really excited at first, because where I work the tend to be massive beasts becasue the devolpers either didn't understand  that the could split functionality into different logical files, or they couldn't get the oracel stuff to work that way.

     

    So I was very excited to see a file that was only two hundred LoC!

    And then I started reading it, and came acoss this little gem and my heart sank farther into the black pit it has become lately.


     

    #define LOOP    for( ; ; )

     ..Some more stuff...

    LOOP
      {

    ..Some Embedded SQL and regular C code

     

     Apperenty, the deloper REALLY wanted it to look like PLSQL code, and had to have it.

    I'm just suprised they didnt do 

    #define LOOP    for( ; ; ){

    #define END_LOOP    }

     



  • I don't understand the appeal of Pro*C and/or Oracle.

    SQL Server does it right, by letting you use the CLR to embed C#/VB into the database, but not to embed SQL into your application. That seems totally backwards to me.

     



  • @Jonathan Holland said:

    but not to embed SQL into your application.
     

    Isn't that kind of what Linq is doing now though?



  •  Not really. Linq is just a fancy Object Relational Mapper.

     



  • @Jonathan Holland said:

     Not really. Linq is just a fancy Object Relational Mapper.

     

     

     Actually to elaborate.

     Linq is a language native way of querying any object that implents the IQueryable interface.

     This could be a custom collection, a XML file, etc...

    Linq to SQL works by building object/relational mapping classes off of your database schema called a DataContext. These classes still use ADO.NET to perform their queries internally.

     Since the DataContext implements IQueryable, you can query against the class (not the database) using Linq.



  • I know what Linq is. I just find that it is bridging in the other direction.

    To me the inverse of SQL Server having support for .Net is Linq



  •  Linq is incredibly handy when working with custom collections or XML.

     I'm more of a traditional stored procedure guy, so you would have to try hard to sell me on using linq instead.

    I think that when linq was designed, they came up with a great idea but needed a use for it that would fire up the masses, hence linq to sql.

     



  • @Jonathan Holland said:

     Linq is incredibly handy when working with custom collections or XML.

     I'm more of a traditional stored procedure guy, so you would have to try hard to sell me on using linq instead.

    I think that when linq was designed, they came up with a great idea but needed a use for it that would fire up the masses, hence linq to sql.

     

    Yep, I would agree. I think it could be very handy. I wasn't saying anything negative about it at all.

    I haven't gotten a chance to use it yet, but I have read a fair bit about it.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.