GithubHelp home page GithubHelp logo

Comments (7)

yegor256 avatar yegor256 commented on August 16, 2024

@Tradunsky I think I agree. text will be a better name. Can you submit a pull request?

from eo.

Tradunsky avatar Tradunsky commented on August 16, 2024

@yegor256 Yep, sure. #63

from eo.

nqafield avatar nqafield commented on August 16, 2024

@Tradunsky Have you got any examples of what you mean by Object#toString being misused?

Also, if Text would be for human-readable text, why wouldn't a book title count as Text? Or even an ISBN for that matter?

from eo.

Tradunsky avatar Tradunsky commented on August 16, 2024

@pa9ey, @yegor256
The intention to get rid of String might be a good idea, but first of all we should think of a problem that we are going to solve.

Performing code review for youth engineers I saw some interesting logic based on Type#toString result. According to javadoc:

Returns a string representation of the object. In general, the
{@code toString} method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.

So, if the method asText supposed to be useful for humans (debugging at least), it should not provide developers with methods for processing it incorrectly.

The second problem is related to representation of basic data as String(or Text). For example, why do we should represent money as string literal? Shall this kind of a type has their own representation, like without quotes (1$, 25uah, 100500rub)? I know that we should choose the level of abstraction in the case of ISBN or Person name, but it looks strange to choose Text for one word or a number. However, the source of that data might be a unknown and it would be easy to create some complex objects from basic type like String.

from eo.

yegor256 avatar yegor256 commented on August 16, 2024

@Tradunsky I think this ticket can be closed as fixed?

from eo.

Tradunsky avatar Tradunsky commented on August 16, 2024

@yegor256 It is up to you

from eo.

yegor256 avatar yegor256 commented on August 16, 2024

@Tradunsky not relevant anymore, thanks for submitting though

from eo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.