Digiguru.co.uk

Random musings

Starting out with Swift

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 about Starting out with Swift (2 minutes)

Becoming a polyglot programmer

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 about Becoming a polyglot programmer (1 minute)

ASP Repeater helper to output class names on every Nth item

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 about ASP Repeater helper to output class names on every Nth item (1 minute)

How I like to format SQL

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 about How I like to format SQL (1 minute)

Release w:4083d4b · p:fe7d381 · details