JS Programming in C# – Objects on the fly

Creating objects without defining types is considered a great flexibility in JavaScript. JavaScript treats objects nothing more than key-value pairs. Yeah, you can declare functions in the object but they are still part of the key-value philosophy. Bottomline: JavaScript did not start out as an object oriented language.

Typically, objects are created on the fly1 using the object literal syntax:

let obj = {
   name: "Will",
   age: 26

There are scenarios when creating objects on the fly is indeed a flexibility.

Continue reading JS Programming in C# – Objects on the fly



In his talk at the CppCon 2014, Bjarne Stroustrup explained, politely and brilliantly, how to write succinct expressive yet intent-ful code. The task is especially hard when there are parties interested in trolling1 rather than contributing. Like Stroustrup explains back, it is difficult to find the real meaning out of a large block of (legacy) code.

Continue reading JINQ

final, const and beyond

What are your thoughts on the following piece of code?

public String someGibberishMethod() {
    int length = someMethodReturningLength();
    int sum = 0;

    for (int index = 0; index < length; ++index) {
       // some code that updates the sum variable

    SomeClass someClass = new SomeClass(sum);
    int sumValueInsideSomeClass = someClass.getSumValue();
    // use someText, maybe log or something

    String someText = someClass.doSomeOperation(/*some parameters*/);
    // use someText, maybe log or something
    return someText;

Continue reading final, const and beyond

JAR Tips: Loading dependencies

If you are writing a typical console based application in Windows, you would end up with an executable (exe). You might also have one or more dependent libraries (DLL). The question is where do we place these DLLs so that they are picked up at runtime by the application; loaded and consumed. Actually it is no brainer, just put them along side the console application executable. Or you could place the DLLs in the System32 directory. Or you could add the directory to the PATH. Well, my point was actually to say that the DLLs can be simply placed alongside the executable and it would be picked up.

Continue reading JAR Tips: Loading dependencies