Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #21057

Re: How to get from A to B (actually, from type "A" to type "B")

Newsgroups comp.lang.java.programmer
Date 2013-01-06 11:31 -0800
References <b1a4c163-c843-4d36-b9bd-f504dd5bc4e6@d10g2000yqe.googlegroups.com>
Message-ID <2c8c633a-917b-4573-b246-ae622ac3e04e@googlegroups.com> (permalink)
Subject Re: How to get from A to B (actually, from type "A" to type "B")
From "Aryeh M. Friedman" <Aryeh.Friedman@gmail.com>

Show all headers | View raw


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?

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get from A to B (actually, from type "A" to type "B") "Ramon F. Herrera" <ramon@conexus.net> - 2013-01-06 11:22 -0800
  Re: How to get from A to B (actually, from type "A" to type "B") Ramon F Herrera <ramon@conexus.net> - 2013-01-06 11:27 -0800
  Re: How to get from A to B (actually, from type "A" to type "B") "Aryeh M. Friedman" <Aryeh.Friedman@gmail.com> - 2013-01-06 11:31 -0800
    Re: How to get from A to B (actually, from type "A" to type "B") Ramon F Herrera <ramon@conexus.net> - 2013-01-06 11:42 -0800
      Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 15:06 -0500
        Re: How to get from A to B (actually, from type "A" to type "B") Ramon F Herrera <ramon@conexus.net> - 2013-01-06 12:16 -0800
          Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 15:27 -0500
    Re: How to get from A to B (actually, from type "A" to type "B") Ramon F Herrera <ramon@conexus.net> - 2013-01-06 11:58 -0800
      Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 15:08 -0500
      Re: How to get from A to B (actually, from type "A" to type "B") Bill Gill <billnews2@cox.net> - 2013-01-06 17:31 -0600
  Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 15:04 -0500
    Re: How to get from A to B (actually, from type "A" to type "B") Ramon F Herrera <ramon@conexus.net> - 2013-01-06 12:05 -0800
      Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 15:10 -0500
        Re: How to get from A to B (actually, from type "A" to type "B") Ramon F Herrera <ramon@conexus.net> - 2013-01-06 12:18 -0800
          Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 15:29 -0500
          Re: How to get from A to B (actually, from type "A" to type "B") lipska the kat <lipskathekat@yahoo.co.uk> - 2013-01-07 08:45 +0000
  Re: How to get from A to B (actually, from type "A" to type "B") Joshua Cranmer <Pidgeot18@verizon.invalid> - 2013-01-06 19:12 -0600
    Re: How to get from A to B (actually, from type "A" to type "B") Arne Vajhøj <arne@vajhoej.dk> - 2013-01-06 20:29 -0500
  Re: How to get from A to B (actually, from type "A" to type "B") Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-01-07 02:45 +0000
    Re: How to get from A to B (actually, from type "A" to type "B") Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-01-07 14:03 +0000

csiph-web