|
Vanadium posted:Stealing links from HN: http://stackoverflow.com/questions/4456438/how-can-i-pass-the-string-null-through-wsdl-soap-from-as3-to-coldfusion-web This is why I never liked XML. There's no concept of a type. You can specify one in a DTD or something, but half of the tools I've used just never bothered, and it's now back inflexibility when you want to do something outside the boundaries of DTDs/schemas (optional schemas was considered one of XML's greatest strengths over SGML). Without one, how can you know if <foo>12345</foo> represents the number 12345, or the string "12345"? You have to guess.
|
# ? Apr 27, 2012 21:44 |
|
|
# ? Apr 29, 2024 05:13 |
|
I think the XML-ish completely unhelpful response to that complaint is that in <foo>12345</foo>, the 12345 is obviously of type foo, and you have to know the context of the message if you want a more concrete interpretation.
|
# ? Apr 27, 2012 21:50 |
|
<value name="foo" type="string">12345</value> <foo type="string">12345</foo> <foo><string>12345</string></foo> <string><foo>12345</foo></string> <foo>"12345"</foo> XML is great!
|
# ? Apr 27, 2012 21:55 |
|
ShoulderDaemon posted:I think the XML-ish completely unhelpful response to that complaint is that in <foo>12345</foo>, the 12345 is obviously of type foo, and you have to know the context of the message if you want a more concrete interpretation. Right, so the type data is out of band, which means that the logic that can be implemented by you by a generic XML parser becomes less and less, which means that "generic toolkits" invent their own hacks because people are lazy.
|
# ? Apr 27, 2012 21:59 |
|
Suspicious Dish posted:Right, so the type data is out of band, which means that the logic that can be implemented by you by a generic XML parser becomes less and less, which means that "generic toolkits" invent their own hacks because people are lazy. Yeah, it's kind of shameful that so many supposedly "generic" intermediate layers are prone to simply throwing out information and relying on the most ambiguous representations they can possibly get away with. Horror: I have actually written modern code (in the last 2 years) for a new application that used Sun RPC to communicate. I was working in Haskell. Horror2: It was pretty much the best experience I've ever had writing IPC code, and I have little doubt that time will show it to be the most reliable IPC code I've written.
|
# ? Apr 27, 2012 22:08 |
|
If you're doing something with the XML, you'd almost certainly expect it to be in a particular format. You can define that format in a .xsd schema, afterall that's what they're for. It's still a good idea define a schema for the XML data format even if you use a generic parser of some sort, if only for testing and documentation purposes.
|
# ? Apr 27, 2012 22:12 |
|
This is probably a coding horror in and of itself, but I can't stand XML and I can't really articulate any reason that an XML-defender couldn't give an answer of some sort to.
|
# ? Apr 27, 2012 22:15 |
|
Structure is nothing if it is all you got. Skeletons spook people if they try to walk around on their own. I really wonder why XML does not. --Erik Naggum
|
# ? Apr 27, 2012 22:39 |
|
Thermopyle posted:This is probably a coding horror in and of itself, but I can't stand XML and I can't really articulate any reason that an XML-defender couldn't give an answer of some sort to. It's ridiculous verbosity? The fact that people misuse it and just shove everything into XML? There are obviously some good use cases for XML, somewhere down the line someone thought to use XML for everything. See: Java
|
# ? Apr 27, 2012 22:56 |
|
There is one good use-case for XML: domain-specific text markup languages. Nobody uses it for that.
|
# ? Apr 27, 2012 23:07 |
|
pseudorandom name posted:There is one good use-case for XML: domain-specific text markup languages. Right. Text nodes are XML's most powerful feature, and everybody ignores it.
|
# ? Apr 27, 2012 23:30 |
|
Suspicious Dish posted:Right. Text nodes are XML's most powerful feature, and everybody ignores it. I think I understand what you mean, but could you expand on this a bit? Why are text nodes XML's most powerful feature?
|
# ? Apr 27, 2012 23:33 |
|
pokeyman posted:I think I understand what you mean, but could you expand on this a bit? Why are text nodes XML's most powerful feature? Maybe not most powerful, but it's a powerful construct that everyone ignores. Maybe because the DOM bindings are so awful to work with. I mean, you use it all the time when you write HTML: code:
|
# ? Apr 27, 2012 23:37 |
|
Right, that's what I had in mind. I've never, ever seen XML written like HTML.
|
# ? Apr 27, 2012 23:41 |
|
What do people think about Yaml? I haven't actually used it in a project yet, but it seemed nice enough.
|
# ? Apr 28, 2012 00:24 |
|
It's awesome and is a superset of JSON but isn't as widely used.
|
# ? Apr 28, 2012 00:31 |
|
I used to hate JSON soooo much (And Javascript, I hated js, but that's another story...) but now it's really grown on me, and instead XML looks overly verbose.
|
# ? Apr 28, 2012 01:01 |
|
pokeyman posted:It's awesome and is a superset of JSON but isn't as widely used. I'm seeing it more and more sprouting up in Github projects.
|
# ? Apr 28, 2012 01:26 |
|
XML is great for applying semantics and structure to documents. JSON is great for serializing shared data. Both turn to poo poo when you abuse them.
|
# ? Apr 28, 2012 01:31 |
|
TildeATH posted:(And Javascript, I hated js, but that's another story...) JavaScript is an awesome language that's widely abused. I wish I knew it better.
|
# ? Apr 28, 2012 01:36 |
|
code:
Bonus points to anybody who knows where the hell the first 1 gets pushed. Opinion Haver fucked around with this message at 01:46 on Apr 28, 2012 |
# ? Apr 28, 2012 01:43 |
|
yaoi prophet posted:
It gets pushed to foo, so foo.length is 1. But if you REALLY want to burn your noodle, tell me why that doesn't work but this does: code:
DaTroof fucked around with this message at 02:40 on Apr 28, 2012 |
# ? Apr 28, 2012 02:33 |
|
DaTroof posted:It gets pushed to foo, so foo.length is 1. But if you REALLY want to burn your noodle, tell me why that doesn't work but this does: Because that's the way Javascript works?? Nothing there is a mystery.
|
# ? Apr 28, 2012 02:44 |
|
shrughes posted:Because that's the way Javascript works?? Nothing there is a mystery. If functions are first-class objects, those two snippets should have the same behavior. It's not a killer bug or anything, but it's still weird.
|
# ? Apr 28, 2012 02:51 |
|
push() operates on this, not this.elems, I'm not sure why this is surprising.
|
# ? Apr 28, 2012 02:58 |
|
pseudorandom name posted:push operates on this, not this.elems, I'm not sure why this is surprising. Because push operates on this in the first example, but it operates on this.elems in the second.
|
# ? Apr 28, 2012 02:59 |
|
Well, yeah, you're calling this.elems.push() instead of this.push(). None of this is weird or surprising.
|
# ? Apr 28, 2012 03:04 |
|
DaTroof posted:If functions are first-class objects, those two snippets should have the same behavior. It's not a killer bug or anything, but it's still weird. Functions are first class objects but they aren't closures over their enclosing object; this is passed to the function at call time. So: code:
|
# ? Apr 28, 2012 03:12 |
|
DaTroof posted:Because push operates on this in the first example, but it operates on this.elems in the second. The this argument is whatever is on the left-hand side of the call. Unlike other languages where a.b.c(); can be decomposed into var f = a.b.c; f();, JS needs the qualification. And: code:
|
# ? Apr 28, 2012 03:12 |
|
pseudorandom name posted:Well, yeah, you're calling this.elems.push() instead of this.push(). None of this is weird or surprising. They both use foo.push(), but only one of them pushes to foo.elems. Point being, I don't know why assigning an anonymous function to this.push works, but this doesn't: code:
|
# ? Apr 28, 2012 03:14 |
|
ToxicFrog posted:Functions are first class objects but they aren't closures over their enclosing object; this is passed to the function at call time. Ahh, that actually makes sense. Still seems weird to me, but I get the logic now. Thanks.
|
# ? Apr 28, 2012 03:17 |
|
Suspicious Dish posted:The this argument is whatever is on the left-hand side of the call. Unlike other languages where a.b.c(); can be decomposed into var f = a.b.c; f();, JS needs the qualification. And after that, it doesn't even seem weird anymore. Sheesh. Maybe I need some sleep.
|
# ? Apr 28, 2012 03:24 |
|
DaTroof posted:And after that, it doesn't even seem weird anymore. Sheesh. Maybe I need some sleep. Right, it's a bit unnatural when you're used to a language that automatically creates a bound closure for you, like Python. Note that in ES Harmony, they're planning on making automatic soft bound closures the default.
|
# ? Apr 28, 2012 03:56 |
|
Contero posted:What do people think about Yaml? I haven't actually used it in a project yet, but it seemed nice enough. yaml is awesome until you look at the spec and realize how hosed up and horrible it can get. all so you can omit `{}`, `[]` and `"`
|
# ? Apr 28, 2012 06:46 |
|
Thermopyle posted:This is probably a coding horror in and of itself, but I can't stand XML and I can't really articulate any reason that an XML-defender couldn't give an answer of some sort to. I'm coding an app that reads data from user generated, but otherwise static, XML files like this one: http://pastebin.com/As98K9S0 It is awfully verbose, but I don't know of anything else that would make sense to use. I don't really have an extensive coding background, though.
|
# ? Apr 28, 2012 07:03 |
|
pokeyman posted:I think I understand what you mean, but could you expand on this a bit? Why are text nodes XML's most powerful feature?
|
# ? Apr 28, 2012 09:20 |
|
code:
quote:it's actually better this way for future compatibility and, regardless, several customers already use it tihs way.
|
# ? Apr 28, 2012 19:20 |
|
Contero posted:code:
|
# ? Apr 28, 2012 19:24 |
|
I like the repeating ICAgICAgICAg. I bet they're using EBC because the person who implemented their encryption doesn't know the first thing about block ciphers.
|
# ? Apr 28, 2012 19:53 |
|
|
# ? Apr 29, 2024 05:13 |
|
yaoi prophet posted:I like the repeating ICAgICAgICAg. I bet they're using EBC because the person who implemented their encryption doesn't know the first thing about block ciphers. Nah, that was base64 of the quoted post. I've actually seen it encapsulated in XML like three levels deep. And some people actually consider it encryption
|
# ? Apr 28, 2012 20:03 |