3 ms·
That was a complete waste of time. To sum it up: don't rely on the format of a generic toString() method. Prefer country.getName() over country.toString(), eve
by kasperni 7y ago
That was a complete waste of time.
To sum it up: don't rely on the format of a generic toString() method. Prefer country.getName() over country.toString(), even if toString() returns getName().
- netsharc 7y agoIt's cool to read, but yeah, it's like reading Beginner's Java, lesson 3.
- simendsjo 7y agoMore like "beginning software architecture". While this is "common knowledge" after coding for years, it's actually hard-earned, battle-scarred knowledge. Sharing experience on how to design software is very useful for all the people just starting out.
- rhacker 7y agoUnlikely. Beginner's Java, lesson 3 is the reason people are using toString() erroneously in the first place.
- hkh28 7y ago> That was a complete waste of time. I think that's a bit harsh. It's an article explaining simply, but effectively why you should probably not use toString(). Just because something can be summed up in a sentence does not make it a waste of time.
- simendsjo 7y agoA complete waste of time for some, and very useful for others. I don't believe comments like this is constructive for anyone.
- kasperni 7y agoYeah, I was a bit harsh. But they already posted an announcement post about their Christmas calendar: https://news.ycombinator.com/item?id=21700759 https://news.ycombinator.com/item?id=21700759 I don't see the need to go into individual posts on top of it. In the end, I just think there are better channels for getting started with programming in a particular language then this site.