Re:Show HN: Demo of Wiki and Forum coded in C under 80k
by kbenson on Friday December 04, 2015 @01:58AM
(#10675074)
I still maintain that + is a terrible operator for concatenating strings, and results in quite a few types of bugs that are pervasive in many languages (usually from trying to automatically coerce non-matching operands).
Re:Show HN: Demo of Wiki and Forum coded in C under 80k
by mtdewcmu on Friday December 04, 2015 @02:30AM
(#10675126)
I think I agree. PHP uses ., and I can't recall ever having a problem with that. However, I've been bitten by +.
Re:Show HN: Demo of Wiki and Forum coded in C under 80k
by jheriko on Friday December 04, 2015 @11:09AM
(#10677098)
i can accept that argument. basic used & and php uses . as mentioned by another comment. :)
Re:Show HN: Demo of Wiki and Forum coded in C under 80k
by krapp on Friday December 04, 2015 @12:57AM
(#10674926)
Someone should totally build a dynamically typed language around C which is specifically meant for dealing with HTTP and serving HTML.
Re:Show HN: Demo of Wiki and Forum coded in C under 80k
by frik on Friday December 04, 2015 @01:07AM
(#10674952)
It's called PHP
a = "foo" + "bar"; is very useful so is b = a.split( "," ); or a = b.trim(); etc. C strings are rarely so convenient.
its more obvious with the more high level things you want. to do something like b = a.split( "," ); on a string that is not know until runtime you need dynamic allocations and you could use strtok to fill that memory with the results, but its an error-prone ballache by comparison.