From: Tom Shelton on 17 Feb 2010 10:17 On 2010-02-17, Tom Shelton <tom_shelton(a)comcastXXXXXXX.net> wrote: > On 2010-02-17, mayayana <mayayana(a)nospam.invalid> wrote: >>> I do appreciate the heirarchical nature of XML and >>> that binary data can be >>> stored in the XML format. I also appreciate the >>> benefits of using the fast, >>> centrally-managed registry. In my instance, and >>> I'm guessing in a lot of >>> applications, the INI file is perfect for the job, though. >>> >> >> That seems to be it in a nutshell. XML has >> specific advantages. It's also currently high >> fashion, being shoehorned into "everything >> but the kitchen sink". >> >> Manifests are a good example of >> XML overuse: A very simple file that just needs >> to contain a small string of data, it could easily >> be an INI file. Yet Microsoft has turned manifests >> into mysterious, ridiculous blobs of superfluous >> XML, so complex that nobody can remember the >> syntax. >> >> In another current thread of this group people >> are talking about special software to generate >> manifest XML. :) > > XML - while human readable is not necissarily meant to be human readable. I > use it because it's portable, parsers are common and generally easy to use. > In .NET it's a no brainer: > > string mySetting = ConfigurationManager.AppSettings("MySetting"); > woops! bit of vb crept into that statement :) should be: string mySetting = ConfigurationManager.AppSettings["MySetting"]; -- Tom Shelton
From: mayayana on 17 Feb 2010 10:43 > I use it because it's portable, parsers are common > and generally easy to use. I did say it has specific advantages. Your statement is the sort of thing I mean in saying XML is fashionable. It's like your approach to .Nxt. You don't just use it where it makes sense and appreciate its strengths. You feel a need to tell other people that they *should* use it. There's an assumption that you're in a school of fish and "we should all stay together". It's just a tool, for goodness sake. > In .NET it's a no brainer: > > string mySetting = ConfigurationManager.AppSettings("MySetting"); > "No brainer" indeed. Is anyone supposed to understand what your string (VB.Net? C-hash?) has to do with XML ...or VB? Do I have to study the ..Nxt framework to get your point? Would you like some directions to a .Nxt group? Here's an "optimized" version: <XML SCHEMA 1.2.3.4.something-or-other> <OFFICIAL SCHEMA SUBTAG RFC-1234; 2009-2010:soo:> <PC-RELATED> <NNTP:newsgroup - format:readable;blah v. 1.21> <GROUP_NAME_STRING_ENTRY> microsoft.public.dotnet.general </GROUP_NAME_STRING_ENTRY> </NNTP:newsgroup - format:readable;blah v. 1.21> </PC-RELATED> </OFFICIAL SCHEMA SUBTAG RFC-1234; 2009-2010:soo:> </XML SCHEMA 1.2.3.4.something-or-other> I hope you can read that OK. I didn't actually run it through the W3C XML propriety meter. Ideally you should probably read it via v. 6 of MSXML. If necessary you may want to update your version of Windows so that you can install MSXML v. 6. :)
From: Tom Shelton on 17 Feb 2010 10:56 On 2010-02-17, mayayana <mayayana(a)nospam.invalid> wrote: >> I use it because it's portable, parsers are common >> and generally easy to use. > > I did say it has specific advantages. Your statement > is the sort of thing I mean in saying XML is fashionable. > It's like your approach to .Nxt. You don't just use it > where it makes sense and appreciate its strengths. You > feel a need to tell other people that they *should* use it. I'm not telling you you should use it. I'm simply stating some of the advantages of using it. Ini files are not necessarily portable to other OS's - and I run some of my code on Linux as well as windows, so it's nice to have a common format. It's called discussion. Sorry if the concept escapes you. > There's an assumption that you're in a school of fish > and "we should all stay together". > > It's just a tool, for goodness sake. > Yes it is. >> In .NET it's a no brainer: >> >> string mySetting = ConfigurationManager.AppSettings("MySetting"); >> > > "No brainer" indeed. Is anyone supposed to > understand what your string (VB.Net? C-hash?) > has to do with XML ...or VB? Do I have to study the Application configurations in .net have a specific schema (which can be extended). ConfigurationManager is just a built in class that understands that schema and can provide convienent access without worring about a parser. The point was that it's actually much simpler to use an xml conig file in .net then to use a ini file. There is a built in portable api. I wouldnt have brought it up - except that the OP was using .NET. -- Tom Shelton
From: Ralph on 17 Feb 2010 10:57 Tom Shelton wrote: <snipped> > > XML - while human readable is not necissarily meant to be human > readable. I use it because it's portable, parsers are common and > generally easy to use. ... lol - Your cognitive dissonance is showing. What could be simpler than a text editor and INI tools that have been available in Windows since Win286? XML, INI, CVS, fixed-sized records, ... they are all part of a long list of DIFFs. You made a choice, you like XML, and that is fine. There are a lot of advantages to XML - but don't go deluding yourself it is because they are somehow more portable or easier to parser compared to any of the others. -ralph
From: Tom Shelton on 17 Feb 2010 11:21 On 2010-02-17, Ralph <nt_consulting64(a)yahoo.com> wrote: > Tom Shelton wrote: ><snipped> >> >> XML - while human readable is not necissarily meant to be human >> readable. I use it because it's portable, parsers are common and >> generally easy to use. ... > > lol - Your cognitive dissonance is showing. > Huh? What did I say that made think that? XML is not necissarily intended to be human readable - it is just a side effect of the technology that it often is. Sometimes it's not (at least not easily) - have you ever looked at say the xml for an Office XML spread sheet (SpreadsheetML)? > What could be simpler than a text editor and INI tools that have been > available in Windows since Win286? > My C# code does not necissarily only run on windows. So, unless I want to write a non-api ini parser then xml is the best choice. Not that it would be hard, but it would be a complete waste of effort given the xml config files built into the framework and that work in both environments. > XML, INI, CVS, fixed-sized records, ... they are all part of a long list of > DIFFs. You made a choice, you like XML, and that is fine. There are a lot of > advantages to XML - but don't go deluding yourself it is because they are > somehow more portable or easier to parser compared to any of the others. See, I think we are comming from two different standpoints. When I say protable, I mean accross different OS's. Of course, that wouldn't matter to you as much - because if you are going to run your vb app on another os, such as linux you would have to do so under wine - so, your ini would still work. But, if I run a .net app on linux, i'm not going to want to do a p/invoke call to the ini apis since it will fail. A ini is easy to parse manually of course, but again why would I since I have a system already built in? Belive me, I used to be all about ini files - I still have my INI parsing dll around here. I've never been one for the registry - in fact, I've pretty much avoided it's use from day one :) -- Tom Shelton
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Selecting the font size matching the control's height Next: Easy question |