Click here to Skip to main content
15,901,781 members
Home / Discussions / C#
   

C#

 
QuestionAre there any good apple ipad c# compilers? Pin
Ultra9603-Jun-20 1:20
Ultra9603-Jun-20 1:20 
AnswerRe: Are there any good apple ipad c# compilers? Pin
OriginalGriff3-Jun-20 1:25
mveOriginalGriff3-Jun-20 1:25 
QuestionHow can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w2-Jun-20 5:31
arnold_w2-Jun-20 5:31 
AnswerRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
OriginalGriff2-Jun-20 5:50
mveOriginalGriff2-Jun-20 5:50 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w2-Jun-20 9:40
arnold_w2-Jun-20 9:40 
AnswerRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w2-Jun-20 22:59
arnold_w2-Jun-20 22:59 
AnswerRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w3-Jun-20 2:39
arnold_w3-Jun-20 2:39 
AnswerRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
Gerry Schmitz3-Jun-20 6:40
mveGerry Schmitz3-Jun-20 6:40 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w3-Jun-20 9:30
arnold_w3-Jun-20 9:30 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
kalberts3-Jun-20 10:10
kalberts3-Jun-20 10:10 
GeneralRe: How can I compile code in runtime faster than CSharpCodeProvider()).CreateCompiler().CompileAssemblyFromDom? Pin
arnold_w3-Jun-20 10:34
arnold_w3-Jun-20 10:34 
QuestionConverting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 3:52
Exoskeletor2-Jun-20 3:52 
AnswerRe: Converting InAppBilling.Plugin to Amazon Pin
OriginalGriff2-Jun-20 4:38
mveOriginalGriff2-Jun-20 4:38 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 4:56
Exoskeletor2-Jun-20 4:56 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
OriginalGriff2-Jun-20 5:18
mveOriginalGriff2-Jun-20 5:18 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 7:40
Exoskeletor2-Jun-20 7:40 
AnswerRe: Converting InAppBilling.Plugin to Amazon Pin
Kris Lantz2-Jun-20 9:13
professionalKris Lantz2-Jun-20 9:13 
GeneralRe: Converting InAppBilling.Plugin to Amazon Pin
Exoskeletor2-Jun-20 9:24
Exoskeletor2-Jun-20 9:24 
QuestionState machine performance woes in .NET Pin
kalberts2-Jun-20 3:04
kalberts2-Jun-20 3:04 
This is a followup to a thread started in the Lounge: The Lounge[^]

First this makes me think of The First Law Of Optimization: Don't do it!
And then The Second Law of Optimzation: If you have to do it, don't do it yet!

This obvuiouly refers to peephole optimzation. Selecting an algorithm of lower complexity is a different matter. But worrying about how the switch construct is handled by the compiler falls in the peephole class.

When I programmed Pascal around 1980, the compiler knew a single way of coding CASE x OF statements: As a jump table with at most 256 entries. Or more exactly: Alternatives was limited to internal values 0..255. Fair enough for small student exercises, but for real code, it was just tooo limiting.

Then I got into CHILL with its decision table entries ("CASE A, B, C OF ...", with all combinations of A, B, C values, with "don't care" and ELSE and the whole works - but still static). Later comes C# with much greater flexibility. Bottom line: Tiny jump tables is a very special case. You may hope for the compiler to optimize for that particular one, but I wouldn't spend too much energy on it. In the world of modern code, it is just too special.

Then there is another thing, now that you refer to state machines: I don't believe that switch statements is a good way to implemnent state machines. Maintenance is resource demanding when you expand it with new states and events. Giving proper handling to illegal events is difficult. And any reasonably complete state machine, e.g. for a communication protocol, will have a rather sparse state table.

If you implement a sparse 2D transition table by a jump table for one dimension, each leading to a jump table in the other dimension, you implemenent that full, sparse table in a rather un-maintainable way. I would rather pack the table, and address it as a single table. So you would maintain the table in an unpacked form, and use a small compaction routine to build the runtime table when you change it.

I let the compaction routine generate the table access function as well, so that a simple table not requiring e.g. predicate handling for alternate actions will not have this access code generated.

I guess my code is not super-optimized to those tiny demo-examples to teach students the basic idea of an FSM. But if you really need the functionality of a full blown solution, then I can handle it with sufficient speed that the table lookup is certainly not a bottleneck.

State tables are tables, not "cases". Treat them as such!
AnswerRe: State machine performance woes in .NET Pin
kalberts2-Jun-20 3:41
kalberts2-Jun-20 3:41 
GeneralRe: State machine performance woes in .NET Pin
F-ES Sitecore2-Jun-20 4:08
professionalF-ES Sitecore2-Jun-20 4:08 
QuestionProblem with Currency format Column Calculation in my dGV in C# Winform Application. Pin
Member 1467808531-May-20 6:47
Member 1467808531-May-20 6:47 
AnswerRe: Problem with Currency format Column Calculation in my dGV in C# Winform Application. Pin
OriginalGriff31-May-20 20:34
mveOriginalGriff31-May-20 20:34 
QuestionMulti threading in C# Pin
bjwaldo28-May-20 9:21
bjwaldo28-May-20 9:21 
AnswerRe: Multi threading in C# Pin
JudyL_MD28-May-20 10:45
JudyL_MD28-May-20 10:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.