Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
text editor
Jan 8, 2007

Jonny 290 posted:

hey cool so i learned how to do sql queries today

why again is this hard

it isn't but you shouldn't be writing them

Adbot
ADBOT LOVES YOU

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post

Jonny 290 posted:

hey cool so i learned how to do sql queries today

why again is this hard
its not, DBAs are just the whiniest people ever

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
is this where all that orm poo poo comes in or something

CaptainMeatpants
Jun 1, 2010

yah in an ideal situation you shouldn't be typing raw sql in your code

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Jonny 290 posted:

hey cool so i learned how to do sql queries today

why again is this hard
you been working at the mart all this time and just now got to sql queries??

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
ive only been a dev proper for like 5 weeks

this ship moves SLOW

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
select * from employees where billablehours >= 40

(0 rows(s) affected)

tef
May 30, 2004

-> some l-system crap ->

Jonny 290 posted:

ive only been a dev proper for like 5 weeks

this ship moves SLOW

some people never learn sql

sql is fine. for some reason, people would rather write queries in chained object notation, translate them to some crack addled sql :confused:

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tef posted:

some people never learn sql

sql is fine. for some reason, people would rather write queries in chained object notation, translate them to some crack addled sql :confused:

big strings of sql in the middle of a different language are ugly and stored procedures are make-work for the local DBA union

tef
May 30, 2004

-> some l-system crap ->

BonzoESC posted:

big strings of sql in the middle of a different language are ugly and stored procedures are make-work for the local DBA union

in the same way html templates are make-work for the local web union?

tef
May 30, 2004

-> some l-system crap ->
regular expressions in a language? sure

queries in a language OH GOD WHAT ARE YOU DOING THAT'S UGLY

most languages have other little languages embedded inside of them, frequently regular expressions and string formatting rules

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
i dunno if its just me or what but most non trivial queries i write in an ORM are translated to hideous poo poo when im tracing my db

CaptainMeatpants
Jun 1, 2010

tinselt0wn posted:

i write...hideous poo poo

Shaggar
Apr 26, 2006
stored procs are ftw and a good dba is worth more than 10000 web "developers".

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
gently caress it, just do it all with tie::file::hashify

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
i wish sql natural joins had mainstream support then devs would quit bitching about how much work it is to write a query and dumb devs would start using foreign keys like they already should be

also linq does it right and let's you define things in the one true order - tables first then the rest and lastly columns

orms are good but you still gotta normalize your tables and i've seen a lot of "code first" projects with absolute poo poo design in the db so i say make your tables, map to them with your orm, and optimize the bottlenecks with raw sql (preferably sprocs imho)

tef posted:

sql is fine. for some reason, people would rather write queries in chained object notation, translate them to some crack addled sql :confused:

chained object notation? like Table1.Child1.AllItems(x=>x.Something=='foo')?


tef posted:

regular expressions in a language? sure

queries in a language OH GOD WHAT ARE YOU DOING THAT'S UGLY

most languages have other little languages embedded inside of them, frequently regular expressions and string formatting rules

true

i think lots of sql hate is b/c devs don't like magic strings with potential bugs that aren't caught until runtime. less of an issue if you automate all your testing though

i like linq it's expressive but translates pretty much 1:1 to good sql, maybe i should give entity framework the ol' college try it uses linq instead of some awful HQL-alike

Shaggar
Apr 26, 2006

Arnold Yabenson posted:


orms are good but you still gotta normalize your tables and i've seen a lot of "code first" projects with absolute poo poo design in the db so i say make your tables, map to them with your orm, and optimize the bottlenecks with raw sql (preferably sprocs imho)


this but statement mapping instead of object mapping

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Arnold Yabenson posted:

chained object notation? like Table1.Child1.AllItems(x=>x.Something=='foo')?

current_user.messages.limit(5)
# => SELECT "messages".* from "messages" WHERE "messages"."user_id" = 888 LIMIT 5

Post.joins(:user).where(thread_id: 3481275).limit(40).offset(120)
# => SELECT "posts".* FROM "posts" INNER JOIN "users" ON "users"."id" = "posts"."user_id" WHERE "posts"."thread_id" = 3481275 LIMIT 40 OFFSET 120

