News for hackers. Stuff that matters.
Re:Sqlphobia: The Irrational Fear of SQL by Zak on Sunday April 04, 2010 @03:52PM (#1240714)
I can think of a couple reasons not to like SQL.

First, it's ugly. It's from an era when it was popular to try to make programming languages look like English. Most people have since decided that trying to make code look like English text is a Bad Thing.

Second, it is very common to create SQL queries by splicing together strings in whatever language you're using for the rest of the application. That's a horrible way to write any kind of code. ORM is, I think as much an attempt to avoid that as an attempt to avoid SQL itself. CLSQL provides SQL semantics with Lisp syntax that can be used directly in Lisp programs. I'm not sure what other languages have similar tools, but that seems more like the Right Way to me.

Re:Sqlphobia: The Irrational Fear of SQL by bobbyi on Sunday April 04, 2010 @06:16PM (#1240922)
For python, the SQLAlchemy library provides excellent ways of programmatically building SQL queries rather than splicing strings together. It also offers an ORM, but that is an additional layer on top of the SQL stuff that you don't have to use.
Re:Sqlphobia: The Irrational Fear of SQL by didip on Monday April 05, 2010 @01:35AM (#1241393)
The ruby equivalent for it would be Sequel.
Re:Sqlphobia: The Irrational Fear of SQL by hello_moto on Sunday April 04, 2010 @04:46PM (#1240784)
> Most people have since decided that trying to make code look like English text is a Bad Thing.

Back when Rails exploded, this is one of the selling point of using Ruby...

Re:Sqlphobia: The Irrational Fear of SQL by eplanit on Sunday April 04, 2010 @07:15PM (#1240988)
Ah, the Invasion of the Amateurs continues.

Yeah, SQL is bad because it's aesthetically "ugly". SQL is bad because of how some people use it (not using prepared statements, and simply concatenating strings yup is very amateurish).

And somehow this leads to LISP as the savior? Note that the savior is to make SQL be LISP! That clue lends meaning to: "trying to make code look like English text is a Bad Thing". The LISP crowd loves obfuscation and esoteric syntax....it makes the programmer seem smart.

Keep studying, you have lots of good things to learn yet.

Re:Sqlphobia: The Irrational Fear of SQL by astine on Sunday April 04, 2010 @08:35PM (#1241079)
Way to absolutely miss the point. The previous poster is speaking about code generation, particularly that of generating appropriate SQL statements for given programs. He mentions a specific Lisp library as one solution and suggests ORM as another. Prepared statements are a better solution if the database supports them, yes, though occasionally, you might want to do more than just plug in search values.

When you attempt to make a language more like English, you inadvertently make it's parse tree more complex, therefore making attempts to manipulate that code more difficult. SQL, which is often generated on the fly, is affected by this.