Just read Joel Spolsy's interview at ACM Queue (through his blog).
I especially liked part 3 where he explains about Evidence Based Scheduling.
For example - why overestimated tasks won't cover for underestimated tasks:
But when you think about software tasks, when things go wrong, they take three or four times longer than expected. If I told you I've got an eight-hour feature, it's about eight hours of work. Now, could it take eight hours? Yes. Could it take six hours? Sure. Could it take two days? Definitely. Could it take a week? Yes, probably with a 10 percent probability because you've discovered some huge problem, and it's a new thing you have to write code for, and you just completely forgot about it and it's going to take you a week.
Now, could it take zero? No, that's impossible. Could it take negative 32 hours? It could never take negative 32 hours. You can go over 32 hours; you just can't go under by 32 hours because that would cause you to go backwards in time.
Well said and written down, I'm going to show that to the next manager who'd insist on a months long schedule, based on hours long tasks.
Today I wanted to subscribe to the feed of Scott McMaster's blog (an excellent one, and a must read for WebForms developers).
Crappily enough, I found no visible feed/rss/whatever link on the page.
Luckily enough I'm using FF2 and I get the tiny feed icon on the address bar, so I could click it. Not lucky to all the poor fellows that still use IE6 and the likes (hey - get a valid copy of windows, or sack the IT guy who is afraid of upgrade, whatever's keeping you in the evil grip of the quircky browser)
So what should you do if you are that poor fellow?
view the page's source (that's "right-click + View Source), and look for a link tag within the <head> that sais
<link rel="alternate" type="application/rss+xml" title="THE SPACE'S TITLE" href="THE FEED LINK" />
now, if you've looked for the exact string written here you're hopeless, and should read a html book / w3schools site before you start 'hacking' html.
Ok, I hope I'm not falling for a fruitless debate here, but after reading Scott's post about the impending death of HTML, and giving my notes on that, I've read his another post, now about "why you should only do windows development".
First of all - his blog is very good and interesting, and it's on my favorite feed reader now. Try and guess which one I use based on what you read here.
Regarding Scott's post, I'd like to mention two noticeable quotes:
It's amazing how much time and energy are put forth by people (yours truly included) trying to make the browser user experience more like what you could achieve with Visual Basic circa 1994, let alone Windows Forms or Swing circa 2007
and
Which begs the question of why folks are producing so many new browser-oriented applications in the first place. But that's another post for another day.
Well, I concur. You should not try to imitate VB apps in DHTML. I can't see a possible for a decent Visual Studio replacement purely in the browser.
However, there are WEB applications, that a light-speed, no-install-needed, runs-on-every-machine-exactly-the-same website (gmail?) would beat any desktop app (Outlook? Thunderbird?) easily enough.
Let's think of another true WEB application. Blogging.
Let's say you were using a blog-engine with no HTML front. you'd assume your readers are running SilverLight/Flash/whatever, or have ClickOnce enabled with the appropriate .NET framework installed, or rather enough user-rights to make it work, or mac? or Java?
So, okay. Let's say you'd go with Flash - EVERYONE RUNS FLASH, right? well, almost everyone. But, come-on, tell all those c#/Java/Ruby guys that the need to switch to ActionScript? (or flex or any other flavour)? good luck with that.
Silverlight? promising, however in early Alpha.
ClickOnce - How many web sites using that do you know of? Even in Intranet environment you get IT people who are not willing to allow it.
Java? well it is on almost any machine today. Silver Bullet? Well, it doesn't take a Ruby developer to avoid Java. you can't get more static-typed than that, plus most java IDEs (but eclipse) suck big-time. I'd really rather use a text editor (even Edit.exe) over the OC4J bundle for example.
But, let's assume that VisualStudio for J2ME is out,(with R# 4), and everyone WANTS to write applets.
So you now have a "blog applet" and all most some of your readers can actually read your blog.
Wait a minute, you want to change the font face font color layout of the blog. How do you do that in Java? and how would you have done it if your blog's layout was dependant on a simple CSS file (the ultimate DSL imho)?
My point is - Web development is web development. It's as widespread as it gets. everyone can easily embed a html rendering engine into an application to make plugin support easy (all those vista/google/yahoo kawagadgets? html within the media players? custom buttons in WindowsLiveWriter), so the HTML/CSS/Javascript stack is: a. Everywhere and b. Easy to customize. Sounds like Web to me.
Think that every 10 year old geek who have wanted to customize his cool myspace facebook whatever page should have learned swing/WinForms/Programming to do that?
In short:
Writing desktop apps using DHTML is stupid
Writing Web apps using java/winforms/etc. is stupid.
No silver bullet, they both have their ups and downs.
Photoshop? Win
Blog/Forum? Web
Any other? Contextual
Oh, and it's Google Reader, if you've had any doubt.
Ok, so I've read Scott McMaster's post where he made some comparison between HTML and Assembly.
My first reaction had been: "Must be another of those HTML frightened guys". I know I have been one in the past.
But then I've read the small debate that evolved around that post, over at Ayende's blog, and I understand Scott's point better (even though I totally disagree, for the reason so beautifully written by Faisel).
Now I'd like to refer to the "Need of abstraction" for all those "I'm scared of HTML" guys.
HTML is easy.
Really.
Ask any 12 year who've read a "Build your webpage" book.
Ask any decent web designer who can hack together flying menus and 3d buttons without knowing the difference between 'for' and 'while'.
Browser compatibility issues? You kid me? w3schools + quircksmode, and thanks to FF+Safari+IE7 it's becoming less of an issue by the day.
Css? that's really a bright idea. Very intuitive and meaningful. The ultimate DSL.
The only 'problem' is Javascript, that wasn't maturing fast enough in terms of a standard library, but thanks to prototype and the likes, and since Steve-Yegge announced that NBL is Javascript 2.0, hopefully the browsers soon would implement some stuff to make Javascript the great language it should be in a standardized way.
Building a html/css combination to comply with a crazy designer's psd is a child's play. Adding an advanced "sort the grid, and do some async web calls" is easier than writing your own Data Access code correctly. I saw a lot more of a bad data access code than bad DHTML code, and since most Data-Access code is private while most DHTML code is wide open in the wild, I must conclude that it must be easier to make a website's UI work than to have connections open-late and close-early.
Remember, I was a web-scared guy for a long time, and Asp.NET 1.0 with it's ViewState and int.TryParse(txtAge.Text, out age) was the entry point to the browser for me. It took a lot for me to understand that I must learn HTTP, HTML and Javascript, and shockingly enough I realized that it's a far simpler model than the so-called "abstraction" of WebForms.
And in the future?
Silverlight/Flex/whatever could have been the future, but it surly ain't the near one. It's a matter of standards. xhtml 1.1, CSS 2, Javascript 1.2, those are standard. The differences between Safari, FF2 and IE7 are minimal nowadays. It would take a lot of time (imho) until most web-sites would run purely on a browser runtime thing. Not to mention that XHTML is cross platform down to almost any device these days. and that the textual nature of XHTML makes it very fast, and supportive of the "Let's index all knowledge over the WWW" thing that some small start-up companies (like Google) are pushing.
That was one of the strangest rants I've ever done.
I'm using VS2005 (with SP1, like duhh) and have had R# 3.0.1
Now, I'm not a fan of the default font and color scheme, as I like better the slicker mono-fonts, like Consolas. I am also becoming a Black-Background type, not for the WouldSaveTheRainForests==true reason (in LCD the light is static no matter what color it shows) but for the implements IDLikeToKeepMyEyeSightForALongTime reason.
So, started with importing a color scheme from some internet-found-place, don't remember where, and then tried to change those Resharper coloring options (like, a variable name that is being used an odd amount of times, by internal classes, however not in an explicit-interface implemented method, that returns a struct), just to find out the the Fonts-And-Colors menu miss those lovely Resharper entries).
Okay, so what should I do? Export the settings, edit the xml, and re-import. Not much fun there.
Hmm. Googled it (I may use the term, as I actually use Google as a search engine), and found a post on jetbrains support site, with the same problem.
no solution though.
However - this is how I solved it eventually:
1. Export the current settings to a file
2. Reset all settings
3. Re-install R# (hey - now it's 3.0.2 !!)
4. Import back my settings.
Regarding my MonoRail/AspView talk from last week, Oren Ellenbogen has compiled a list of "things to remember".
His list (with my notes):
These are my notes about the lecture (as someone who wants to use it in our project at Semingo):
1. DataBind of fields - nice migration from string into classes and vice versa.
2. Need vcompile.exe in order to compile views.
3. Cannot use asp.net controls. Actually we don't need it in our project. (Actually you can use 'em in MonoRail, if you are using the WebFormsViewEngine, but it hurts the simplicity of MonoRail too much)
4. Routing is a must (think about url structure in our project). (RoutingHttpModule will do the job)
5. Learn about the mapping process between controllers, views & parameters.
6. Can use Castle.Validation in order to validate our business objects. (Sweet)
7. Ask Egozi about client side validation .vs. server side validation in MonoRail. (Castle.Component.Validation integrates well into prototype's Real-Easy-Field-Validation, as well as some more js validation libraries)
8. The controller can be injected with outside components (database, services etc) via Windsor, it's integrated easily. (Another sweet spot)
9. TDD is easy (controller and view(should we?)), we can mock everything! Don't forget to call PrepareController method (inside the base class). (Actually PrepareController is Per Controller, so usually it will be called in [SetUp] of each Fixture)
10. FormHelper & DictHelper should make our life easier. (and you can build your own Helpers easily)
11. Controller fills PropertyBag(view use it) & Flash (customer messages) – need to define a property in the view (make it string.Empty as default, if Flash["property_name"] wasn't filled).
12. Use Flash property (dictionary) and RedirectToReferrer method to "refresh" page.
13. Layout["X"] – like master page! (I wouldn't say "like MasterPage" as it's just a simple ol' view, but it gives you a common markup frame for your views, in a similar way of a WebForms' MasterPage)
14. ViewComponent – like a custom control (without the dark magic of asp.net) but contains only UI rendering logic.
15. component:CaptureFor -> we can use it to add javascripts, css files into the html header in the "master page". (dude - It's a Layout, not a MasterPage ;) )
16. We can override the "default" render of the controls via sections in the markup (define sections will override it). (dude - It's a component, not a control;) )
17. Egozi uses prototype (pasha as well?) as ajax framework. For Ajax – call CancelLayout method and RenderView("name_of_view"). This is called SubView and we use it in the markup with <subView:name_of_view />. (Actually I tend to use prototype as a Javascript enhancement, where needed. If only 'ajax' calls are needed, jQuery or YAHOO.connection would be a better lightweight solution)
18. We can use the Cache attribute (MonoRail) over the controller method (aka "Action") in order to avoid cacheability of urls (like Response.Exired = DateTime.Now.AddDays(-1) or something like this). (You can also use Response.Cache as before, the attribute makes our code nicer)
19. We can use Filter for authentication – read about it a little. Each action on the controller will trigger this before running (or after).
20. PropertyBag uses string, eleutian solved it with a smart code generator (pre-build). Create typed Flash and PropertyBag if implementing interfaces. Read about it (ask Egozi for link). (it's in Castle.Tools.CodeGenerator on CastleContrib, and also look at their blog. The tool actually is being used for typing of your site's Controllers, Actions, and Views. As a side effect, they have created DictionaryAdapter than can do the IDictionary<->TypedObject thing. And yuu can also hand-type PropertyBag and Flash.)
Thanks Oren.
Who can guess what's wrong with that code?
public void Disapprove([ARFetch("id", Create = false)]Post post) { if (post != null) { post.IsBlocked = true; post.Update(); } RedirectToReferer(); }
Ignore design, architecture, etc. Is there anything wrong? is it possible that this Action won't do what is supposed to do?
Ok, I'll give you a clue.
"Disapprove" should disapprove a COMMENT, not a POST.
Nasty Copy&Paste bug ;)
It is possible though that your reader might want to update last 20 posts.
Next step - some look'n'feel improvements.
Did an upgrade, did it bad, Syndication is down (no atom feed).
fixing it soon.
Ok. After some delay (couldn't get Internet Connection at my mother in-law's house), here are the links from my MonoRail / AspView talk:
1. The slides (used the newly released StarOffice from Google Apps. Should show ok in Powerpoint)
2. A zip file, containing AspView built against MonoRail from revision 4016 (build no. 472), including a skeleton web project (as shown on my talk), the minimal castle dll's needed to run the skeleton project and links to Castle's build server (to get the full castle libraries) and to my blog.
I'm upgrading the blog now, so it might be a bit quirky for a bit. Please be patient.
Also, if you are a I-comment-on-the-blog-and-tick-remember-me kind of guy, then please check your details next time you comment, and then re-tick the remember-me thing, as there was a bug in the cookie storing method.
I did that MonoRail / AspView talk yesterday at August's IVCUG (that's Israeli Visual C#/++ User Group) at Microsoft offices in Raanana, Israel.
I was a great experience for me, and I thank all of you who came in, asked questions, left some change in my hat (damn, I forgot the hat), and (hopefully) had a great time.
The presentation will be uploaded here soon, so will the demo code, and the promised zip with AspView executables for castle build 472 (revision 4016) + stub web.config. It's just that I need to actually WORK today since the last days was more "prepare to presentation" that "work for a living" kinda days.
So, tune in. It would be by here this weekend.
Meanwhile you can go over aspview source code (there's AspViewTestSite that demonstrate many of MonoRail and AspView features. It's quite old and when I wrote it I was quite a MonoRail newbie, so stuff there are not necessarily best-practice quality, but you can grasp how to use subviews, viewcomponents, viewfilters, etc very easily).
http://svn.castleproject.org:8080/svn/castlecontrib/viewengines/aspview/trunk/
You can also look over my blog engine's sources that I have presented yesterday. It's at:
http://kenegozi-weblog.googlecode.com/svn/
The code shown was from going-ddd branch.
bad name btw, as the model is too simple for DDD, and I also violate it from time to time ... (Repository<Comment> ...)
If you run Windows Live Writer Beta2, and your system's regional settings is not set to en-us, then the spell checker probably won't work.
Quite funny, since you'd probably need that most if you're NOT natively speaking English.
Anyway, it seams that I'm a complete idiot as I haven't noticed a fix that is apparently out there for some time now.
So, if you want your spell checker back, go to that blog post.
Actually, it's not much of a challenge, but it is a catchy title.
Or is it?
Anyway, that's the details:
I'd kindly ask all of you ASP.NET Ajax wiz guys (and gals), to supply me with a simple UpdatePanel thing.
What should it do?
I want to have a webpage, based on this template, that on dropdown change, will go to the server with the selected value in the dropdown, and update the data (table) with some crap, based on the sent value.
You can leave the actual data retrieval to a simple method returning an array of string array, or you can go and implement a CodeSmith/DAAB/Whatever based supercool data access code. I would ignore it anyway. I want the Ajax stuff.
Now, to the why.
I am doing that MonoRail presentation at Microsoft's Israel IVCUG (Israel Visual C(#/++) User Group) next week. I might be showing some demos, and I want to be fare when I show a comparison to WebForms stuff, and not come up with a crappy code and say "ha ha", but show something that one of you, my-dear-readers-who-actually-uses-asp-net-ajax-for-living, wrote, and is considered a good example.
Also, I'm lazy. Seriously. Creating a presentation takes a LOT of time and effort, and I do not have much of the first, and rather avoid much of the later.
So, please do send me that code, to my-first-name at that-blog's-hostname.
thanks.