RSS Feed
  1. A new way to program “Inventing on Principle”

    March 12, 2012 by brpyne

    Bret Victor, an extremely intelligent and influential engineer, gave an amazing display recently. His biography is nothing less than extraordinary and has been reflected so well in his work. This video is a display of a new approach he’s introducing to programming. The concept is difficult to explain but in essence it’s about allowing engineers a far more interactive way of working on their projects. He applies the principle to software engineering, video game development, electrical engineering and more. It’s convinced me that this new approach will allow us all to become far more creative with our work and open doors never before seen.

    Software engineers are typically great at what they do because they can think like a computer, why should we have to do this so intensely though? Why should any engineer utilize so much of their thinking towards something our computers can do for us? Let’s allow ourselves to focus on what’s truly important… creativity and innovation. My description can’t do it justice but the video does a great job of explaining this.

    Bret Victor’s proven himself to be someone to look to as an icon and his work has the potential to change the way we transform our ideas into reality in a very powerful way. Check out his work and biography at worrydream.com

    Bret Victor – Inventing on Principle from CUSEC on Vimeo.


  2. Great podcast featuring “Uncle Bob”

    December 20, 2011 by brpyne

    Every once in a while I’ll listen to a podcast that really catches my attention. Sometimes to the point where I’ll sit in my car unwilling to go inside until I hear just a little more. Robert Martin, also known as “Uncle Bob”, has been a pioneer in the industry. I found this podcast to be very interesting and a great description of the path to becoming a better programmer.

    Source: http://pragprog.com/podcasts/show/32

    In this episode, your host Miles Forrest interviews Robert Martin, know by many as “Uncle Bob.” Bob has been slinging code for 40 years, and still loves coding. As Bob puts it, “I want to code till I die and I don’t want to die soon.” Bob reveals his thoughts on the craft of programming and hopes for the next computer language, including the solution to the Moore’s Law dilemma that dates back to 1957. He’ll describe the right way to write a framework (hint: don’t _write_ it) and discuss current problems and opportunities with agile development methods. Discover the *Most Horrible Invention* in the last twenty years (and possibly the most popular!) and what Bob thinks about experience, mentorship and science fiction.

     

    I highly recommend listening to this for any aspiring programmers.  With 40 years of experience you won’t find many people more passionate or knowledgeable on the subject. 

    Download Podcast


  3. .NET Questions Every Developer Should Know

    November 30, 2011 by brpyne

    In speaking with various companies in the area I’ve been asked many of the same “filter questions” multiple times. By “filter questions” I mean the questions used to quickly eliminate candidates from their list. Oftentimes the answer is very simple, other times I’ve had a hard time explaining them in an organized way.

    I’ve come to realize that difficulty in explaining an answer these questions in a coherent way may actually represent my lack of knowledge on the subject. As Albert Einstein once said “If you can’t explain it simply, you don’t understand it well enough.”. So here are some of the questions I’ve been asked, accompanied with an answer to help in better understanding the subject.

     

    • Whats the difference between an abstract class and interface? When would you want to use them?
      • Abstract classes are used in defining characteristics of an object type, in other words specifying what an object is.
      • Interfaces are used to define capability and a bond is used to provide that capability. In short it is establishing what the object can do.
    • What’s the difference between a left join and an inner join?
      • An inner join produces only the set of records that match in the two joined tables .
      • A left outer join produces a complete set of records from the first table with matching records from the second. Null entries will be created for non matching records.
    • What’s the difference between view state and session state?
      • Session State contains information that is pertaining to a specific session by a client with the server. It’s a way to track what the user is doing on the site.. across multiple pages…amid the statelessness of the Web. e.g. the contents of a particular user’s shopping cart is session data. Cookies can be used for session state.
      • View State on the other hand is information specific to particular web page. It is stored in a hidden field so that it isn’t visible to the user. It is used to maintain the user’s illusion that the page remembers what he did on it the last time – dont give him a clean page every time he posts back.
    • Explain the difference between overriding and overloading a method.
      • Method overriding is when a child class redefines the same method as a parent class, with the same parameters.
      • Method overloading is defining several methods in the same class that accept different numbers and types of parameters. In this case, the actual method called is decided at compile-time, based on the number and types of arguments.
    • What’s the difference between protected and internal? Can both be used? (“protected internal”)?
      • A protected member is accessible from within the class in which it is declared, and from within any class derived from the class that declared this member. Internal types or members are accessible only within files in the same assembly.
      • Yes, they can both be used. A “procted internal” member will be visible only to classes that derive from the class that declares that member *and* are declared in a file in the same assembly.
    • How do short-circuited operators work?
      • In C#, And (&) and Or (|) operators evaluate both boolean expressions in the statement. However, the && operator only evaluates the first Boolean if false and the || operator only evaluates the first Boolean if true. This technique prevents the execution of the second expression if unnecessary — therefore optimizing your logic.
    • Explain what the StringBuilder class is and why you’d want to use it?
      • StringBuilder is better used with long strings over 256 bytes. They are also better for concatenation.
    • What’s the difference between a static method and a non-static method?
      • The static methods can by accessed directly from the class, while non-static methods have to be accessed from an instance. That is why instatiating needs to be done for instance methods, while for static methods it’s just not needed, and furthermore impractical.
    • What does the “volatile” keyword in C# mean?
      • The volatile keyword indicates that a field can be modified in the program by something such as the operating system, the hardware, or a concurrently executing thread. The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. Using the volatile modifier ensures that one thread retrieves the most up-to-date value written by another thread.
    • Explain what happens when you pass a “ref” or “out” parameter into a method. What’s the difference between those two keywords?
      • Ref tells the compiler that the object is initialized before entering the function
      • Out tells the compiler that the object will be initialized inside the function.So while ref is two-ways, out is out-only.
    • What’s a weak reference? When would you want to use one?
      • A weak reference is a reference that does not keep the referenced object alive. This is especially handy for circular references (where objects keep themselves alive and need extra work by the garbage collector to detect they’re actually both dead instead, for example a an item in a list that also references the list it’s in). In terms of cleanup it is many times faster, and it relinquishes the responsibility of keeping the object alive to another object, meaning that a weak reference does not prevent garbage collection.
    • What’s the difference between a DataTable and a DataReader?
      • DataTables will pull information from a database in one large transfer. With many records this is a bad approach as it will create a large amount of lag.
      • DataReaders will pull all of the same information but it is broken into smaller chunks of data. This can create the appearance of a faster transfer however it places more work on the database.
    • What’s the difference between a value-type and a reference type?
      • There is another difference between structs and classes, and this is also the most important to understand. Structs are value types, while classes are reference types, and the runtime deals with the two in different ways. When a value-type instance is created, a single space in memory is allocated to store the value. Primitive types such as int, float, bool and char are also value types, and work in the same way. When the runtime deals with a value type, it’s dealing directly with its underlying data and this can be very efficient, particularly with primitive types.With reference types, however, an object is created in memory, and then handled through a separate reference—rather like a pointer. Suppose Point is a struct, and Form is a class.
    • What does the “readonly” keyword in C# mean?
      • The readonly keyword does exactly what its name states – it makes a field read only. Well, I guess it doesn’t quite mean just that – because there is one point in the lifespan of an object that a readonly field can be set. That point is during object initialization. And this fact right here is why readonly differs from const – a const field gets determined at compile time, while a readonly field is determined at run time.
    • What is the difference between a Thread and a Process?
      • A process is a collection of threads (at least one) sharing the same resources (virtual memory, security context etc.).A thread is an entity in a process that can actually be executed on the CPU.
    • What is a Windows Service and how does its lifecycle differ from a “standard” EXE?
      • A Windows Service is a program that conforms to the rules of the SCM (Service Control Manager). The main difference is that it does not need a logged on user to activate it.
    • What is the difference between an EXE and a DLL?
      • An EXE is an executable file that contains an entry point (main method) as well as instructions on how to “execute”.
        A DLL on the other hand only contains pieces of functionality that may be used by either an EXE or some other DLL.
    • Explain the difference between strong-typing and weak-typing?
      • Strong-typing means a strict enforcement of type rules with no exceptions. This can help in the prevention of type errors.
        Weak-typing allows well defined exceptions . It is much more developer “friendly”.

profile for brpyne on Stack Exchange, a network of free, community-driven Q&A sites