Why do we need prefix, postfix notation

Infix notation is easy to read for humans, whereas pre-/postfix notation is easier to parse for a machine. The big advantage in pre-/postfix notation is that there never arise any questions like operator precedence. For example, consider the infix expression 1 # 2 $ 3. Now, we don’t know what those operators mean, so there … Read more

Equivalent of Class Loaders in .NET

The answer is yes, but the solution is a little tricky. The System.Reflection.Emit namespace defines types that allows assemblies to be generated dynamically. They also allow the generated assemblies to be defined incrementally. In other words it is possible to add types to the dynamic assembly, execute the generated code, and then latter add more … Read more

What is Method Dispatch?

First let’s say what a message and a method are: A message is a name that can be sent from one object to another, possibly with additional objects as arguments. For example in account withdraw: 100 The message is withdraw: (Smalltalk syntax.) (Other languages might write account.withdraw(100).) The object receiving the message, in this example … Read more

What are the advantages that prototype based OO has over class based OO?

The advantage of prototypal inheritance is that it potentially allows fancy metaprogramming in a straightforward way because the prototype chain is easily manipulated. This is a rather academic advantage because metaprogramming is the wrong answer 99% of the time. As an example, you could have a Javascript Key-Value Observer style data manipulation layer with a … Read more

Maximum Method Name Length

For C# I don’t believe there’s a specified hard limit. (Section 2.4.2 of the C# 5 spec doesn’t give a limit, for example.) Roslyn v2.2.0.61624 seems to have a limit of 1024 characters; this is way beyond the bounds of readability and even a sensible machine-generated name. For Java, section 3.8 of the spec states: … Read more

What is the worst programming language you ever worked with? [closed]

PHP (In no particular order) Inconsistent function names and argument orders Because there are a zillion functions, each one of which seems to use a different naming convention and argument order. “Lets see… is it foo_bar or foobar or fooBar… and is it needle, haystack or haystack, needle?” The PHP string functions are a perfect … Read more

Haskell, Scala, Clojure, what to choose for high performance pattern matching and concurrency [closed]

Do you want fast or do you want easy? If you want fast, you should use C++, even if you’re using FP principles to aid in correctness. Since timing is crucial, the support for soft (and hard, if need be) real-time programming will be important. You can decide exactly how and when you have time … Read more

What are the key differences between OO in Smalltalk and Java?

Message passing Smalltalk uses message passing, not method invocation. The distinction is subtle, but enormously powerful. Some terminology: Given foo bar: baz, #bar: is a selector, foo is the receiver of a message called #bar: (the # indicates a symbol, much like Common Lisp would say ‘bar (or even more appropriately, :bar)), and baz is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)