Coffeehouse Thread

17 posts

Why I love .NET

Back to Forum: Coffeehouse
  • Klaus Enevoldsen

    A colleague of mine had a problem and came to me. A provider of data had closed the ftp server that he used to download some files from. The files were now only available from a web site and he asked me if it was possible to download it from the web site. He sent me an email with the URL and the credentials needed to logon to the site.

    I started to code the solution in VS2008, the first problem is that the site demanded forms authentication so I sent a post to the page with the data that the form needed to logon. WebException occurred! It turned out that the System.Net.WebClient refuses to connect to a site where the certificate has expired – Google code and 5 minutes later I had the solution. Now I was able to download the web page that contains the links to the different files that was available. I used a regular expression to find the anchors in the html document and I downloaded the latest file.

    It took me about an hour to solve my colleague’s problem and I didn’t know much about System.Net.WebClient when I started out. Microsoft .NET made it so simple to solve this problem quickly – I love .NET!

  • ManipUni

    I hate the way certificates are handled today... They basically put a gun to your head and demand money in order to establish an SSL connection.

    I know, man-in-the-middle attacks! Well sorry but can we not have an encrypted connection without protection against man-in-the-middle attacks? Why is it every other protocol has support for basic SSL encryption without certificate verification except HTTP?

    Internet Explorer's implementation is annoying, WebClient and Firefox's implementations are a pain in the *.

  • blowdart

    ManipUni said:

    I hate the way certificates are handled today... They basically put a gun to your head and demand money in order to establish an SSL connection.

    I know, man-in-the-middle attacks! Well sorry but can we not have an encrypted connection without protection against man-in-the-middle attacks? Why is it every other protocol has support for basic SSL encryption without certificate verification except HTTP?

    Internet Explorer's implementation is annoying, WebClient and Firefox's implementations are a pain in the *.

    You're exaggerating here. Yes you have to buy a certificate if you want the public to connect. But if you're in a corporate environment you can run your own SSL root CA and have it all for free. If you're doing inter-business transfers then the both of you can trust each other's root CAs and away you go.

    It's not a protocol problem either with HTTP, it's how the browsers handle it. You don't have to have validatity check if you don't want to in your own code, as Klaus's experiment shows

  • littleguru

    Oh yeah. I love it too. It helped me accomplishing my tasks so often so fast!

  • joechung

    "I used a regular expression to find the anchors in the [HTML] document." The HTML Agility Pack [CodePlex] is a decent HTML parser though I wish we could leverage the one in Internet Explorer via MSHTML.DLL without jumping through hoops.

  • Ion Todirel

    joechung said:
    "I used a regular expression to find the anchors in the [HTML] document." The HTML Agility Pack [CodePlex] is a decent HTML parser though I wish we could leverage the one in Internet Explorer via MSHTML.DLL without jumping through hoops.
    do you have anything against regular expressions!? common where's the love Big Smile When the task involves more than 4 Substring and IndexOf calls (and other complicated logic of course), Regex all the way down Tongue Out

  • Maddus Mattus

    .Net rules!

    Wooohooooo!!!

    DEVELOPERS DEVELOPERS DEVELOPERS!

    Microsoft has the best developing platform in the world with .Net!

    I need to lay of the coffee,.. Smiley

  • Ion Todirel

    Maddus Mattus said:
    .Net rules!

    Wooohooooo!!!

    DEVELOPERS DEVELOPERS DEVELOPERS!

    Microsoft has the best developing platform in the world with .Net!

    I need to lay of the coffee,.. Smiley
    Coffee is so overrated, Coke ftw! Smiley

  • Maddus Mattus

    Ion Todirel said:
    Maddus Mattus said:
    *snip*
    Coffee is so overrated, Coke ftw! Smiley
    Tried that,..

    Collegues kept looking at me funny with a rolled up twenty euro bill op my nose snorting coke in the middle of the office,...

    But seriously,

    I started looking into WPF a while ago, because me and a collegue of mine are giving a course in it.
    I seriously love how designers can do all their work in XAML and developers can implement the code serparately.
    I love it that the only limitation is your own creativity!

    The tools are awesome, the platform is awesome, the internet resources are awesome.

    Only thing I miss, is a multiline search and replace in Visual Studio. But hey, if that's all,..

    Recently my employer asked me to help him with an Microsoft Access job for an old customer, then you see what you really get with .Net. I spent hours trying to get the most trivial things to work, as with .Net I can do stuff within minutes! I never ever want to go back to VBScript or VB6 development.

    .Net rules!

  • blowdart

    Ion Todirel said:
    joechung said:
    *snip*
    do you have anything against regular expressions!? common where's the love Big Smile When the task involves more than 4 Substring and IndexOf calls (and other complicated logic of course), Regex all the way down Tongue Out
    When you have a problem and think "I know I'll use regular expressions" you now have two problems

  • Klaus Enevoldsen

    Maddus Mattus said:
    .Net rules!

    Wooohooooo!!!

    DEVELOPERS DEVELOPERS DEVELOPERS!

    Microsoft has the best developing platform in the world with .Net!

    I need to lay of the coffee,.. Smiley

    We should team up and create a .NET appreciation day – just like “Talk like a pirate day”…

  • Klaus Enevoldsen

    blowdart said:
    Ion Todirel said:
    *snip*
    When you have a problem and think "I know I'll use regular expressions" you now have two problems
    I know, I usually say the same... I didn't know about the HTML Agility Pack, I will look at it next time I need something like that...

  • Maddus Mattus

    Klaus Enevoldsen said:
    Maddus Mattus said:
    *snip*

    We should team up and create a .NET appreciation day – just like “Talk like a pirate day”…

    Shiver me timbers,...

    I do be aprriciating the .Net today,...

    Anyone who claims the latter, will meet the pointy end of my blade,...

    yarrrr!

  • Ion Todirel

    blowdart said:
    Ion Todirel said:
    *snip*
    When you have a problem and think "I know I'll use regular expressions" you now have two problems
    no you don't, if you forget about the first one Tongue Out


  • Dr Herbie

    blowdart said:
    Ion Todirel said:
    *snip*
    When you have a problem and think "I know I'll use regular expressions" you now have two problems

    My thoughts exactly.  How about Linq to Regex?  Then at least you'd get the compiler to tell you where you inevitable messed up the expression.


    Herbie

  • joechung

    Ion Todirel said:
    joechung said:
    *snip*
    do you have anything against regular expressions!? common where's the love Big Smile When the task involves more than 4 Substring and IndexOf calls (and other complicated logic of course), Regex all the way down Tongue Out

    I have two problems with regular expressions:  (1) they're easy to get wrong and (2) any non-trivial regular expression is write-once, read-never-again. The problem typically compounds:  either you make a simple regular expression that fails on edge cases or you get a complex regular expression that's impossible to decipher.  Or maybe you get the worst of both worlds, a seemingly simple regular expression that's actually impossible to decipher correctly.

    Also, the implementation of regular expressions commonly used these days -- I blame Perl (pcre) -- isn't regular and is horribly slow compared to a proper implementation of regular expressions.

  • evildictait​or

    ManipUni said:

    I hate the way certificates are handled today... They basically put a gun to your head and demand money in order to establish an SSL connection.

    I know, man-in-the-middle attacks! Well sorry but can we not have an encrypted connection without protection against man-in-the-middle attacks? Why is it every other protocol has support for basic SSL encryption without certificate verification except HTTP?

    Internet Explorer's implementation is annoying, WebClient and Firefox's implementations are a pain in the *.

    It's to do with trusted-authorities (TA's). If I see a website www.citigroup.org.uk - is it Citigroup? I trust Citigroup with my banking details, but is it verisign? With no TA authentication then my communication with them is secure, but they might be bad guys in disguise. With a TA, not only is my communication with them secure, but is guarranteed by Verisign (whom most everyone agrees are good-guys).

    You're not paying for the SSL certificate, you're paying for the fact that you can't guarrantee your own identity, you need someone else to be your 'passport-issuer' as it were.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.