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
  1. Home
  2. The Lounge
  3. Why is .NET so popular? (Serious Question)

Why is .NET so popular? (Serious Question)

Scheduled Pinned Locked Moved The Lounge
csharphelpquestionc++java
146 Posts 75 Posters 32 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Single Step Debugger

    John Simmons / outlaw programmer wrote:

    Why did the farmer cross the road?

    To milk the bull with bear hands and earn a man points.

    There is only one Ashley Judd and Salma Hayek is her prophet! Advertise here – minimum three posts per day are guaranteed.

    S Offline
    S Offline
    Stefan_Lang
    wrote on last edited by
    #118

    wouldn't that be 'bear paws'? ;P

    1 Reply Last reply
    0
    • B b_dunphy

      I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?

      P Offline
      P Offline
      Patrick Fox
      wrote on last edited by
      #119

      I have noticed that on average the time it takes to develop a Win32 app using .Net is about half of what it is with other technologies. The simple answer is I can get more done faster. In the rare case where .Net performance isn't up to the task, I can write specialized functions in C and put them in a Dll and use P/Invoke to execute them. It is very similar to Java, but Java is built to run on every platform and because of this doesn't perform as well.

      1 Reply Last reply
      0
      • B b_dunphy

        I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?

        G Offline
        G Offline
        Greg Olmstead
        wrote on last edited by
        #120

        Boy, this thread, started to answer a simple question, is starting to look all too familiar. Look. people will always use the language that they like most and/or best suits their situation people will use the languages they know best people will always find ways of telling people that their choice of language/architecture/hair tonic is better than yours and that you are stupid/lazy/bald people will always come to threads like these to vindicate themselves and rationalize the use of their own preferred language, or just to bash the other side. people will always take a side and selectively listen to only the arguments that support their choice, blocking out all the others with ridicule and high-fallutin talk People will always be mac vs. pc (i'm not talking about actually liking one over the other, just the mindset. Red vs. blue, left vs. right, its all the same). It's human nature guys, lets all work together and make the world a better place, rather than split ourselves up and hate each other for what makes us great, our ability to think for ourselves.

        1 Reply Last reply
        0
        • L Lost User

          In languages like C, C++, C#, Java etc you still "have to" know how numbers are represented - ok you might get away with ignoring issues like that, but then your code is likely to suck. Such as this, I never want to see this, if I see this I will tell you in your face that you suck and I will tell your boss to fire you:

          bool IsPowerOf2(int x)
          {
          for (int i = 0; i < 32; i++)
          if ((int)Math.Pow(2, i) == x)
          return true;
          return false;
          }

          And yes, I saw that one in the wild. Suggested replacement: return (x & (x - 1)) == 0; edit: the replacement treats 0 as power of 2, of course, usually not a problem in my experience and easy enough to change.

          E Offline
          E Offline
          Earl Truss
          wrote on last edited by
          #121

          This is only a good replacement if you also leave a comment describing what this does and why it works. I hate "cute" code that you have to think about for a long time to figure out what it is doing.

          1 Reply Last reply
          0
          • A AspDotNetDev

            _beauw_ wrote:

            it will also never present me with one of those head-scratching, out-of-the-blue errors that make it so difficult to work with high-level frameworks

            The language and the framework are two different things. And you can use external code with assembly as well. Heck, you can make use of .Net DLL's using assembly. In which case you'd get that same "Failed set trust point in ssl context" error. The language itself is not really too much of an abstraction, but the amount it helps productivity is huge.

            [Forum Guidelines]

            _ Offline
            _ Offline
            _beauw_
            wrote on last edited by
            #122

            > The language and the framework are two different things. True, but I also think that ends up being a trivial distinction in practice. C# typically implies the .NET Framework, while assembly language typically does not. My comment attempted to make the point that working in a low-level development shop is not as agonizingly slow and difficult as .NET programmers seem to think it is. If nothing else, those .NET programmers spend more time scratching their heads and looking at the "hourglass cursor" than their assembly language counterparts do. Beyond that, Microsoft has done a good job of conflating .NET with its languages. C# is not C; it does not run on a wide variety of hardware, and it does not seem to be used independently of the .NET Framework to any significant degree. Personally, I like .NET because of its development tools. Breakpoints, step-by-step execution, watches, Intellisense, etc. are all easily available right out-of-the-box.

            A G 2 Replies Last reply
            0
            • L l a u r e n

              i consider my reasons for saying such to be based on solid technical grounds you, however, add nothing to the discussion other than a personal attack based upon your undisclosed technical knowledge and unknown political agenda so i think /ignore is a good way to respond to you thanks for playing tho

              "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

              E Offline
              E Offline
              Earl Truss
              wrote on last edited by
              #123

              He's right though ... unless you explain it in terms of your technical objections rather than just a simplistic generalization.

              1 Reply Last reply
              0
              • J Joe Woodbury

                I love writing assembly, just can't find an excuse too. I really do believe assembly should be learned by all CS students very early on. It sheds a whole lot of light on what's really going on with the computer and makes you very jaded about claims of new technology (since you know that it's all just assembly in the end.)

                J Offline
                J Offline
                JasonPSage
                wrote on last edited by
                #124

                EXACTLY!!!!! OMG - My MANTRA! - Edit: LOL (nth degree version): Everything else is BLOAT!

                Know way too many languages... master of none! I'm just another artist navigating the technical shark infested waters trying to find digital serenity!

                1 Reply Last reply
                0
                • B b_dunphy

                  I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?

                  C Offline
                  C Offline
                  Chris Boss
                  wrote on last edited by
                  #125

                  I don't use any dot.net languages. Actually I don't currently write software in any Microsoft languages. My impression though is that the improvements in programming languages is intended to make writing software easier. Writing Windows applications using C (with just the windows API) was just too hard to do so Microsoft came up with MFC (Microsoft Foundation Classes) and Borland has someting called OWL, if I remember correctly. MFC helped, but really didn't make programming the panacea that was hoped for, IMO. Programming languages like Visual Basic (which I have used. Currently have VB 5.0 pro but not used much) made a big difference because of the drag and drop environment, but it often left programmers wanting more. dot.net was suppose to be the next big solution to programming, but personally I was turned off by the huge runtimes required. Fortunately most PC's come with the runtimes today. Is programming easier and better today because of these improvements. Possibly, but I am not so sure yet. I do see the need to build Engines which make programming easier and more powerful though. Actually I have done so myself. I started using PowerBasic about 10 years ago, which was more like writing apps using pure C (just the Windows API), except it was Basic. I had to learn the Windows API from the ground up. My first reaction was, "this is too much work and there has to be a better way". Of course I could have gone the route of Visual Basic and later dot.net's version of VB, but I never liked the bloat in such software, its reliance on COM and COM components. For example I have VB 5.0 Pro and the core runtime doesn't handle any of the common controls. The runtime is 1.4 meg in size, but when you need to use a Listview, Treeview or RichEdit control you had to start adding a bunch of OCX's. Where does it end ? Rather than require a bloated programming tool, I chose to stick with Powerbasic and build my own GUI engine, but with the principles of fast, small size, ease of use and powerful features. One does really need a good programming language add/or addon tools to make things simpler. What started out as an inhouse tool became a commercial product which is now in its 4th generation (and version 5.0 is on the horizon). I don't want to go into details about it since it is a commercial product, but I do think it valuable to compare it to common tools like Visual Basic. Where as VB as a 1.4 meg runtime DLL and then a bunch of OCX's when you need things like the common controls or c

                  H 1 Reply Last reply
                  0
                  • L l a u r e n

                    apologies if i misunderstood you i thought you were saying .NET was a good way to write web apps if you were saying it is better than using c++ then i would probably agree if you are saying it is "a good way" to write them i stick to my original opinion microsoft do not understand the web ... do not appear to want to understand the web ... and keep trying to get proprietary tools adopted (and failing miserably) ... in short they suck at web and should stick to what they do best, which is (i think) desktop apps nd frameworks if i sound jaded maybe it's because i have had to spend a lot of time using IIS and .NET for web and frankly it's crap

                    "mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"

                    J Offline
                    J Offline
                    JasonPSage
                    wrote on last edited by
                    #126

                    I like what you wrote but this bit: "if you were saying it is better than using c++ then i would probably agree" I would just disagree... but... based on my love for closer to the CPU/leaner style of coding. I think Scripts and JIT are "tools" but I think bits pouring through a oscillator that exercises logic on bit patterns being retrieved and stored in ram or device IO push/pull as being viable for speedy systems... Everything else - adds a layer - a layer who may or may not truly be advantageous... each scenarios different... but the lag I see when JIT does its JIT - STINKS! Worst times - Java? I love when Java jocks say they compile their code - all they do is "P" on it[edit:] They only Pre-Compile (P-Code) code to a Tokenized state which does allows for generic dispatch programming at the lowest level but this too is another layer albeit necessary for "p-compile once - run anywhere". This is actually why I think FreePascal is the best thing going because it combines all the benefits of a mature OOP and other paradigm capable language like C/C++; it compiles to pure binary like C/C++, it compiles faster than c++ because it uses a completely different organization of application code and data so ... it's simply easier/faster for the computer to turn source into machine code.

                    Know way too many languages... master of none! I'm just another artist navigating the technical shark infested waters trying to find digital serenity!

                    modified on Friday, December 3, 2010 3:35 AM

                    1 Reply Last reply
                    0
                    • C Chris Boss

                      I don't use any dot.net languages. Actually I don't currently write software in any Microsoft languages. My impression though is that the improvements in programming languages is intended to make writing software easier. Writing Windows applications using C (with just the windows API) was just too hard to do so Microsoft came up with MFC (Microsoft Foundation Classes) and Borland has someting called OWL, if I remember correctly. MFC helped, but really didn't make programming the panacea that was hoped for, IMO. Programming languages like Visual Basic (which I have used. Currently have VB 5.0 pro but not used much) made a big difference because of the drag and drop environment, but it often left programmers wanting more. dot.net was suppose to be the next big solution to programming, but personally I was turned off by the huge runtimes required. Fortunately most PC's come with the runtimes today. Is programming easier and better today because of these improvements. Possibly, but I am not so sure yet. I do see the need to build Engines which make programming easier and more powerful though. Actually I have done so myself. I started using PowerBasic about 10 years ago, which was more like writing apps using pure C (just the Windows API), except it was Basic. I had to learn the Windows API from the ground up. My first reaction was, "this is too much work and there has to be a better way". Of course I could have gone the route of Visual Basic and later dot.net's version of VB, but I never liked the bloat in such software, its reliance on COM and COM components. For example I have VB 5.0 Pro and the core runtime doesn't handle any of the common controls. The runtime is 1.4 meg in size, but when you need to use a Listview, Treeview or RichEdit control you had to start adding a bunch of OCX's. Where does it end ? Rather than require a bloated programming tool, I chose to stick with Powerbasic and build my own GUI engine, but with the principles of fast, small size, ease of use and powerful features. One does really need a good programming language add/or addon tools to make things simpler. What started out as an inhouse tool became a commercial product which is now in its 4th generation (and version 5.0 is on the horizon). I don't want to go into details about it since it is a commercial product, but I do think it valuable to compare it to common tools like Visual Basic. Where as VB as a 1.4 meg runtime DLL and then a bunch of OCX's when you need things like the common controls or c

                      H Offline
                      H Offline
                      Hernan Monserrat
                      wrote on last edited by
                      #127

                      yeah! I used Borland's TurboBasic 1.0 with DOS... old times... I share most of your comments. for me .NET is defined as EEE: Easy to learn Easy to leave Easy to cameback at any time... I don't need it too. But the reason for these is the type of projects that I am involved in the work. Simplex Method: define your objetive function, then hire the specialist to resolve them!.

                      C 1 Reply Last reply
                      0
                      • H Hernan Monserrat

                        yeah! I used Borland's TurboBasic 1.0 with DOS... old times... I share most of your comments. for me .NET is defined as EEE: Easy to learn Easy to leave Easy to cameback at any time... I don't need it too. But the reason for these is the type of projects that I am involved in the work. Simplex Method: define your objetive function, then hire the specialist to resolve them!.

                        C Offline
                        C Offline
                        Chris Boss
                        wrote on last edited by
                        #128

                        Borland sold back the rights to TurboBasic back to its original developer, who in turn renamed it Powerbasic. Powerbasic still has a DOS compiler, plus a Console compiler for Windows and then their lead product Powerbasic for Windows. Powerbasic used to be marketed as an addon to Visual basic back when it was called PowerBasic DLL compiler. That last 4 versions of Powerbasic for Windows are designed for building complete GUI applications and it continues to improve with each new version.

                        1 Reply Last reply
                        0
                        • B b_dunphy

                          I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?

                          W Offline
                          W Offline
                          Westley Cooper Thorn
                          wrote on last edited by
                          #129

                          Serious answer: cheese on toast please. Here are a couple of points.. .net is a powerful standardized environment. .net enforces a standard of programming in itself. It is availible to the masses. Development uses less code so you can get stuff done quicker - this is the advantage of having something on top/runtime. Easy cross-platform developmnent, for me: web , phone, desktop, cloud (Azure) all in c#. If your website is written in .net 2.0 you can, at the click of a button upgrade it to and take advantage of new powerful features that are available using a few lines of code such as AJAX with .net 3.5, Multi-threading with .net 4.0. etc. The system is upgradeable. Everyone knows a .net developer meaning that your code can be supported. ..there are many more, of course: Visual Studio is king to use.

                          1 Reply Last reply
                          0
                          • _ _beauw_

                            > The language and the framework are two different things. True, but I also think that ends up being a trivial distinction in practice. C# typically implies the .NET Framework, while assembly language typically does not. My comment attempted to make the point that working in a low-level development shop is not as agonizingly slow and difficult as .NET programmers seem to think it is. If nothing else, those .NET programmers spend more time scratching their heads and looking at the "hourglass cursor" than their assembly language counterparts do. Beyond that, Microsoft has done a good job of conflating .NET with its languages. C# is not C; it does not run on a wide variety of hardware, and it does not seem to be used independently of the .NET Framework to any significant degree. Personally, I like .NET because of its development tools. Breakpoints, step-by-step execution, watches, Intellisense, etc. are all easily available right out-of-the-box.

                            A Offline
                            A Offline
                            AspDotNetDev
                            wrote on last edited by
                            #130

                            _beauw_ wrote:

                            C# typically implies the .NET Framework

                            That's because .Net is so useful you'd have to be silly not to use it. You can remove all references in a new project and you'd then be using plain C# without the .Net Framework.

                            [Forum Guidelines]

                            1 Reply Last reply
                            0
                            • B b_dunphy

                              I have some limited experience with C# and VS 2008 and I don't understand why the .Net framework is so popular. It is a meta environment running on top of the operating system just like Java and the non-Windows implementations do not have all of the capabilities of the Windows version so it's not truly cross platform. I don't see why -- other than Microsoft's semi-forcing the issue -- someone would choose to use this. Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I can't help thinking of Java or even UCSD P-System Pascal when I look at this. I realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?

                              K Offline
                              K Offline
                              Kenneth Kasajian
                              wrote on last edited by
                              #131

                              It's a good question. Here's the way I see it. 1. First of all, you made some incorrect (albeit minor) assumptions. It is true that code written for Win32 would use the API directly, whereas with .NET, your code calls .NET which in turn calls Win32. It's similar to any other framework with that respect, such as MFC. However, it's not a "runtime". Your code is not running in a runtime the way it does with original Java, or VBA, etc. It's not interpreted. .NET code runs in native code. Next time you're debugging C#, switch to assembly view, and you'll see it's executing op-codes. Java, too, now, and for a long time, goes through to a JIT process to get the same performance. Typically, a compiler has a front end phase, and a back-end phase, even your C++ compiler that generates native code. It has a front-end to create some type of an internal intermediate language, and a back-end that converts that for the target platform. The difference with native code is that both of those steps are done when you compile your code. With .NET languages, the band-end step is deferred to when when code is launched (or installed) on the target platform. One advantage of this is that the same code can target an entirely different platform such as x64 Windows. 2. Why .NET instead of Win32? Why C# instead of C++? Well, Microsoft is surely investing heavily into C# and .NET. They are also into MFC and C++, but not to the same extent. So get the advantage of a more modern and kept-up language and framework. 3. Even highly seasoned programmers still make mistakes C/C++ -- look at all the buffer over-run vulnerabilities in software. Imagine a mediacore programmer using C++. C# makes it slightly harder to shoot yourself in the foot. Although C#, has ways of getting almost the same speed as C++ by using pointers and direct memory access. This is done using "unsafe" blocks, the code in which looks a lot like traditional C. 4. .NET is better for security, with features such as "code access secruity" 5. Languages such a C# are better creating analyizers.. Tools such as PEX, Moles, Resharper, Roundtrip engineering UML tools, LibCheck, ILMerge, FxCop, StyleCop, are just scratching the surface. These types of tools are eaiser to code for C#, so they're more likely available. 6. Reflector -- not sure if this an advantage, but it's certainly cool.

                              ken@kasajian.com / www.kasajian.com

                              1 Reply Last reply
                              0
                              • R Rob Graham

                                b_dunphy wrote:

                                Shouldn't Win32/64 code run just as well, if not better, since there is no runtime between the code and the system? I

                                Shows a bit of ignorance on your part. Unlike java or UCSD Pascal, .Net JITs to native code, optimized for the particular OS and hardware it is running on, so it can in many cases actually be faster than pre-compiled Win32/64 code, since it can take advantage of OS specific and processor specific optimizations. Java and UCSD Pascal compile to p-code which must be then executed by an interpreter.

                                b_dunphy wrote:

                                realize .Net has a large amount of built-in functionality but the same thing could be implemented in native code as well. What am I not seeing here?

                                That most people would rather not have to implement all that functionality themselves? that a large, robust framework really speeds application development be not forcing developers to re-invent the wheel every time?

                                B Offline
                                B Offline
                                b_dunphy
                                wrote on last edited by
                                #132

                                Rob Graham wrote:

                                That most people would rather not have to implement all that functionality themselves? that a large, robust framework really speeds application development be not forcing developers to re-invent the wheel every time?

                                In my original question, I meant to say that Microsoft could have just as easily implemented all of the built-in functionality in native code and provided the same capabilities without needing CIL at all.

                                1 Reply Last reply
                                0
                                • G grgran

                                  DIP switch !!! DIP switch!!!! that's for you little ones just out of diapers Paddle switches are what you need I don't want to get out my bifocals magnifying glass just to move a switch with a toothpick. Real men use big beefy paddle switches for input (directly into memory) in octal, cause hex is for sissies.

                                  G Offline
                                  G Offline
                                  ghle
                                  wrote on last edited by
                                  #133

                                  :thumbsup:

                                  Gary

                                  1 Reply Last reply
                                  0
                                  • L Lost User

                                    In languages like C, C++, C#, Java etc you still "have to" know how numbers are represented - ok you might get away with ignoring issues like that, but then your code is likely to suck. Such as this, I never want to see this, if I see this I will tell you in your face that you suck and I will tell your boss to fire you:

                                    bool IsPowerOf2(int x)
                                    {
                                    for (int i = 0; i < 32; i++)
                                    if ((int)Math.Pow(2, i) == x)
                                    return true;
                                    return false;
                                    }

                                    And yes, I saw that one in the wild. Suggested replacement: return (x & (x - 1)) == 0; edit: the replacement treats 0 as power of 2, of course, usually not a problem in my experience and easy enough to change.

                                    G Offline
                                    G Offline
                                    ghle
                                    wrote on last edited by
                                    #134

                                    harold aptroot wrote:

                                    Suggested replacement: return (x & (x - 1)) == 0;

                                    Um, faster, more clear...

                                    return (x & 0x01) == 0; // Powers of two can't have LSB set, cause that would be an odd number

                                    Or better, why would this need a routine, consuming those wasteful machine instructions and wait states?

                                    if 0 != x & 0x01
                                    {
                                    }

                                    Gary

                                    L 1 Reply Last reply
                                    0
                                    • _ _beauw_

                                      > The language and the framework are two different things. True, but I also think that ends up being a trivial distinction in practice. C# typically implies the .NET Framework, while assembly language typically does not. My comment attempted to make the point that working in a low-level development shop is not as agonizingly slow and difficult as .NET programmers seem to think it is. If nothing else, those .NET programmers spend more time scratching their heads and looking at the "hourglass cursor" than their assembly language counterparts do. Beyond that, Microsoft has done a good job of conflating .NET with its languages. C# is not C; it does not run on a wide variety of hardware, and it does not seem to be used independently of the .NET Framework to any significant degree. Personally, I like .NET because of its development tools. Breakpoints, step-by-step execution, watches, Intellisense, etc. are all easily available right out-of-the-box.

                                      G Offline
                                      G Offline
                                      ghle
                                      wrote on last edited by
                                      #135

                                      _beauw_ wrote:

                                      Personally, I like .NET because of its development tools. Breakpoints, step-by-step execution, watches, Intellisense, etc. are all easily available right out-of-the-box.

                                      I don't understand what is so unique here. I work with a 25-year old KMAN language, has all of above built in except Intellisense. C, C++, Assembly have the same capabilities in their tools. And before you ask, because it's not broke, that's why. :-O It bothers me that every month MS is downloading .NET updates to Windows. And when the update doesn't work, you have to unload all .NET (per MS knowledge base), then start over with a reinstall, followed by all updates to date. That kills productivity for users and support staff.

                                      Gary

                                      _ 1 Reply Last reply
                                      0
                                      • G ghle

                                        harold aptroot wrote:

                                        Suggested replacement: return (x & (x - 1)) == 0;

                                        Um, faster, more clear...

                                        return (x & 0x01) == 0; // Powers of two can't have LSB set, cause that would be an odd number

                                        Or better, why would this need a routine, consuming those wasteful machine instructions and wait states?

                                        if 0 != x & 0x01
                                        {
                                        }

                                        Gary

                                        L Offline
                                        L Offline
                                        Lost User
                                        wrote on last edited by
                                        #136

                                        That is not even correct..

                                        G 1 Reply Last reply
                                        0
                                        • L Luc Pattyn

                                          Rama Krishna Vavilala wrote:

                                          Depends on whom you ask

                                          Indeed. Let's see: 1. My editor: C# 2. My IDE: C# 3. My system tools: C# 4. My cross-compilers: C# 5. My simulators: C# 6. My image processing: C# + native C 7. My automation stuff: C# 8. My chess utilities: C# 9. My model railroad: C (on Mac), to be ported to C# 10. My web site: PHP (unfortunately) 11. My embedded stuff: C I'll use a native DLL when it is the right choice that fits the requirements, however I can't remember when I last did a native EXE. :)

                                          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

                                          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

                                          G Offline
                                          G Offline
                                          ghle
                                          wrote on last edited by
                                          #137

                                          Luc Pattyn wrote:

                                          Indeed. Let's see: 1. My editor: C# 2. My IDE: C# 3. My system tools: C# 4. My cross-compilers: C# 5. My simulators: C# 6. My image processing: C# + native C 7. My automation stuff: C# 8. My chess utilities: C# 9. My model railroad: C (on Mac), to be ported to C# 10. My web site: PHP (unfortunately) 11. My embedded stuff: C

                                          Ah yes, but my compiler compiles your compiler. :)

                                          Gary

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

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