Digiguru.co.uk

Random musings

    Starting out with Swift

    04 Jun 2014

    Apple had the unusual WWDC announcement this week, and definitely came out with something I wasn’t expecting. A new programming language called swift.

    Chris Lattner (@clattner_llvm) creator of the language a head of development tools at apple seems to have come up with the philosophy behind the language. On his personal site he gives a nod to Bret Victor (@worrydream) one of the best thinkers on the internet who I have ever had the pleasure of reading is amazing interactive essays on rich IDEs.
    read more (2 minutes)

    Becoming a polyglot programmer

    08 May 2014

    Recently i’ve been sprinting preparing a very exciting new venture that has force me to write code in languages I had little experience in before. The amazing thing I have learnt is that it’s fairly striaghtforward to transfer skills from other languages fairly seemlessly once you’ve invested time in. The fundamental thing I have realised is good code architecture is universal.

    What I like to bring to code is simplification, atomicity and structured design. Consider the following java code…
    read more (1 minute)

    ASP Repeater helper to output class names on every Nth item

    06 Feb 2014

    I came across a need to output a “clear” class to every 5th item in an asp:repeater. Here’s an over-simplified example of the code that was written.

    <ul>
    <asp:Repeater runat='server'>
        <ItemTemplate>
            <li class='<%# If((Container.DataItemIndex + 1 Mod 5).Equals(0), "clear", "") %>'>
                <%# Container.DataItem.Title %>
            </li>
        </ItemTemplate>
    </asp:Repeater>
    </ul>

    I say we could to better.
    read more (1 minute)

    Introduction to generators - ECMA script 6 Harmony

    04 Feb 2014

    I was just trying out the new formatting styles available in javascript, I was pretty stunned by the way the new Yeild iterator works.

    A very simple yeild in javascript

    var yeildingFunction = function*() {
        yield "fred";
        yield "bob";
        return "sue";
    },
        i = yeildingFunction();
    console.log(i.next());
    console.log(i.next());
    console.log(i.next());

    read more (1 minute)

    How I like to format SQL

    30 Sep 2013

    I’ve seem lots of SQL coding styles over my time. Here are three most common formatting options.

    ANSI 89 Equals Syntax

        Select *
        From customers,
            invoice,
            invoice_item,
        Where customers.id = invoice.customerid
        And invoice.id = invoice_item.invoiceid
        And invoice.isPaid = false

    I hate seeing this written.
    read more (1 minute)