This is why c# is so cool

Discussion in 'OT Technology' started by mace, Apr 11, 2006.

  1. mace

    mace i don't read

    Joined:
    Jun 6, 2004
    Messages:
    12,567
    Likes Received:
    0
    Location:
    Texas
    I wanted to make an application that when I press the print screen key it would automatically convert and save the image to the desktop.

    One line to do all the converting and saving ftw :bowdown:

    Clipboard.GetImage().Save(Environment.GetEnvironmentVariable("HOMEPATH") + "\\Desktop\\Screenshot.jpg", ImageFormat.Jpeg);
     
  2. vitamin dew

    vitamin dew New Member

    Joined:
    Apr 7, 2006
    Messages:
    20,496
    Likes Received:
    0
    Location:
    Plantation, FL
    Nice lol.
     
  3. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Actually, that's why .NET prepackaged code is so cool. It makes your life simpler, yes, but you have no idea how complicated and inefficient the functions you're calling might be.

    Then again, I program in VB6 90% of the time, so I totally understand the attraction to "managed code". I'm just very suspicious of .NET.
     
  4. Dnepr

    Dnepr Guest

    :werd:

    I personally like just normal C where I write most functions myself when Im in a project.
     
  5. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
  6. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Heh. That's software engineering for ya -- the design's already taken care of, just plug the components together and go. Funny how I am a software engineer, yet when I "stoop" to writing my own code I get just as pissed off about managed code as a lowly CS major.

    Actually, now that I think about it, my CS friends love managed code. It's their professors who object. Hmm...
     
  7. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    Actually... software engineering would be creating a reasonable and elegant architecture using whatever components you choose, and documenting that design and the process of implementation in a way that allows teams to work together to build and maintain whatever you are building and maintaining. Hardly a no-brainer. Using a language that is feature rich for your problem domain sure does make it easier though.
     
  8. MrMan

    MrMan New Member

    Joined:
    Jul 13, 2004
    Messages:
    308
    Likes Received:
    0
    The ASP.NET 2.0 Login Controls are cool too. You pretty much don't have to handle the sessions, login interface, password checking, etc.
     
  9. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Heh. Reasonable and elegant are luxuries in any construction business; proper functionality is always paramount. As for teams working together, that boils down to pure office politics I'm afraid.

    That said, I do so enjoy it when I have the latitude to design a system to work well in addition to correctly, and when the implementation proceeds apace. Managed code usually makes the latter goal easier and the former goal harder, though, because relying on someone else's black boxes often means using workarounds aplenty to get the desired functionality.

    EDIT: I think you may have misunderstood my previous post. What I meant was that for .NET the Microsoft engineers had planned ahead and wrapped up most of the commonly-used functions into neat little packages for the programmers to use. It still causes the problems I mentioned previously.
     
  10. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    I was just explaining the difference between punk-rock programming and software engineering, since you brought it up. Yes, often management has no time for software engineering and punk-rock is the norm. These companies tend to become crippled as time passes and they can't release new products because their products are internally bankrupt.
     
  11. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    As they beat into my head in one SE class after another:

    "The sooner you get the design right, the less money you spend fixing it later."
     
  12. Peyomp

    Peyomp New Member

    Joined:
    Jan 11, 2002
    Messages:
    14,017
    Likes Received:
    0
    My favorite is this, from the 'Mythical Man Month.'

    Rough Quote: 'You always throw one away. You can do it early, or you can do it late.' Build a proof of concept, and then chuck it. Design an architecture, document, and go. If you turn your proof of concept into a product, you will end up doing an enormous re-write.
     
  13. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,206
    Likes Received:
    516
    :rofl:

    That's cute. .NET may be easier to code (scratch that - it's definitely lots easier to code), but like deusexaethera said, you have no idea how messy or inefficient that might be.

    By contrast, I spent an hour the other night writing a function to crop an image to a selection box (for school). It took up an entire page when I printed it out, but it runs like lightning. :o

    It would run even faster if I wrote it ALL from scratch instead of using the wxWidgets library objects (wxBitmap and wxImage), but I'm not THAT hardcore. :rofl:
     

Share This Page