logs archiveChat DB / Freenode / #programming / 2015 / November / 5 / 7
knight-
pyon: yeah definitely!
oded
funrep_: I'm not sure how XmlType works, sorry
pyon
Document databases give up on structure altogether. Graph databases say well, your data is a giant graph, but then don't provide any guidance on how to translate business rules into restrictions on the graph's structure.
knight-
i think PostgreSQL is headed in the right direction, with the expansion of the attribute types and query language... but it will take some time for that to spread elsewhere...
oded
I think you need to specify an XmlAttribute with that type
funrep_: try doing what you did, rename the class to Tileset (capitalized) and add @XmlAttribute Tileset tileset;
knight-
the fact that you can not only embed documents into a relational database, but that you can query on it and still take advantage of search and indexes and other performance enhancements is pretty nice
but it's not exactly perfect yet
pyon
Just wondering - what exactly does MongoDB do when you give it a nonsensical query?
oded
knight-: what you said about mapping between them, just use primary keys. It's not that big of a chore to query from one and find in another. It's actually what you always do. Expecting one software to provide all solutions is very problematic
pyon
In SQL's case, there's at least one programming language that prevents nonsensical queries at compile time: http://impredicative.com/ur/
oded
pyon: what do you mean by nonsensical?
knight-
oded, ahh sure, generically that maps them... but then you have to place responsibility on your app to ensure integrity, or make useful assertions about the relationship...
pyon
oded: e.g., making a query involving fields that don't exist
knight-
and think about all the back and forth that is necessary to make inter-system "joins" happen
pyon
oded: This language makes this sort of thing a compile error - more precisely, a type error.
oded
knight-: that's integration, you do that in every development when you integrate different tools to solve your problem, I don't see a problem in that
knight-
the minute you make your app(s) responsible for data and referential integrity, is the moment your architecture is not scalable nor usable by multiple participants
oded
pyon: SQL also doesn't let you query fields that doesn't exist, I don't quite follow
knight-
there's definitely a problem with maintaining data in two discrete places...
pyon
oded: Sure, but you can still make your Java or Python or whatever program send your SQL DBMS nonsensical queries.
oded: What I'm talking about is statically preventing *applications* from sending nonsensical queries to the DBMS.
knight-
you lose the ability to join that data, you lose the ability to ensure integrity of that data (i.e. your database can't lock the reference together), you lose the ability to allow multiple apps/clients/etc to access that data
oded
knight-: I never heard of such problem... all big companies use different data stores for different types of data. There are much more complicated solutions like search engines, you don't want your relational database to start implementing that
knight-
and when you have two different types of databases where your data is stored, they dont even handle the data in the same way
i'm sure you have. you're just not seeing it.
oded
pyon: what does it matter where the query stops?
knight-
imagine if you have half the data in a relational database, and the other half in a document in MongoDB. you would have to query both locations independently. that poses lots of issues.
pyon
oded: IMO, errors blowing up on the programmer's face is much better than errors blowing up on the user's face. YMMV.
knight-
you can't join the data in a safe query.
it becomes your application's responsibility to ensure the integrity, do the cleanup, and manage the algorithmic analysis of the data across both
no longer can you trust your database to do that for you
oded
knight-: well yeah, when you integrate multiple tools you need to implement locking mechanisms etc which is a bi**h, but I don't think each tool developer should integrate everything into itself to help you with that
pyon: you mean at compile time?
pyon
oded: Yes.
knight-
one of the reasons it's nice to give your database the job to do a lot of that stuff is so that you can scale it... allowing multiple clients and apps to access and manipulate that data safely...
also, to take advantage of low level optimizations (indexes, stored procedures, etc)
you lose a lot of that if you need to pull data from two places and merge
oded
pyon: ah well, I don't use compiling languages for quite a while now :) I truly don't think that compilation time errors are going to help bad developers (or good developers that make errors)
I truly don't believe*
knight-
again, like i said, i think PostgreSQL is really recognizing the need for this hybrid model
it's just youthful at this point
pyon
oded: Well, sure, Java's type system is so weak that you don't get meaningful guarantees out of it.
oded: But try a decent one - like Haskell or OCaml.
oded
knight-: you can't really scale relational databases properly
pyon
oded: It's amazing how often, if it compiles, it works, period.
knight-
i happen to really like the strong typing of Elixir... since it's compiled into BEAM bytecode, you can eliminate a lot of type issues.
pyon
oded: All that it takes is *a little* mathematical sophistication - to model your domain in ways that the type checker can make sense of.
oded
pyon: the real ultimate solution is unit-testing... no compiler will ever tell you that your code doesn't make sense in all the situation your heart meant it to be (although I don't really know Haskell or OCaml
tbh I'm not a mathematician so maybe that's my problem, though I do enjoy mathematically accurate solutions :)
pyon
oded: Even for testing, Haskell is a superior language. With something like QuickCheck, you can declaratively state your program's invariants, and the tool will autogenerate test cases. As opposed to you having to manually, tediously, and possibly wrongly crafting test cases.
adsc
i should work more with Haskell
pyon
oded: I'm not a mathematician either. I just appreciate the immense power of applied logic in computer programming.
oded
adsc: player 4 has joined the game
snyp
logic is the calculus of computer science
oded
pyon: you still need to define the situations, which is what I meant. Maybe one language is better at it than another, you still can't skip it because of compilation
adsc
yes you should know the logic behind your code
pyon
oded: Sure, you need to define the situations. But formulating one program invariant is muuuuuuuch easier than coming up with 15-20 test cases of that invariant at work.
oded: And QuickCheck will generate as many random test cases as you want for each invariant.
oded
pyon: that's good, I have nothing to disagree on :) there is still the problem of integrating different tools, do you expect your programming language to know other programming languages to test for bad queries?
pyon
oded: ofc not
jkbbwr
pyon: how does that work for complex logic?
pyon: I can see simple bounds and such but we have some rather insane logic in chunks of our codebase
pyon
jkbbwr: :-O
oded
pyon: that's how we started didn't we?
jkbbwr
pyon: I keep trying to learn haskell, getting 5% in and giving up
:(
pyon
heh
adsc
is there a good Haskell book?
beaky
yes
pyon
oded: Well, dunno. I just have a keen sense of when I'm doing more effort than I really ought to. I just don't want to do manual work when a machine could do it for me, faster and more reliably.
beaky
learn you a haskell for great good
schquid
There is, but it's written in Haskell :D
adsc
hehe
beaky
once youre done with lyah try beginning haskell its all about practical projects with haskell
funrep_
anyone know a easy way to parse XML?
pyon
funrep_: Use a library that already does it for you.
snyp
i try to get into functional programming, but i keep rage quitting.
jkbbwr
funrep_: what language
pyon
funrep_: These days, there are XML parsing libraries for every language under the sun.
jkbbwr
snyp: is not the functional that scares me away, its the psychotic syntax
snyp
i get the idea, i just feel more comfortable applying the idea in a usual programming language
oded
funrep_: did you try my solution with XmlAttribute?
pyon: I'm with you
adsc
beaky: thanks, will give those a try
funrep_
i tried but it's realy difficult to use (JAXB)
anyone know a better library for Java?
oded: nice idea
missed it in the chat gonna try it out
snyp
jkbbwr: it's probably due to ad-hoc polymorphism with lots of operators in the source code, in case of haskell
jkbbwr
snyp: Yes!
Its like I know its in-experience with then language but this line bothers me
putStrLn $ show $ 1 + 1
Why can't it just be written as putStrLine(show(1+1))
Also `.` goes in the wrong direction
snyp
most constructs of functional programming like higher order functions and closures are present in modern languages anyway.
jkbbwr
Right-> left wtf
snyp
except maybe variants. which sucks a bit. c++17 will probably standardize variants. >.>
idk
pyon
jkbbwr: It *can* be written as `putStrLn (show (1 + 1))`.
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 next »