Timeline for Fully-working alternative to String.format(...)
Current License: CC BY-SA 3.0
15 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 14, 2014 at 15:47 | comment | added | maaartinus |
@ChristopherRucinski Let's see, post a new question. Btw., I've just revived an old idea of mine: extensible formatting where you can plug in a handler for a new format specifier and type. Moreover, it's much faster than String.format. It's not typesafe, but it never throws (unless configured with a ThrowingErrorHandler).
|
|
| Sep 14, 2014 at 15:18 | comment | added | Christopher Rucinski | I actually have an updated version that looks very promising and does not have the reusability issues the posted version has | |
| Sep 14, 2014 at 15:11 | comment | added | maaartinus |
@BoristheSpider I doubt that MessageFormat is a useful replacement. It can do localization, but it's missing many other features, e.g. hex formatting.
|
|
| Sep 10, 2014 at 17:53 | history | edited | Christopher Rucinski | CC BY-SA 3.0 |
added 133 characters in body
|
| Sep 10, 2014 at 15:37 | comment | added | amon | Regarding “Now, we get taught that reusability is very important in university; however, when I applied what was taught before, I found out by SO users that my code was not reusable” – I recently read an interesting essay on the topic of reusability. To summarize: reusability has no meaning. What matters is usability. | |
| Sep 10, 2014 at 14:27 | history | edited | Christopher Rucinski | CC BY-SA 3.0 |
Clarified why I have commented out code
|
| Sep 10, 2014 at 12:07 | answer | added | Simon Forsberg | timeline score: 7 | |
| Sep 10, 2014 at 9:08 | comment | added | Boris the Spider |
If you don't like String.format, why not simply use a MessageFormat? Reinventing the wheel seems overkill...
|
|
| Sep 10, 2014 at 4:45 | history | edited | Jamal | CC BY-SA 3.0 |
deleted 25 characters in body; edited title
|
| Sep 10, 2014 at 4:42 | history | edited | Christopher Rucinski | CC BY-SA 3.0 |
Reformatted question and added more code. Included most problem-specific code, but commented out non-essential code.
|
| Sep 10, 2014 at 2:33 | comment | added | maaartinus |
I'd really suggest to leave out all the Android stuff. A String.format alternative is complicated enough for a single CR and it has nothing to do with Android. So do a bit of separation of concerns.
|
|
| Sep 9, 2014 at 18:32 | history | edited | Christopher Rucinski | CC BY-SA 3.0 |
Showed a secondary way of doing the formatting in the Expressions. My original code used a custom class, but more well-known Formatters can be used
|
| Sep 9, 2014 at 18:03 | history | edited | Christopher Rucinski | CC BY-SA 3.0 |
added 383 characters in body
|
| Sep 9, 2014 at 17:44 | review | First posts | |||
| Sep 9, 2014 at 17:50 | |||||
| Sep 9, 2014 at 17:39 | history | asked | Christopher Rucinski | CC BY-SA 3.0 |