|
wwb posted:Oh, and who the gently caress submitted that xjson poo poo to reddit. Karma is a hell of a drug.
|
# ? Apr 30, 2011 01:25 |
|
|
# ? May 16, 2024 13:22 |
|
ahh christ do they not understand anything about xml here's how you represent arbitrary json in xml, assholes: pre:{ "name":"John Smith" "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": 10021, }, "phoneNumbers": [ "212 555-1111", "212 555-2222" ], "additionalInfo": null, "remote": false, "height": 62.4, "ficoScore": " > 640" } pre:<?xml version="1.0" encoding="UTF-8"?> <object xmlns="urn:json-xml"> <string key="name" value="John Smith"/> <object key="address"> <string key="streetAddress" value="21 2nd Street"/> <string key="city" value="New York"/> <string key="state" value="NY"/> <string key="postalCode" value="10021"/> </object> <array key="phoneNumbers"> <string value="212 555-1111"/> <string value="212 555-2222"/> </array> <null key="additionalInfo"/> <bool key="remote" value="false"/> <number key="height" value="62.4"/> <string key="ficoScore" value="> 640"/> </object> Perhaps IBM's customers are paying by the byte.
|
# ? Apr 30, 2011 01:32 |
|
Doc Hawkins posted:Why? Because Enterprise! y'see, JSON doesn't scale. I know this, you know this, everyone knows this. It's a fact. XML? XML Scales. Like. A. BOSS.
|
# ? Apr 30, 2011 02:16 |
|
Janin posted:ahh christ do they not understand anything about xml It's a horrible idea, but their execution was fine. The namespace clutter is clearly because the xml was generated. Your example is inconsistent since you use both a "value" attribute and the "value" of the element.
|
# ? Apr 30, 2011 02:18 |
|
Janin posted:Perhaps IBM's customers are paying by the byte. It's typical enterprise, no one wants to bother selling small, simple jobs, so the providers make the most over-complicated spec they can that they can still get accepted by the client.
|
# ? Apr 30, 2011 04:05 |
|
DataPower®
|
# ? Apr 30, 2011 04:12 |
|
I think maybe that IBM JSON thing is because whatever that web service is, it works with XML internally, but can interoperate with JSON externally. So clients can send JSON to it and it will work transparently. At least that's the impression I got. It's ugly, but interop usually is.
|
# ? Apr 30, 2011 06:55 |
|
Volte posted:I think maybe that IBM JSON thing is because whatever that web service is, it works with XML internally, but can interoperate with JSON externally. So clients can send JSON to it and it will work transparently. At least that's the impression I got. It's ugly, but interop usually is. All that happens here is the mechanism to turn the flat text into a tree changes, for both JSON and XML these are solved problems. The hard bit is doing something useful with this tree, which this does not help with. It's a classic bit of busy work.
|
# ? Apr 30, 2011 11:57 |
|
Doc Hawkins posted:It's typical enterprise, no one wants to bother selling small, simple jobs, so the providers make the most over-complicated spec they can that they can still get accepted by the client. I had direct experience with this once. Someone came to our company with a job, they wanted some word documents transformed into an XML format. The docs were mostly consistent with themselves, but between docs there were some differences. I looked at the project and thought "This is a job for a couple Perl scripts written to get most of the job done and then some manual steps." A little dirty, sure, but it is just parsing text anyway. I figured it'd take a week or two. At the time I wasn't officially a dev, so first the dev team put in their design. They wanted to charge some 200+ hours to write this ridiculous C# tool that would magically be able to transform any document into anything else. I did not ingratiate myself with that developer when I came into the meeting with my 40-60 hour estimate and also questioned whether the tool he was proposing would even solve the problem. I mean, if you write a generic tool like that, congratulations, you've reinvented awk. Now you have to write a config file for each document and we're right back where we started. I also didn't think he was even close to capable of writing the thing he described. When told to write unit tests for an app, he added code to button handlers to output log messages if a debugger was attached saying that the buttons had been clicked.
|
# ? Apr 30, 2011 18:36 |
|
Wouldn't it just be easier to resave the word document as .docx and unzip it
|
# ? Apr 30, 2011 18:56 |
|
Sedro posted:It's a horrible idea, but their execution was fine. The namespace clutter is clearly because the xml was generated. Your example is inconsistent since you use both a "value" attribute and the "value" of the element. Generated XML is no excuse for choosing such verbose namespaces and prefixes. If it absolutely *must* have prefixes, the generator should at least just use "j:".
|
# ? Apr 30, 2011 21:28 |
|
Janin posted:My example is perfectly consistent. XML elements do not have values, only children, so it's perfectly natural to list the content of JSON arrays and objects as child elements.
|
# ? Apr 30, 2011 21:54 |
|
Reading through the gigantic backlog. This thread is basically a zoo where both sides of the glass paid to get in and look at the other.
|
# ? May 1, 2011 03:10 |
|
MonsterUnderYourBed posted:Reading through the gigantic backlog. This thread is basically a zoo where both sides of the glass paid to get in and look at the other. Haha, that's a really good analogy and I'm going to have to start using that more often in real life.
|
# ? May 1, 2011 03:41 |
|
Aleksei Vasiliev posted:but what if they also need to interoperate with a J<->XML system
|
# ? May 1, 2011 18:56 |
|
Janin posted:Perhaps IBM's customers are paying by the byte. Paying by the processor cycle is actually closer to the truth.
|
# ? May 2, 2011 12:52 |
|
Janin posted:
IBM owns our EDI VAN provider (EDI being another overwrought overdesigned unreadable flat file specification) and they charge us by the byte. Wouldn't surprise me if that's true.
|
# ? May 2, 2011 18:55 |
|
Scaramouche posted:IBM owns our EDI VAN provider (EDI being another overwrought overdesigned unreadable flat file specification) and they charge us by the byte. Wouldn't surprise me if that's true. The EDI based XML I've seen looks mostly like this: code:
|
# ? May 2, 2011 20:40 |
|
Zombywuf posted:The EDI based XML I've seen looks mostly like this: Yeah, mine's all flat file so it looks a bit more exploded/bizarre text file than that. What's funny is some of the partners use the old spec that insists the ascii flat file actually has reserved white space. So if field A can contain a max 16 characters you better believe that it's going to look like: code:
|
# ? May 2, 2011 21:09 |
|
Scaramouche posted:Yeah, mine's all flat file so it looks a bit more exploded/bizarre text file than that. What's funny is some of the partners use the old spec that insists the ascii flat file actually has reserved white space. So if field A can contain a max 16 characters you better believe that it's going to look like: PIC X(16) I've worked on some COBOL ERPs and they pull that dogshit all the time. Have to trim() every single data element you get.
|
# ? May 2, 2011 21:22 |
|
TRex EaterofCars posted:PIC X(16) Sad part is even though we say we use the 4011 spec there's all kinds of little exceptions to the mapper. Some guys will provide *0000000000123456~, some the above, some don't care so it's *123456~ etc. Thank goodness the spec itself is relatively strong when it comes to typing so I don't have to test for number/bit/string/ness all the time.
|
# ? May 2, 2011 22:14 |
|
All this talk reminds me of all the various NENA file formats I have to work with all the time. I think there's something like 9 different data formats for ALI/location data, and the fields don't seem to map cleanly between any of them. Some of them are fixed/flat format, while some are XML. The format I'm specifically working with today is a 512-character record format, with all fields padded with spaces on the right, except one field, that's padded on the left. There are over 100 characters of 'reserved' (i.e., blank) fields as well.
|
# ? May 2, 2011 22:43 |
|
I'm getting the impression that XML is the greatest common denominator of enterprise communication horseshit because you can actually understand what the data is, but it's the least common denominator on people who just want to get poo poo done.
|
# ? May 3, 2011 00:12 |
|
I have to maintain a 750,000 line vba project full of gotos. The horror I saw today?code:
"nUlLsTrInG" What is this SQUIGGLECASE. I must admit I am just a lowly code janitor but this seems really batshit insane. Why? Why would you have a nullstring constant? Why would you have it hold a value? wHy WoUlD tHaT vAlUe hAvE tHiS gOiNg On?
|
# ? May 3, 2011 01:22 |
|
Presumably nobody will ever set a string to "nUlLsTrInG", in which case any string which is "nUlLsTrInG" must be the null string.
|
# ? May 3, 2011 01:27 |
|
pseudorandom name posted:Presumably nobody will ever set a string to "nUlLsTrInG", in which case any string which is "nUlLsTrInG" must be the null string. cool but why not use vbNullString, or "" or y'know the faster if lenB(str) = 0 ? There is no way in hell that is really how you are supposed to do it.
|
# ? May 3, 2011 01:51 |
|
Maybe, you legitimately want to store an empty string. Maybe you want to throw an error if the string is null, though. Maybe, just MAYBE, there might be justification for doing that. Probably not, though.
|
# ? May 3, 2011 02:07 |
|
MonsterUnderYourBed posted:Reading through the gigantic backlog. This thread is basically a zoo where both sides of the glass paid to get in and look at the other.
|
# ? May 3, 2011 02:57 |
|
bobthecheese posted:Maybe, you legitimately want to store an empty string. Maybe you want to throw an error if the string is null, though. Maybe, just MAYBE, there might be justification for doing that. Maybe author needed a special case for an string value in code that is not quite same as actual null string, and that variable name is just a bad choice of words?
|
# ? May 3, 2011 05:31 |
|
Mustach posted:The question is: what causes coding horrors? The answer is: software engineers. We should ban all Software Engineers to put an end to coding horrors.
|
# ? May 3, 2011 06:19 |
|
sklnd posted:We should ban all Software Engineers to put an end to coding horrors. It's the Software Architects you've got to worry about. They decide that because it makes a pretty picture it's a working design. Apologies to any Software Architects who worked their way up from programmer.
|
# ? May 3, 2011 06:55 |
|
pr0metheus posted:Maybe author needed a special case for an string value in code that is not quite same as actual null string, and that variable name is just a bad choice of words? VB has three kinds of null already, clearly that was not enough for this code's author.
|
# ? May 3, 2011 12:18 |
|
arvash posted:Why? Why would you have a nullstring constant? Why would you have it hold a value? wHy WoUlD tHaT vAlUe hAvE tHiS gOiNg On? To gently caress with your head. Edison was a dick posted:It's the Software Architects you've got to worry about. They decide that because it makes a pretty picture it's a working design. Architects aren't exempt just because they came from the trenches. The last great horror I witnessed came from an architect who worked his way up through the company as a programmer. He was really great writing code but he couldn't understand what kind of hell he was unleashing on the people who maintained the app in production. Also, architects from a software background usually have less of an understanding of how to do things without jumping through a ton of hoops. Example: the project I am currently working on is a "messaging gateway" which just sends messages to the appropriate application to be processed. Instead of engineering an entirely new solution we could have just set up an irule on the F5 to automatically route the messages. And if they needed manipulation or translation we could have easily used an out of the box solution like mule instead of engineering something ourselves. In my experience architects from a software engineering background want to write everything either because A) "I can do it better" or B) "I didn't know that existed" and in both cases it ends up a disaster*. *enterprise deedee megadoodoo fucked around with this message at 15:53 on May 3, 2011 |
# ? May 3, 2011 15:02 |
|
Just found this in some guy's code I'm rewriting.code:
|
# ? May 7, 2011 21:44 |
|
Amtiskaw posted:Just found this in some guy's code I'm rewriting. If you're referring to the filter, that's not that bad; he was probably in the middle of refactoring it from when IsItemDraggable was a string or something, and got called to work on something else. Other than that it's just not great code (why does having a positive draggableCount mean that the transaction has already been processed?), but not really a horror IMO. Tell him he should use .Any(), by the way.
|
# ? May 7, 2011 23:02 |
|
ninjeff posted:If you're referring to the filter, that's not that bad; he was probably in the middle of refactoring it from when IsItemDraggable was a string or something, and got called to work on something else. I'm glad I'm not the only one. It's not pretty, but to my amateur self it didn't seem like a horror.
|
# ? May 7, 2011 23:18 |
Well if nothing else, having some UI state of something indicate a data state, and be the only (or best) way of checking for that data state, is a maintainability-problem brewing. This could also point to the controller leaking into the view, or something to that effect. IsItemDraggable should depend on IsTransactionProcessed, not the other way.
|
|
# ? May 7, 2011 23:52 |
|
The horror was the parsing of a string literal to bool to compare to a bool, plus the use of where + count to achieve what can be done with another standard operator. code:
For example, we're using MVVM, so we have a view model that I put observable properties on. And some of the property setters have some logic in them to mutate related properties, fire notification events etc. Well this guy has seen this, and decided it means everything should be done via logic in property setters. So instead of having say, a method called SubmitTransactions(t), he has a property like this code:
|
# ? May 8, 2011 02:56 |
|
Amtiskaw posted:The horror was the parsing of a string literal to bool to compare to a bool, plus the use of where + count to achieve what can be done with another standard operator. Seriously this should be ringing alarm bells in your head. That is some amateur hour poo poo that only first semester students do.
|
# ? May 8, 2011 07:44 |
|
|
# ? May 16, 2024 13:22 |
|
Amtiskaw posted:The horror was the parsing of a string literal to bool to compare to a bool, Hah! I skimmed right over that.
|
# ? May 8, 2011 07:51 |