Questions tagged [formatting]
The formatting tag has no summary.
32 questions
-2 votes
1 answer
124 views
Clean code: formatting rules, dependent functions, multiple calls [closed]
About formatting Here are two scenarios in which the details of the formatting are described. How should in the clean code way, this be formatted Scenario 1: Dependent functions of dependent functions ...
78 votes
7 answers
6k views
What's the use case for formatting monetary values with a *system-dependent* currency symbol?
Many high-level programming languages have built-in features to format a number with a system-dependent currency symbol: -- Outputs $100.00 (en-US) or € 100,00 (de-AT) Console.WriteLine(100.ToString(&...
-4 votes
1 answer
124 views
What happen to string.ToCommonSenseCase()?
I'm very confused about this. In most programming languages, there are string.ToUpperCase(), string.ToLowerCase(), sometimes Capitalize() (which capitalize the first letter of the string), even ...
1 vote
2 answers
186 views
Abstract composition hierarchy with multiple implementations
I need to implement a class hierarchy and be able to implement it in multiple ways. I want to create a logical representation of a query language, and then be able to parse it to/from different ...
45 votes
2 answers
94k views
How to represent a set in JSON?
JSON supports the following data structures (Java equivalents): Scalar, Array/List, and Map. A Set is not supported out-of-the-box in JSON. I thought about several ways to represent a set in JSON: [...
41 votes
6 answers
14k views
Why not return dates as a string from the database?
In a typical web application, dates are retrieved from the database layer strongly typed (e.g. in c# as a System.DateTime as opposed System.String). When a date needs to be expressed as a string (e....
3 votes
3 answers
3k views
Image resolution in a RESTful interface
Background I have a RESTful HTTP API. I have a resource. GET /my/cat HTTP/1.1 Clients may want to retrieve the image representation of this resource. GET /my/cat HTTP/1.1 Accepts: image/png ...
1 vote
1 answer
988 views
Under what cirumstances would type 'System.Object' qualify for serialization?
I'm in charge of a comprehensive serialization format with support to serialize runtime objects (any derived type of Object). I can't find a sane scenario where one would choose to serialize an ...