Comments (7)
@Tradunsky I think I agree. text
will be a better name. Can you submit a pull request?
from eo.
from eo.
@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.
@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.
@Tradunsky I think this ticket can be closed as fixed?
from eo.
@yegor256 It is up to you
from eo.
@Tradunsky not relevant anymore, thanks for submitting though
from eo.
Related Issues (20)
- Data.java:196-199: This method should be refactored... HOT 2
- Can we use some static analysis like Sonar in CI on PR? HOT 1
- Failed build: daily HOT 10
- Add `+rt node` meta to work with js compiler HOT 1
- merge smaller libs into this repo HOT 7
- Printing PHI Expressions Extremely Slow HOT 4
- list.eo:208-211: The object does not work. After moving... HOT 2
- PhPackage need update HOT 2
- BytesRaw.java:33-36: Method {@link BytesOf#shift} should... HOT 2
- align-test-classes.xsl:27-28: Add link to corresponding... HOT 2
- remove-high-level-inner-classes.xsl:27-28: Create... HOT 14
- map.eo:105-112: Find a way to link hash code and index of... HOT 2
- text.eo:313-315: Implement text.replaced object. This... HOT 3
- Replace `int` and `float` with `number` HOT 1
- `eo-maven-plugin` allows attributes without names in an abstract object HOT 10
- Dataized.java:54-57: It is necessary to call {@link... HOT 2
- Dataized.java:64-67: It is necessary to call {@link... HOT 2
- PhDefault.java:65-68: It is necessary to call {@link... HOT 2
- PhTraced.java:50-53: It is necessary to call {@link... HOT 2
- Too many nested function calls HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eo.