This does neat little tricks like allowing partial queries to be composed and built up:
code:
p = Post.joins(:user).where(thread_id: 420).limit(40)
p = p.offset(params[:pagenum] * 40)
p = p.where(user_id: params[:userid) if params[:userid]
p = p.where('content like ?', "%#{params[:search]}%") if params[:search]
This is better than an untyped string because you have to work to gently caress up and make it SQL injectable.

tef posted:

in the same way html templates are make-work for the local web union?
HTML slicers don't cost much money to hire and don't pay union dues to Oracle.

tef posted:

regular expressions in a language? sure

queries in a language OH GOD WHAT ARE YOU DOING THAT'S UGLY

most languages have other little languages embedded inside of them, frequently regular expressions and string formatting rules
Strings are seen as a primitive data type in good languages, so why not include a language to query them and a language to build them?

How would you adapt LINQ to Cassandra? Neo4j? There's only one kind of string, there are many kinds of database.

Zombywuf
Mar 29, 2008

BonzoESC posted:

This does neat little tricks like allowing partial queries to be composed and built
That's nice, how do you do pivots and window functions?

quote:

HTML slicers don't cost much money to hire and don't pay union dues to Oracle.
Possssssst gresssssssss

quote:

Strings are seen as a primitive data type in good languages, so why not include a language to query them and a language to build them?
Why not just add SQL query literals? *

* Do not add SQL query literals, SQL is an awful language. I long for datalog.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Zombywuf posted:

That's nice, how do you do pivots and window functions?

Dunno, never done OLAP but i presume ORMs are bad at it.

JawnV6
Jul 4, 2004

So hot ...

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum
can someone explain to me why javascript is the base language of the web, how did this happen and why didn't someone write something more like a bytecode for the web instead tia

MeruFM
Jul 27, 2010

Sweeper posted:

can someone explain to me why javascript is the base language of the web, how did this happen and why didn't someone write something more like a bytecode for the web instead tia

netscape

abraham linksys
Sep 6, 2010

:darksouls:

Sweeper posted:

can someone explain to me why javascript is the base language of the web, how did this happen and why didn't someone write something more like a bytecode for the web instead tia

because the web was basically never intended to do anything more complicated than show you a page of information and links to other pages with information on them and everything that we do now is based on layers of hacks

also see: computing in general

Tiny Bug Child
Sep 11, 2004

Avoid Symmetry, Allow Complexity, Introduce Terror
orms are an attempt to solve an unsolvable problem. use the most lightweight implementation of activerecord for your language you can find and write your own drat sql for anything complicated. sql is easy, sql that doesn't make the server poo poo its pants under load is less so

Shaggar
Apr 26, 2006

Sweeper posted:

can someone explain to me why javascript is the base language of the web, how did this happen and why didn't someone write something more like a bytecode for the web instead tia

microsoft stopped innovating on the web after ie6 and it allowed podunk shitbrowsers to encourage bad developers to abuse javascript to do more than it was designed for. open sores cant make good things, they can only steal existing ideas so instead of writing a good standard they piled crap onto html/js

xaml is the current peak of UI development tech and html/js will probably get there in another 10 years

MeruFM
Jul 27, 2010
There's only 2 rules of sql.
Don't grab more than 1000 at a time.
Don't do sql "calculus", conversely join only on indexes.

Also javascript is a fine language.
It has everything you need to write good programs from scratch.

The trouble comes in when your base is coming from someone else who probably never wrote a line of any other language in their life.
This problem is shared with others, but javascript wades into the domain of Normals much more than the spergier languages.

MeruFM fucked around with this message at 00:12 on Jul 24, 2012

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Sweeper posted:

can someone explain to me why javascript is the base language of the web, how did this happen and why didn't someone write something more like a bytecode for the web instead tia
scott mcnealy was dumb about marketing java, hth

graph
Nov 22, 2006

aaag peanuts
this thread is so bad

Stringent
Dec 22, 2004


image text goes here

dazjw posted:

i hear rakuten's nice although rumour has it you need a good TOEIC score these days. ganbatte.

just shot tea out my nose onto my laptop.

i'll be sending you the bill.

Meiwaku
Jan 10, 2011

Fun for the whole family!
The best part of SQL is that if you experience significant growth, what once was good SQL becomes bad SQL. It's like a can of spam under a radiator, fine for months but then suddenly rancid.

I also nominate dazjw for a medal of honor for that post!

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice

Meiwaku posted:

The best part of SQL is that if you experience significant growth, what once was good SQL becomes bad SQL. It's like a can of spam under a radiator, fine for months but then suddenly rancid.


uh same prob with any poorly written code that isn't written to scale up

if u have this problem a lot maybe your idea of good sql is wrong???

Shaggar
Apr 26, 2006
procs come in super handy when you realize ur data design has a prob cause you can swap the design around and not change any application code cause the proc signature doesnt change

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
this is why perl owns

http://www.gnaa.eu/browser/trollforge/unsorted/jenk/Time/Cubic.pm?rev=606

double sulk
Jul 2, 2010


return JEWS;

Sapozhnik
Jan 2, 2005

Nap Ghost
I keep thinking that one of these days there'll be an OOP anti-fad and we can all get that nonsense behind us but nope, 30 years in and here we are.

Still, we are at least kinda sorta coming around to the idea that C++ is a Bad Programming Language, so there may be some hope yet.

duTrieux.
Oct 9, 2003

Eight years later, Luciani has finally landed an interview—and a very public one at that. She is one of four applicants-cum-contestants vying for a blue badge on Be the Next Microsoft Employee, a new reality show that is seeking a SQL Server expert to join Microsoft IT.

The first episode premiers today, and the online series will run for the next four weeks. In each episode, contestants face a technical challenge based on Microsoft Certification exams. The winner of the show—and the next Microsoft employee—will be revealed August 21 during the finale.

"The concept is more or less 'Top Chef' for geeks," said Mark Protus, senior audience marketing manager for Microsoft Learning and creator of Be the Next. Protus came up with the idea as he pondered ways to show the impact that training and certification can have on a career.

0xB16B00B5
Aug 24, 2006

by Y Kant Ozma Post
im the cum-contestant

Rufus Ping
Dec 27, 2006





I'm a Friend of Rodney Nano
ive been playing about with clojure recently and am wondering about using compojure to make websites. it seems fairly decent.

however the only reasonable* way to deploy a compujure site into production seems to be to make a war using leiningen and use something like jetty or tomcat. this strikes me as some horrific enterprise level java horseshit.

is this really the price i pay for using compojure or is there a better way. or is the current state of java servlets and things not as bad as i remember?



* ie not some poo poo that wont even survive a reboot, jesus christ some of the blogs ive read over the last couple of days, :negative:

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
servlets have always been awesome and tomcat is fantastic. the only people who think otherwise are complete morons

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply