Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
G

Georgi Atanasov

@Georgi Atanasov
About
Posts
13
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Avoid return statement in the middle - horror or not?
    G Georgi Atanasov

    I have a coding rule - avoid "return" somewhere in the middle of a method, try using local variables to compensate instead. Observing this leads to the following (seen in existing code):

    if(flagA)
    {
    if(flagB)
    {
    if(flagC)
    {
    if(PromtUser())
    {
    DoSomething();
    }
    else
    {
    DoOtherThing();
    }
    }
    else
    {
    DoOtherThing();
    }
    }
    else
    {
    DoOtherThing();
    }
    }
    else
    {
    DoOtherThing();
    }

    How I would have written this is:

    if(flagA)
    {
    if(flagB)
    {
    if(flagC)
    {
    if(PromptUser())
    {
    return;
    }
    }
    }
    }

    DoOtherThing();

    I was wondering how you guys feel about it?

    Thanks, Georgi

    The Weird and The Wonderful question

  • The worst code i've ever seen....
    G Georgi Atanasov

    Derek, I am glad that you have noticed the arrogance - it was intentional - take my apologies. I just wanted to show you that it is not good to show such attitude when talking with other people. I got somehow angry to one how says Java is the worst code ever. Think about this - why in your opinion SAP have chosen Java? And do you know that Java world is larger than the .NET one and that there are more billions in the Java market? As I mentioned in an earlier post I code in .NET also but nevertheless Java has its own advantages - it is actually PLATFORM INDEPENDENT, does not have Interop calls in the class library, only in its runtime, etc. I think you miss some of my statements - TILL WPF (things are different there) every Windows Forms Control is a Win32 Handle wrapper, with lots of Interop underneath. OK, about the Value and Reference types - these are the two basic types in .NET. Value types are special objects, which reside on the Stack and are accessed by copying their values (of course you may always pass a value type by ref). Reference (or instance) types on the other hand are objects, which reside on the managed heap, reserved by the CLR, and are accessed by reference. These objects are target of the Garbage Collector. There are other differences which are not in this scope. So, they have NOTHING to do with ICloneable, value types are not ICloneable implementors. This interface is used when an exact copy of a Reference type is required and it is each type's task to implement the "Clone". Thank you for taking the time to talk with me :)

    Thanks, Georgi

    The Weird and The Wonderful java com tools performance

  • The worst code i've ever seen....
    G Georgi Atanasov

    It is obvious that you are not familiar (to be honest your guesses amused me pretty much :)) with Value and Reference types - you may try the following article (the first found one after search). http://www.codeproject.com/KB/dotnet/Primitive_Ref_ValueTypes.aspx[^] If I may advise you - you need read more about the basics of .NET such as Common Language Runtime (CLR), IL, value and reference types, etc. And do not be that arrogant:

    Derek Bartram wrote:

    Uh, ***trying not to sound rude***, how inefficiently do you code?

    . Having in mind that you even dare to compare the performance of native C++ against .NET and after examining some code from your "Famous" Ribbon library I am not completely sure that you are an efficiency master...

    Thanks, Georgi

    modified on Sunday, April 13, 2008 4:52 PM

    The Weird and The Wonderful java com tools performance

  • The worst code i've ever seen....
    G Georgi Atanasov

    Dude, I am not sure you are familiar with value and reference types at all; it has nothing to do with ICloneable... As a GUI developer I may speak of the following advantages of Java Swing over .NET 2.0: Java is completely detached from the underlying OS - .NET is using Interop primarily; 99% of the controls are wrappers of their Win32 equivalents; you need to know Win32 API in order to create commercial controls. Let me mention that things are different in WPF - there is actual bridge which separates OS from the GUI. But still, WPF consumes lot of memory and is not the platform a company, which cares about performance, would choose on... That is my personal opinion of course.

    Thanks, Georgi

    The Weird and The Wonderful java com tools performance

  • The worst code i've ever seen....
    G Georgi Atanasov

    Java has many adnvantages over .NET and disadvantages as well - one of the most problematic (in my opinion) being not supporting value types, everything is object. But, you state that it chews lot of memory and is slow; having seen your latest articles do you have the courage to say that WPF and especially your code runs faster and with less memory than Java Swing GUI for example? P.S. I write in .NET also.

    Thanks, Georgi

    The Weird and The Wonderful java com tools performance

  • Well, no one is insured :)
    G Georgi Atanasov

    I was debugging code I have written two years ago. There was a problem with canceling a command execution. Following is what I have found: CommandCancelEventArgs e = new CommandCancelEventArgs(this); if(e.Cancel) { return; } Obviously the line OnCommandExecuting(e) was missing :)

    Thanks, Georgi

    The Weird and The Wonderful help

  • Form opacity
    G Georgi Atanasov

    Hi, I have the following question: May I have areas with different opacity on a form (I read about the transparency key but it makes the areas completely transparent and need some opacity, not transparency) Because when you specify the opacity for a form - let's say 0.5 (50%) all the controls have the same transparency level. Also I don't want to use API calls like UpdateLayeredWindow, SelecteObject, DeleteObject, GetWindowDC, etc. Thanks in advance, Georgi

    C# json question

  • Problem with the OnKeyDown event...
    G Georgi Atanasov

    Hi, I experienced a strange problem - I am currently building an application that has a user control in it and for this control I want to trap the pressing of the ARROWS keys. BUT... The problem is that only the OnKeyUp event occurs for THOSE KEYS - this is not what I need :(( I tried overriding the ProcessKeyMessage method and found out that the control actually is not RECEIVING the WM_KEYDOWN message for the ARROW keys! Any idea how to solve this problem? Thanks, Georgi

    C# help tutorial question

  • Please, help!!!
    G Georgi Atanasov

    Hi, In my Timesheet aspx page I create dynamically a table with textboxes in it. As it depends on the Date selected the table is created after the page is loaded. My question may be a little stupid, but how can I get the text from those textboxes? I tried responding to a button click but that event is executed after the page loads again( and here is the problem - the textboxes are recreated with empty text ptoperty). I tried with the Session.Add method but failed... Please, I am in a hurry for that project! Any help or idea would be very much appreciated! Thanks, Georgi

    ASP.NET question help

  • Resizing a CFormView class
    G Georgi Atanasov

    Hi everyone! I need to resize all the controls in a CFormView class on WM_SIZE message. I tried to resize each control seperately but it didn't worked. Also tried the code from OnInitialUpdate(): CFormView::OnInitialUpdate(); GetParentFrame()->RecalcLayout(); ResizeParentToFit(); but it does not resizes the controls... Any solutions of the problem? Thanks in advance! Gogou

    C / C++ / MFC help question

  • Should be an easy question.. Splitter
    G Georgi Atanasov

    Sorry, this isn't a solution to your problem:)

    C / C++ / MFC question tutorial

  • Should be an easy question.. Splitter
    G Georgi Atanasov

    try this: CRect rect; GetClientRect(&rect); int x = rect.Width()/2; Then set the width of your pane = x Regards

    C / C++ / MFC question tutorial

  • Formatting string in Edit Box
    G Georgi Atanasov

    Please, help me with that stupid problem... I want to format a string and then display it in an Edit box like that: for(int i=0; i | I have tried the following formatting too: str+= "\n" and it didn't worked too:(( */ } m_wndResult.SetWindowText(str); I would be very grateful to any solutions of the problem! Thanks in advance P.S. May be the problem is in SetWindowText() ????

    C / C++ / MFC help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups