• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
Bartenders:
  • Piet Souris
  • Mikalai Zaikin

(String) casts in SortNames

 
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My environment is too stupid to make distinction between
casts and identifiers.
So I got "( String ) object" by 'beautifying' and got nitpicked a number of times.
So do not do that, read the style guide again!
 
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You aren't allowed to make casts from Object to String?
Paul R
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can cast an Object to a String if the Object was originally a String that was stored as an Object.
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I meant is: '(String)object' versus '( String ) object'
Styleguide conformance, you see three spaces? ;-)
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure I understand,
  • (String)object <- the nitpickers way ?
  • ( String ) object <- your way ?

  • The first one is correct, see 2.2 - Spacing

    This is true. -- Marilyn


    [This message has been edited by Johannes de Jong (edited June 01, 2001).]
    [This message has been edited by Marilyn deQueiroz (edited June 01, 2001).]
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to the style guide (and Marilyn reminding me) I learned this lesson.
Now that I use the style guide format it makes it a lot easier to spot a cast in my code.
Michael
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Michael,
You mean a regular expression: '(\w+)' (emacs)?!
No answer necessary.
Have a nice weekend
Peter
 
What's that smell? Hey, sniff this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic