Josh @ Dreamland
|
 |
Reply #15 Posted on: December 27, 2009, 10:29:48 pm |
|
|
Prince of all Goldfish
 Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The string pointed to by char* is prefixed with an integer. It's no separate variable; it, in fact, is not referred to by any variable. Much less a private one.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
serprex
|
 |
Reply #16 Posted on: December 28, 2009, 06:50:14 am |
|
|
Smooth ER
 Joined: Apr 2008
Posts: 106
|
STL mandates that even linked list have O(1) size functions. And as for function call overhead, it's called inlining Trust your compiler's optimizations, or get staked and use assembly Like that loop tip. If you're using a tracing JIT, loops are what they feed on. If you're using C, they've already thought about it. Also note code cache might make a loop faster than an unrolled one As for Josh's talk of std::string, ignore him. Spec doesn't define implementation, hence
|
|
« Last Edit: December 28, 2009, 07:15:06 am by serprex »
|
Logged
|
|
|
|
Post made December 28, 2009, 10:49:25 am was deleted at the author's request.
|
serprex
|
 |
Reply #18 Posted on: December 28, 2009, 12:01:36 pm |
|
|
Smooth ER
 Joined: Apr 2008
Posts: 106
|
D and C# allow for both integers and strings to be used in switch statements, relying on the compiler to choose a suitable form of jump table (Probably hash jump table, as in the case of sparse integers). Functional languages have pattern matching to cover the syntactic terseness of a switch, and due to an abundance in the semantic qualitiy of referential transparency, optimizations can be applied to output assembly resembling a switch
#3, why are you explaining types? The only languages I've come across that lack multiple primitive types are esoteric languages, and I don't think any of these suggestions would really suit Thue
I disagree with delta timing. You suggest a naive approach which can cause wall jumping in extreme cases. Just program efficiently in the first place, and all is well
Pseudocode is a joke. If I want simple syntax and clear semantics, I'll use Python. If you want to do the whole writing out algorithms without dealing with language hassles, draw out some graphs. Pseudocode doesn't offer enough useful abstraction to call for leaving away testing at a click of a button
#8 is a whole lot of nothing about something
|
|
« Last Edit: December 28, 2009, 12:16:45 pm by serprex »
|
Logged
|
|
|
|
Post made December 28, 2009, 08:09:38 pm was deleted at the author's request.
|
Post made January 21, 2010, 05:59:33 pm was deleted at the author's request.
|
Post made January 22, 2010, 09:11:30 pm was deleted at the author's request.
|
|
Post made January 23, 2010, 01:14:06 pm was deleted at the author's request.
|
|
|
|
Post made January 28, 2010, 10:24:57 am was deleted at the author's request.
|
|