X-Received: by 10.66.89.135 with SMTP id bo7mr10503236pab.16.1357500674615; Sun, 06 Jan 2013 11:31:14 -0800 (PST) Received: by 10.49.15.100 with SMTP id w4mr9994301qec.26.1357500674550; Sun, 06 Jan 2013 11:31:14 -0800 (PST) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nntp.club.cc.cmu.edu!169.228.66.3.MISMATCH!ihnp4.UCSD.Edu!newsfeed.news.ucla.edu!usenet.stanford.edu!b8no1498876pbd.0!news-out.google.com!s9ni88763pbb.0!nntp.google.com!b8no1498874pbd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Sun, 6 Jan 2013 11:31:14 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=50.14.119.173; posting-account=lPVJQwoAAACjT2AlnY0YSj2LC4j2qtwQ NNTP-Posting-Host: 50.14.119.173 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2c8c633a-917b-4573-b246-ae622ac3e04e@googlegroups.com> Subject: Re: How to get from A to B (actually, from type "A" to type "B") From: "Aryeh M. Friedman" Injection-Date: Sun, 06 Jan 2013 19:31:14 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:21057 On Sunday, January 6, 2013 2:22:55 PM UTC-5, Ramon F Herrera wrote: > I was flabbergasted the first time I used an IDE that had the "period > > completion" feature (or the similar, "left parenthesis"). It made me > > considering leaving old trusted "vi". > > > > The problem with the period is that it only goes one step deep: more > > steps are needed! Additionally, sometimes the period is not the answer > > to your travails, when a non-member function is the one that will > > convert from type "A" to type "B". > > > > When I was learning Java, a large number of questions (and time > > wasted) that I posted were of the form: > > > > "How do I convert [some type] to [some other type]?" > > > > The text conversions alone occupy an inordinate amount of time to > > programmers (just try Google to see what I mean). > > > > Some C++ examples: > > > > I had been using for a long time this (from Boost::Filesystem): > > > > string somestring = "abc/de"; > > path p = path(somestring); > > > > Only to realize, accidentally, that the conversion is done > > automatically. The IDE should help you in those cases: > > > > path p = somestring; > > > > This one made me kick myself. I used this many, many times: > > > > const char* sometext = somestring.string().c_str(); > > > > Well, it turns out that this one is just as good: > > > > const char* sometext = somestring.c_str(); > > > > My question is about R&D done in this particular field. I tried Google > > but the word "type" is too ambiguous. > > > > This problem is very similar to the resolution of Rubik's Cube. Your > > expression is in some "scrambled" state and you need the computer to > > tell you -not only any path! mind you- but the shortest path (known as > > God's algorithm) to the desired type. Exhaustive, aka brute force > > search can be used: after all, we are not talking Rubik type of steps, > > most of the time we are 1 or 2 steps away from the conversion. > > > > Regards, > > > > -Ramon whats your point/question?