Thursday, June 10, 2010

Wednesday

Wednesday was a very amusing day. I got close to a lot of some very eccentric Microsoft people: The C# and VB language guys. Picture your most amusing computer science professor. Then double his intelligence and give him a British accent. That was what my first talk of the day was like.

Session: Advanced Use of the New Microsoft Visual Basic 2010 Language Features

We started off with a number of "mind benders": Short and confusingly written code snippets on the screen, which generate unexpected outputs. There's not too much to take away from these - it's a primarily academic exercise that you don't have to worry about if you write clear code. But still fun. Peppered throughout were amusing little one-liners that I decided to write down in lieu of the code...

"This is one of the main reasons why I love VB so much: XML Literals!" Not a sentence you hear too often on the street.

"
XML is like violence. If it's not working for you you aren't using enough of it."

"Now I'm going to talk about Nothing for awhile."

Pretty amusing stuff. If you're really interested in what you can do to push the boundaries of .NET 4.0 I recommend you watch the video of this session- at the end of the week I will make a post with them all. The easiest takeaways are:

*Never do this:
If x = Nothing Then 'It just causes problems. Always use is Nothing or IsNothing() instead

*You can write really cool delegates now, right inside other functions.

*Everything sounds more intelligent with a British Accent.

Session: 10 Developer Mistakes that don't scale (SQL Server)

Presenter was someone from Quest. Decent session that, admittedly, mostly went right over my head.

I present to you,what you shouldn't do!

TRIGGERS

You can't uncouple timing, processing
Minimal error handling

SELECT *

Just don't do it.
Hard for indexing.
Think you need every column? What if someone adds more later?

DYNAMIC T-SQL

Be careful regarding spaces/comments/casing ... they all apparently get cached separately

BIG FIELDS

Consider carefully. They will be big fields. Forever and ever.

BINARIES IN THE DATABASE

Just say no.

HEAPS
Fix it...
Implement Primary Key
Look for identity fields
start asking questions about what is unique to business users.

IGNORING INDEXES

Use them!

TEMP DB

USING VERSION 1.0 FEATURES
-Just because it works doesn't mean it will scale. Everything looks amazing and slick with small datasets.

Overall this session was decent. The guy was pretty snarky. He asked if there were any "Heaps Religious Zealots" in the crowd, and then when he found one he insulted the poor guy and wouldn't let him have a discussion. That was bizarre.

Meet the C# Team

Heh heh heh. I will be making a Tech Ed Tips&Tricks post next week, and one of them will be to make sure you go to as many of these kinds of sessions as you can. 4 Super-nerds talking to a room full of other nerds. It sounds awkward but actually it was awesome. The best part was watching their community manager wince, fidget, and look generally terrified when their answers got a little too honest. It was awesome.

Memorable Quotes and Takeaways:

The people who write the language aren't usually the languages power users. "I've never written a winform" said one of the guys, which caused fear to visibly flutter across their community manager's face. Even so, you feel like you are in good hands with these guys. They have solid design goals and are clearly brilliant.

Brilliant... in the theoretical sense. Largely to attempt to score a tshirt but also wondering if I would get anything interesting back, I asked what they thought the strongest selling point of .NET 4.0 was, such that I could help convince decision makers that it was worth the "cost" . One of them actually blurted, confused about my question but genuinely serious, "Well, the language is free!" This pretty much blew me away. To understand so little about the cost of upgrading to anything- free or otherwise- was really incredible. (I got no tshirt & no great answers either. It wasn't a very good question, I'll admit. Wrong people to ask.) By the way. After the conference is over and I have a few days to reflect on it, one of the many post-conference blogposts I will write will be about changes I think Allstate and/or CTS could make.

Someone asked if, now that VB doesn't need _'s, maybe it's time to obsolete C#'s semicolons. "How would you even know it was C#?" joked a team member. The more serious answer is that this really complicates the grammar, and it just doesn't seem worth it. Another team member suggested that if you really wanted this, VS2010 is extensible enough that you could write an auto insert-semicolon 3rd party addon for it.

We talked a lot about dynamic types, which I think I've already written about elsewhere. It's the largest new thing in C#. We talked about the irony that C# handles untyped values THROUGH it's type system, and also the innate hilarity present in the fact that you can write code like this:

dynamic static Foo() { ... } //Look at it for awhile. It's funny :)

Q: Why does VB get XML Literals and C# doesn't? A: Umm. It's hard.

The team got several questions about things they like about the VS2010 IDE. I guess our assumption was that these are crazy coders, and we are also crazy coders, and we want to learn their crazy coding wizardry ways. Apparently though, they don't really use VS2010 to write the compiler. That was the vibe that I got. I'm not sure what they use. Someone in the crowd joked that the compiler is written in Notepad, and the guys didn't exactly deny it. Amusing stuff... In the end they recommended scottcate.com for VS2010 tips; I will definitely be checking it out later.

Using JQuery and AJAX to write dynamic web applications

Talk given by a contractor from another company rather than Microsoft. I'm slowly beginning to recognize this as a possible warning sign.

If I've learned anything at TechEd so far, it's that you can never know what you're getting when you walk into a TechEd session. The best sounding talks can be flops, and bad sounded talks can be amazing. ("The Zen of Architecture", which to me sounded very iffy, is something everyone is discussing in the hallways. I will have to catch the video later.)

This talk, sadly, just didn't deliver on the awesome promise in its name. The guy gave 3 or 4 little tips, and then dove into some odd bleeding edge thing that he and his friend have apparently been developing in the last few weeks. It was truly bizarre. He's writing serverside code in JavaScript, or something, by importing JQuery templates and surrounding his code in {}'s every line. As you can tell I didn't understand it, largely because it was the end of a long day and once it was clear to me that the benefits are few whereas the downsides are MANY, I paid much less attention. All of his demos could easily be written with an update panel plus a few code behind event handlers, so really I didn't understand the selling point behind it, since writing ugly code like this would get me laughed out of my code reviews. Also half his demos didn't work without some coaxing, which demonstrated that you can't even properly debug the stuff. Just a disaster.

There were, however, some interesting tips:

Inside your script manager you can put &lt CompositeScript &gt tags. This apparently speeds things up. I'd need to do a lot more research regarding it since I don't really trust the guy. But it sounded good.

Also for your javascript js files, you can run a tool on them that minimizes them- removing whitespace, changing variable names, compressing them. This makes the page load faster. Sounds very useful if you are developing for a mobile platform or you have large javascript files. CSS files, too.

you can set enablecdn="true" to some of your jquery and other js libraries, and that way they are loaded from google/microsoft/whoeveryouwant rather than your servers. Mainly useful if you have non-north america users, which we don't.

So as you can see this talk was a flop, for me. But overall it was a very fun and amusing day.

2 comments:

  1. "XML is like violence. If it's not working for you you aren't using enough of it."
    That's hilarious. Funniest thing I heard today. I think I'll go somewhere quiet and meditate on this...

    Hmm, database practices that don't scale... such as not having an archival strategy, maybe? For tables that insert millions of rows every day? Sounds awefully familiar, ahem... You should have asked about that, take the heat of the heap guy. What about hints? Did the DB guru have any opinion on that?

    "dynamic static Foo() { ... }"
    That is so zen.

    "Well, the language is free!"
    That's an awesome anecdote to tell at a meeting with any type of project management or QC people. As far as I know, the only reason "decision makers" ever decide to upgrade anything is when they're faced with the fact that Microsoft will stop supporting it, like, tomorrow. So I would say that no, your question was not bad, it sounded like an excellent question to me.

    Keep posting, this is fascinating!
    cheers,
    Kate

    ReplyDelete