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
A

Andrew Drummond

@Andrew Drummond
About
Posts
8
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Code Neatness
    A Andrew Drummond

    Try looking up Scope and Span in 'Code Complete'. Having a lot of distance between the variable declaration and its last usage technically increases the complexity of the code. It also decreases the readability. Having a large span/scope increases the chances of misuse of a variable, and therefore bugs. Keeping a variables scope down to a mimimum also relates to good practises like information hiding. You were wrong. It may seem more readable to you because that is what you are used to. Try programming with reduced span/scope for a few days, you will soon switch over. regards, Andrew

    The Lounge c++ question

  • C++ or ...
    A Andrew Drummond

    Depends what you are programming as to whether you need it. Ask Corel who tried to rewrite their office suite in Java. Or ask MS why they haven't rewritten Office in C#. Maybe Vista is written in C# - which is why it is so resource hungary?

    The Lounge c++ question csharp learning

  • C++ or ...
    A Andrew Drummond

    I accept your suggestion that you are not an expert yet... First off, I asnswered this question of yours: "Forget learning MFC - there is nothing to learn from it except bad style. Could you please explain this more?" Whereas you may have learned some good things from MFC (I doubt it) I would bet that you have learnt a lot more bad things. If you read "Inside MFC" they suggest that the first version of MFC was a sophisticated framework but they were told that it was too high-level and to come up with something simpler, so that your average programmer could understand it. Personally I can't believe this. "Standard C++ does not have what C# or Java introduce, like Garbage collection, Thread pool, etc." These are easy to introduce via libraries, such as Boost or ones that you write yourself if you have the competance. If you don't have the competance then you can just use languages like C# or Java where they exist, where they are very likely to be implemented in C++ anyway. In addition C++ supports even more modern programming styles, like generic programming, that Java and C# don't and cannot. If you need garbage collection then perhaps you should keep away from C++ until you are a bit more competant. I also can't see what you are disagreeing with. I said that your C++ programming style would benefit from exposure to C# or Java, where OO styles are highly visible. In particular it will drive home the benefits of interface-based programming style. What's to disagree with? The combination of generic programming styles and interface-based styles cover a design space that is much richer than that in Java or C#. I also haven't mentioned the XUnit type frameworks which are much more likely to come across in Java or C#, which might introduce you the benefits of TDD styles. Once you are convinced you can then use the CxxUnit framwork in C++. That's better than going the other way round as CxxUnit is not as easy to set up as, say JUnit. Once exposed to Java or C# you may find that there is no need to go to C++ anyway, which is becoming increasingly likely unless you write performance led software. Learning C++ first and then finding that you don't need it is a bit of waste of time.

    The Lounge c++ question csharp learning

  • C++ or ...
    A Andrew Drummond

    'cos it doesn't exhibit very good design. Classes with massive interfaces including methods factored down to the base when they have no business being there as they only apply to a specialised case. The ATL class however is much more interesting but is only worth looking at if you decide to go the C++ route and are studying generic programming techniques, which are one of the major reasons for going with C++ rather than Java or C#. Even if you end up with C++, going through Java (or C#) is still to be recommended as your C++ style will benefit. I would also going Java rather than C# myself. Programming books written by people with a Unix background, and particular AT&T, tend to show much better style than anything written by people with a Windows background. C# books would tend to come from the latter.

    The Lounge c++ question csharp learning

  • Programming style
    A Andrew Drummond

    the second style is the better in this case. in order to not feel so 'dirty' think of it as a form of pre-condition check - if the language supported pre and post conditions you would do the check there. multiple exit points from within the method are not such a great idea, as Jackson said. The key thing is to keep the complexity of the code down. The early exits for parameter checks accomplish this - exit points in the middle of the method are unlikly to and it might be better to restructure the code and/or create more functionaly cohesive methods. In reply to another email you don't really need to put comments in here as it is pretty obvious what is going on as the checks are so early.

    The Lounge c++ architecture

  • C++ or ...
    A Andrew Drummond

    Forget learning MFC - there is nothing to learn from it except bad style. I would start by learning C from Kernighan & Ritchie. The language is simple with 32 keywords and is quick to learn. As well as several other languages being similar to it, the main advantage will be your gain in understanding of the stack and heap. It has been shown that good programmers have a consistent model of what a computer is doing to their program, whereas dodgy ones don't. Working with this book will help give you that model. The book is marvelously written and should instill you with an enthusiam for programming which you might not get from other texts. The managed languages hid most of this stack and heap usage from you but is very useful to know what is happening a little under the hood, so you can understand why performance problems occur, what the garbage collector is doing, etc. Type in and run the examples from the book and then do the exercises - it won't take long. Then learn something like Java or C# rather than C++. This will help with your design, imersing your in a more OO way of doing things than you would get from starting with C++, which is very powerful but, because it supports nearly all design and programming styles it is easy for you to go off in the wrong way, such as structural programming. Then you can learn C++ if you want more power, such as with generic programming, or even using the scoping style that C++ destuctors allow you. Avoid any book by Herb Schildt. Avoid the Java in a Nutshell books on O'Reilly. I haven't looked at the Petzold C# books but I would be wary based on his programming style from his Windows books. If you are going to learn C++ then Accelerated C++ by Andrew Keonig approaches the matter in a more modern style. You could then profitably read The C++ Object model by Stanley Lippman, assumming that you have read the Kernighan and Ritchie book. www.accu.org has a good book review list as well. regards, Andrew

    The Lounge c++ question csharp learning

  • Which platform?
    A Andrew Drummond

    And MS will have to start rewriting most of its apps. there is no way they will stop hosting native apps, just think how well all of those audio and media apps, like Media Centre, are going to work under the .NET framework.

    The Lounge csharp c++ java dotnet com

  • Refactoring in VS 2005...
    A Andrew Drummond

    yep, it seems to do a good impression of Intellisense in causing my VS SP1 to go very busy for significant periods of time. I tried working outside my clearcase integration but still slow. Shame, might try emailing them about it. Otherwise I use Whoile Tomato for the few refactorings it does. May it conflicts with Whole Tomato? Andrew

    The Lounge
  • Login

  • Don't have an account? Register

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