Another Language - Page 11


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 11 of 18 FirstFirst ... 910111213 ... LastLast
Results 151 to 165 of 261

Thread: Another Language

  1. #151
    Bob Butler Guest

    Re: Another Language

    "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote in
    message news:3afb0a76@news.devx.com...
    <cut>
    > The name should tell you all you need to know...it is an Integer.


    The name itself tells me nothing about the size, but I know from experience
    with the language that it means a signed 16-bit value.... at least I did
    know that. Now I'm not sure when I look at code unless other clues tell me
    what version of VB it is.

    <cut>
    > The generic name Integer for a datatype should resolve to the most

    efficient
    > integer datatype for the computer IMO.


    That may be your opinion but that's a change to the defintion of "Integer"
    in VB and I'm very opposed to redefining existing keywords unless you first
    go through a real deprecation in order to free them up for later re-use.

    > If an integer datatype with a specific range (i.e. bitsize) is required,

    use IntXX...

    I will now that they are available. I thought that's what I was doing
    before when I chose "Integer" vs "Long".




  2. #152
    Kunle Odutola Guest

    Re: Another Language


    "Jonathan West" <jwest@mvps.org> wrote in message
    news:3afb0c0c@news.devx.com...
    >


    > >
    > > Unless the new habit is more intuitive...

    >
    > Actually no, that's why the old habit was a habit


    Integer as 16-bit was a habit because it was intuitive?
    Come on...

    > > I didn't say it was the main justification but it is important.

    >
    > Well, you didn't suggest any other justification. I was looking, very
    > carefully


    I did. Perhaps you missed them. Quick test for you:
    1. Given the following list of datatypes: Short, Integer, Long, Int16,
    Int32, Int64, SysInt, NativeInteger and PerformantInteger.
    If you just wanted an Integer, what would you use?

    2. If you found out that the obvious answer to the previous question
    resulted in poorer performance than others would you think it intuitive?

    I use Long (as do many other millions) to avoid the problems with Integer. I
    shouldn't have had to...

    > Anyway, this is getting boring. As far as I can see, there aren't any
    > reasons or justifications that will get through to you on this subject, so
    > let's leave it.


    I could have used the same words in reply to you. <g>
    Anyways, I read your views. And I have heard many others, for and against
    the change. In the final analysis, we managed to draw different conclusions.
    It happens.

    Take care,

    Kunle




  3. #153
    Kunle Odutola Guest

    Re: Another Language


    "Bob Butler" <butlerbob@earthlink.net> wrote in message
    news:3afb0e31$1@news.devx.com...
    > "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote

    in
    > message news:3afb0a76@news.devx.com...


    > <cut>
    > > The name should tell you all you need to know...it is an Integer.

    >
    > The name itself tells me nothing about the size, but I know from

    experience
    > with the language that it means a signed 16-bit value.... at least I did
    > know that. Now I'm not sure when I look at code unless other clues tell

    me
    > what version of VB it is.


    That could soon be: it _meant_ 16-bit integers.
    You will know. VB.NET's framework API calls and other keywords will alert
    you to the fact.

    > <cut>
    > > The generic name Integer for a datatype should resolve to the most

    > efficient
    > > integer datatype for the computer IMO.

    >
    > That may be your opinion but that's a change to the defintion of "Integer"
    > in VB and I'm very opposed to redefining existing keywords unless you

    first
    > go through a real deprecation in order to free them up for later re-use.


    You are right it is a change. I have been saying the same, "it is a change
    and I welcome it".
    I feel it will have minor impact overall because the remedy is so simple
    (unless you've used the new Int16 name for something else!).

    > > If an integer datatype with a specific range (i.e. bitsize) is required,

    > use IntXX...
    >
    > I will now that they are available. I thought that's what I was doing
    > before when I chose "Integer" vs "Long".


    True. I did bemoan the lack of IntXX previously.
    At least now, it's been cleaned up.

    Kunle




  4. #154
    Bob Butler Guest

    Re: Another Language

    "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote in
    message news:3afb10ed$1@news.devx.com...
    <cut>
    > I did. Perhaps you missed them. Quick test for you:
    > 1. Given the following list of datatypes: Short, Integer, Long, Int16,
    > Int32, Int64, SysInt, NativeInteger and PerformantInteger.
    > If you just wanted an Integer, what would you use?


    Long for VB6, Int32 for VB.Net

    > 2. If you found out that the obvious answer to the previous question
    > resulted in poorer performance than others would you think it intuitive?


    I don't see an "obvious" answer. I take the time to learn the data types
    and determine what is appropriate for the platform. Experience has taught
    me that making assumptions about performance issues is generally a bad idea.
    If/when a version of VB offers a platform-dependent data type then I will
    consider using that.

    BTW, I could easily argue that "Short" is the most intuitive choice as it is
    the smallest and the CPU should be able to move smaller data chunks around
    faster than larger data chunks, shouldn't it? That falls in line with
    perceptions I've heard from many people new to development who don't
    understand that the 32-bit size can be more efficient. What one person
    finds obvious may not hold for another.








  5. #155
    Jonathan West Guest

    Re: Another Language


    "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote in
    message news:3afb10ed$1@news.devx.com...
    >
    > "Jonathan West" <jwest@mvps.org> wrote in message
    > news:3afb0c0c@news.devx.com...
    > >

    >
    > > >
    > > > Unless the new habit is more intuitive...

    > >
    > > Actually no, that's why the old habit was a habit

    >
    > Integer as 16-bit was a habit because it was intuitive?


    No, because it was old.
    >
    > I did. Perhaps you missed them. Quick test for you:
    > 1. Given the following list of datatypes: Short, Integer, Long, Int16,
    > Int32, Int64, SysInt, NativeInteger and PerformantInteger.
    > If you just wanted an Integer, what would you use?


    Its obvious. For a language that was new to me, I would check the help and
    see what they all actually do. I would then decide which was best for my
    specific purpose. For the future, I would remember them so I could use them
    again without having to return to the help. I might have to review the help
    a few times until I had got it all properly in my memory.

    I think it would be a very sloppy programmer who selected one of those
    without checking the documentation.

    >
    > 2. If you found out that the obvious answer to the previous question
    > resulted in poorer performance than others would you think it intuitive?


    I would have no opinion on the subject. I would simply go back to the
    documentation and see where I had gone wrong.

    >
    > I use Long (as do many other millions) to avoid the problems with Integer.

    I
    > shouldn't have had to...


    Why not? Fewer characters to type. That should have boosted your
    productivity!


    --
    Regards
    Jonathan West


  6. #156
    Karl E. Peterson Guest

    Re: Another Language

    "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote ...
    >
    > This feature is truly a loss but something like it might come back if VSA is
    > anything to go by.


    What makes you say that?

    > Not enough to drag VB down for me though, price to pay for now as I see it.


    You heavily invested in Vaseline, huh?

    Later... Karl


  7. #157
    Karl E. Peterson Guest

    Re: Another Language

    Naw, that says it all. :-)
    --
    http://www.mvps.org/vb

    "Patrick Troughton" <Patrick@Troughton.com> wrote in message
    news:3afaf7c5@news.devx.com...
    >
    > Aw, come on, you can do better than that....
    >
    > /Pat
    >
    > "Karl E. Peterson" <karl@mvps.org> wrote:
    > >Heh, haven't had the opportunity in weeks, it seems!
    > >
    > >Pull yer head out, Pat! :-)
    > >--
    > >http://www.mvps.org/vb
    > >
    > >
    > >"Patrick Troughton" <Patrick@Troughton.com> wrote in message
    > >news:3afaedc8$1@news.devx.com...
    > >>
    > >> "Karl E. Peterson" <karl@mvps.org> wrote:
    > >> >> > > Remember BASIC had no concept of Integer types - just Number!
    > >> >> >
    > >> >> > HUH???
    > >> >>
    > >> >> Yep. That's right. BASIC had two datatypes originally - Numbers and

    > Strings.
    > >> >
    > >> >Not Microsoft Basic. You're going back to K&K, which B&S tremendously

    > enhanced.
    > >> 6
    > >> >million users aren't all wrong, eh?
    > >>
    > >> You mean BASIC was changed in the past and it still survived? Oh the gratuitous
    > >> changes! Oh the horror!
    > >>
    > >> /Pat
    > >>

    > >

    >



  8. #158
    Karl E. Peterson Guest

    Re: Another Language

    "Mike Mitchell" <kylix_is@hotmail.com> wrote in message
    news:3afaf4c9.3002089@news.devx.com...
    > On Thu, 10 May 2001 12:19:38 -0700, "Karl E. Peterson" <karl@mvps.org>
    > wrote:
    >
    > >That was my take, too. All numbers then were floating point.
    > >
    > >> MS Basic, at least from CP/M on, used integers as a type.

    > >
    > >Not to mention Single, Double, and String, huh? The oldest electronic docs I have
    > >handy are for GWBASIC (1985):
    > >
    > >=================================
    > >DEFINT/SNG/DBL/STR Statements

    >
    > Nah! Try me! Go on! See, I just.....lean over to the left a tad, and
    > grab my "Radio Shack TRS-80 User's Manual for Level 1", first edition,
    > second printing - 1978, with a "Personal Note from the Author", one
    > Dr. David A. Lien of San Diego, 1977.


    Yeah, my older books are in a box somewhere in my garage. I was just looking for the
    oldest bits on this P3*2/666 box. I got a K&K manual, somewhere, myself.
    --
    http://www.mvps.org/vb


  9. #159
    Dan Barclay Guest

    Re: Another Language

    On Thu, 10 May 2001 22:41:23 +0100, "Kunle Odutola"
    <kunle.odutola@<REMOVETHIS>okocha.freeserve.co.uk> wrote:

    >
    >"Dan Barclay" <Dan@MVPs.org> wrote in message
    >news:3vvlftsefsndecui2mupkqt92329mvb5ai@4ax.com...
    >> On Thu, 10 May 2001 19:52:37 +0100, "Kunle Odutola"
    >> <kunle.odutola@<REMOVETHIS>okocha.freeserve.co.uk> wrote:
    >>
    >> >
    >> >Yep. That's right. BASIC had two datatypes originally - Numbers and

    >Strings.
    >>
    >> Nope. Originally it had only one datatype. Numbers. It supported
    >> string literals but not variables. That is assuming you're actually
    >> talking about the *original*.

    >
    >I said datatype. And yes, BASIC has _always_ had at least two of those.
    >Strings and numbers.


    If you consider a string literal, allowed only in a PRINT statement to
    be a datatype, that is correct. Of course, it could have actually
    been a character or byte array <g>.

    It did not, however, have string variables.

    Dan
    Language Stability is a *feature* I wish VB had!
    (#6)

  10. #160
    Karl E. Peterson Guest

    Re: Another Language

    "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote in message
    news:3afaf431@news.devx.com...
    >
    > > The rest of us have gotten by just fine with using the most performant
    > > datatype now, for six or seven years, even though it hasn't been named
    > > "Integer."

    >
    > It is likely that you have no further logical or coherent argument to make
    > in this discussion Karl.


    Sounds like you're just parroting JW's attack on you, hmmm? I can't fight incohence
    with logic, sorry. Present _anything_ resembling what you look for, and it will be
    met with same.

    > I have used Long for the same reason as many
    > others - someone messed up with Integer.


    Messed up? Bwahahahahahahaaaa!!! My but you are the intolerant little bugger,
    aren't you?

    > Apart from "it's always been that way" and "old code would break", you have
    > offered no other arguments.


    What more do you need? Unless you want a throwaway language, of course. If that's
    the case, we're done, anyway.

    > "it's always been that way":
    > ------------------------
    > This is not even an argument.


    No, it's a precedent.

    > "old code would break":
    > ---------------------------
    > I accept some code would need a search and replace excercise to fix because
    > of this change. The benefits for the wider community who won't need to know
    > about "performant types (aka Long)" to write efficient VB code outweighs
    > this trivial step to the one-time exercise that .NET demands anyway.


    I don't really give a rat's *** about elevating "the wider community" to a position
    of greater priviledge and/or considertaion than that of existing users/customers. To
    argue that VB should be more compatible with Java or C than with VB is asinine. Use
    Java or C if that's what you want.

    > VB.NET has much more radical changes that make this change insignificant
    > from a code migration standpoint but very beneficial going forwards.


    There are zero benefits that I'm aware of. Can you name one, other than the
    alleviation of your own confusion?

    > > > Performant datatype?. What is that?

    > >
    > > Sorry I had to use such a big word. It is what you have been describing.

    >
    > Apology accepted. Long is about all I can understand.


    Long (32-bits) may or may not be the most performant datatype on other platforms. I
    didn't restrict my usage to a given number of bits. If you want a datatype, and I
    can assure that *I* do!, that's the most performant regardless of where the
    application is executed, then what you need to do is lobby for the SysInt. What
    you're doing is of no benefit to anyone, and will only serve to cause additional
    burden for many for years if not decades to come.

    Later... Karl
    --
    http://www.mvps.org/vb



  11. #161
    Karl E. Peterson Guest

    Re: Another Language

    Psssst... your ignorance is showing. (Again.)
    --
    http://www.mvps.org/vb

    "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote in message
    news:3afb0a78@news.devx.com...
    >
    > "Bob Butler" <butlerbob@earthlink.net> wrote in message
    > news:3afafdf4@news.devx.com...
    > > "Kunle Odutola okocha.freeserve.co.uk>" <kunle.odutola@<REMOVETHIS> wrote

    > in
    > > message news:3afadf60@news.devx.com...
    > > <cut>
    > > > In no way at all. But if I just want an Integer - don't care about the
    > > > size - to use for a loop counter, indexing etc and use the aptly named
    > > > "Integer" datatype, why should my applications suffer a performance

    > > penalty
    > > > compared to if I had known that the underlying CPU architecture was

    > 32bits
    > > > and I had chosen to use Long instead, or Int64 (LongAlso?) in the

    > future,
    > > or
    > > > Int128 (AndEvenLonger?)...

    > >
    > > The answer is something you stated in an earlier post:
    > > Know your stuff or pay the price...
    > >
    > > As Karl said, what you are arguing for is a new data type -- an integer
    > > value of whatever size is best for the current platform. That's a fine
    > > thing to have available and I've said before that I thought some sort of
    > > "NativeInteger" or "SystemInteger" or whatever it gets called makes sense.
    > > That's not what "Integer" is though. "Integer" should be left

    > consistently
    > > defined as 16 bits. As far as naming new types when we get Int128,

    > Int256,
    > > etc.... don't. Drop the "friendly" names and just use the unambiguous,
    > > easily extensible IntXX naming scheme.

    >
    > You guys crack me up. I can see where AndAlso came from now.
    > SysInt?
    > NativeInteger?
    > SystemInteger?
    > PerformantInteger?
    > WhatSouldReallyBeCalledIntegerButIsntInteger?
    >
    > Hmmm,.....no thanks. "Integer" sums it up just fine when I need
    > an...integer?.
    > Glad MS agreed too...
    >
    > Kunle
    >
    >
    >



  12. #162
    Karl E. Peterson Guest

    Re: Another Language

    Kunle --

    > Oh it was a mistake.


    If it makes you feel better to think so...

    > Just like you missed the fact that BASIC originally had two datatypes.


    Wrong again, bubba. Dan, you got the docs? Regardless, the conversation was
    centered on *Microsoft* implementations of the language, hence the "again."

    > Noboby would select Single as an integer datatype in preference to a
    > datatype named Integer.


    Heh, kids. <g>

    > Oblique references to version of BASIC before
    > Integer was introduced show a clear lack of defensible arguments to support
    > your position.


    This wasn't before Integers were introduced. The default variable type was Single
    right through VB2.

    Later... Karl
    --
    http://www.mvps.org/vb



  13. #163
    rmeklo Guest

    Re: Another Language


    >BTW, I could easily argue that "Short" is the most intuitive choice as it

    is
    >the smallest and the CPU should be able to move smaller data chunks around
    >faster than larger data chunks, shouldn't it? That falls in line with
    >perceptions I've heard from many people new to development who don't
    >understand that the 32-bit size can be more efficient. What one person
    >finds obvious may not hold for another.


    I can see your point and have encountered VB6 code that used "Byte"
    (instead of "Integer") for presumably this reason.
    But when did "Short" join the BASIC lexicon?
    It sounds foreign/ambiguous to me.
    I could do without even "Long" (but keep it for compat, of course)
    Integer16, Integer32, ... Integer[2^N] seem best.
    AndAlso a SystemInteger,
    AndMaybe Unsigned types too.

  14. #164
    Dan Barclay Guest

    Re: Another Language

    On Thu, 10 May 2001 16:31:34 -0700, "Karl E. Peterson" <karl@mvps.org>
    wrote:

    >Kunle --
    >
    >> Oh it was a mistake.

    >
    >If it makes you feel better to think so...
    >
    >> Just like you missed the fact that BASIC originally had two datatypes.

    >
    >Wrong again, bubba. Dan, you got the docs?


    Yea. You could do:

    PRINT "My answer is:"
    PRINT A

    He now claims that this use of a string literal is another "data type"
    <gg>.

    Dan

    > Regardless, the conversation was
    >centered on *Microsoft* implementations of the language, hence the "again."
    >
    >> Noboby would select Single as an integer datatype in preference to a
    >> datatype named Integer.

    >
    >Heh, kids. <g>


    LOL! No, nobody would do that, unless you were trying to make the
    default data types work for most problems. Back then the performance
    issue wasn't centered around data types so much... there was a lot of
    interpretin' goin' on. It made some difference, but not the magnitude
    it does with compiled code.

    Dan
    Language Stability is a *feature* I wish VB had!
    (#6)

  15. #165
    Phil Weber Guest

    Re: Another Language

    > In my opinon, they messed up on two issues related
    > to our discussion here in the VB3/VB4 timeframe (maybe
    > before)...


    Kunle: I agree, but I think Microsoft's mistake only involved a single
    issue: documentation. With the release of VB3 or 4, MS should have clearly
    documented that, going forward, the Integer keyword would refer to the
    processor's native word size. A Long would be twice the size of an Integer;
    a Short would be half the size. At a minimum, MS could have simply
    documented that the implementation of VB's integral numeric types may change
    in the future, and therefore developers should not make assumptions as to
    their size and/or layout.
    ---
    Phil Weber



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center