Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Quis_sum
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
Quis_sum
11mo ago
I am probably too old school: Unless properly documented (the "whats" and especially the "whys") and provided with a test harness (plus the test cases, including all fringe cases btw.) just reject it straight away. And i
2.
▲
by
Quis_sum
2y ago
Clearly the author never worked with a CM2 - I did though. The CM2 was more like a co-processor which had to be controlled by a (for that age) rather beefy SUN workstation/server. The program itself ran on the workstation which then se
3.
▲
by
Quis_sum
2y ago
C definitely does not need this - in fact I would go as far and consider it harmful. I agree that a feature like this could be useful, but then there are other useful features which should be added too. Where do you stop? I hope the C stand
4.
▲
by
Quis_sum
2y ago
C was designed in the 1970s with the goal of giving you minimal overhead, bar using a macro-assembler. The way C handles "strings" provides exactly that. The OP clearly stated that he did not mind the overhead (in terms of executa
5.
▲
by
Quis_sum
2y ago
I don't have an issue with the OP's example, which is quite nifty indeed, despite the penalties incurred.
6.
▲
by
Quis_sum
2y ago
s is still a pointer to character. This is just an optimised shorthand for (assuming ASCII): char s[3]; Which is then initialised with: 0x48,0x69,0x00 There simply is no such thing as a string type in C. All the "string" functions
7.
▲
by
Quis_sum
2y ago
Sorry, but there is a significant misunderstanding: There is no such thing as a string in C. What you call a string is a pointer to char (typically "int8") - nothing more nothing less. The \0 termination is just a convention/