Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Favorite programming language?  (Read 38550 times)

0 Members and 1 Guest are viewing this topic.

Joedude



    Greenhorn
    • Experience: Beginner
    • OS: Windows XP
    Re: Favorite programming language?
    « Reply #60 on: April 30, 2012, 07:12:17 AM »
    MFC C++

    TheWaffle



      Hopeful
    • Thanked: 4
      • Yes
    • Computer: Specs
    • Experience: Beginner
    • OS: Linux variant
    Re: Favorite programming language?
    « Reply #61 on: May 11, 2012, 02:11:51 PM »
    Python

    arrunsay897



      Newbie

      • Experience: Beginner
      • OS: Unknown
      Re: Favorite programming language?
      « Reply #62 on: May 23, 2012, 08:03:44 AM »
      c++ and xml (although xml is not technically a programming language, before anyone else points it out!)

      Max Sulzbacher

      • Guest
      Re: Favorite programming language?
      « Reply #63 on: June 11, 2012, 09:01:34 AM »
      C++ Definitely. Better for hardcore low level programming  :)

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Favorite programming language?
      « Reply #64 on: June 11, 2012, 03:42:06 PM »
      The topic is:
      Quote
      Favorite programming language?
      One could have a favorite without finding what is better. There is always better and the is always favorite. Bit they may not be the same.

      For myself, ushering C++ for low-level programming would e the worst thing ever for me personally. I was a seasoned commercial assembly language programmer and would find the structure of C++ to be stifling.

      But if C++ goes on to become the favorite and the best, it will not be because of any work I ever did.

      Intel at one time, long, long ago, had a PL/M compiler. Now Intel favors C++ for its current products. The PL/M was rather good, but it lost popularity for reasons that are hard to understand.This could lead one to the idea that someday C++ will be considered just too old-fashioned for the new machines yet to appear.

      If I live forever I will become one of the few who remember what assembly language is was.

      BC_Programmer


        Mastermind
      • Typing is no substitute for thinking.
      • Thanked: 1140
        • Yes
        • Yes
        • BC-Programming.com
      • Certifications: List
      • Computer: Specs
      • Experience: Beginner
      • OS: Windows 11
      Re: Favorite programming language?
      « Reply #65 on: June 11, 2012, 04:31:48 PM »
      Assembly is still the only true low-level language. C++ is hardly low-level; when companies write a game in C++, they use OpenGL and DirectX and Boost and who knows what other libraries. They don't write their own 3-D rendering code that directly programs VGA registers to switch to the undocumented higher resolution 256 color modes, and they certainly don't directly program video card registers for the myriad of available architectures.

      With DOS, this was the standard- that is, it was more low level. if you wanted to deal with video, you grabbed a book like Michael Abrash's "Graphics Programming Black book" and learned how to directly program the VGA registers and got to understand how the four bit planes were used. Back then even drawing a Line would require you learn a rather sophisticated algorithm (Bresenham was the standard).

      The change was more because of the switch over to protected mode Operating Systems, and with the increasing networking, it just didn't make sense to trust a program to deal with absolutely every detail of the system. Besides, it got pretty silly, what with all the different programs needing their own special drivers for different graphics cards.

      Now you essentially say "hey, OS, draw a line from here to here, and use this pen information" and the OS delegates that to the driver, which does it. THe driver is low level- they are usually programmed in Assembly or at least C, and they implement things like the Bresenham algorithm with line-balancing as well as a myriad of other things.

      A C++ program draws a circle with OpenGL something like this:
      Code: [Select]
      void Circle( Float x, Float y, Float r)
      {
          glBegin( GL_TRIANGLE_FAN );
              glVertex2f( x, y );
              for( Float i = 0; i <= 2 * PI + 0.1; i += 0.1 )
              {
                  glVertex2f( x + sin( i ) * r, y + cos( i ) * r );
              }
          glEnd();
      }

      The equivalent code in Java:

      Code: [Select]
      void Circle( Float x, Float y, Float r)
      {
      int NUM_ITERATIONS=64;
      GL11.glPushMatrix();
      GL11.glTranslatef(x, y, 0);
      GL11.glScalef(radius, radius, 1);

      GL11.glBegin(GL11.GL_TRIANGLE_FAN);
      GL11.glVertex2f(0, 0);
      for(int i = 0; i <= NUM_ITERATIONS; i++){
          double angle = Math.PI * 2 * i / NUM_ITERATIONS;
          GL11.glVertex2f((float)Math.cos(angle), (float)Math.sin(angle));
      }
      GL11.glEnd();

      GL11.glPopMatrix();
      }

      The C++ version doesn't look any "lower level" to me! Now, on the other hand, if you want to draw a line in Assembly by programming a VGA directly, that's nearly 10 pages of Assembly code. THAT is low-level; setting resetting bit mask registers, setting up pixel masks with in-byte pixel addresses, all that fun stuff.

      Low-level programming is now pretty much confined to embedded systems where, like the 8088, 286, 386, and other early CPUs, optimization made huge impacts on performance. Today, with multiple cores, and all sorts of different instructions, multiple instruction pipes that have rules about what instructions can go in them, as well as a myriad other issues and gotcha's related to instruction branching and pre-fetching, optimization to the level of assembly is no longer something that is a sane practice on modern desktop machines; compilers can produce far better code, or, to be more precise, the amount of time it would take an expert assembly programmer to do better than the compiler is no longer cost effective. Back in the day it might take 2-3 times longer to re-implement a complex algorithm in assembly and then work to eliminate as many jumps and cycle eaters as possible, but the gain would often make the result at least twice as fast. Of course even then the most important thing was to use the right algorithm first; trying to squeeze speed out of bubble-sort using assembly would be pretty stupid. On any modern machine (P2 or newer) I've yet to notice any appreciable difference in speed based on what language a program is written in.

      Embedded systems, on the other hand, which don't have a bajillion megabytes of memory or display adapters that can push out 5 trillion triangles a second or whatever is the norm on desktops today, can and <do> benefit from that sort of tweaking. But they don't get quite as much benefit from C++, unless you take a lot of precautions such not using new/delete, avoiding exceptions, avoiding virtual classes with inheritance (and maybe inheritance altogether) be very careful with templates (or ideally don't use them at all as they bloat the code size, which is pretty important when we're talking about 8K of RAM), etc. with Embedded systems, cycle eaters and knowing exactly what is going to run- which means knowing exactly what will be emitted for any given higher level language is critical. C is pretty easy to "mind translate" into assembly for a learned C programmer; C++ not so much.


      I was trying to dereference Null Pointers before it was cool.

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Favorite programming language?
      « Reply #66 on: June 11, 2012, 05:38:36 PM »
      Thanks for the replay. You can understand why I am not eager to spend a lot of time on C++. When In need something above assembly, I can do it in C or a similar language.
      One option I have used is a Macro Assembler.  The Macro assembler lets you have external files, macros  and libraries and can even hide adjustments that haven to be made to the code.

      One programmer had a habit of putting macros in many different source files and making them public to other files. When he left, two of use worked over his code and put all the macros into one file; We called is ''BigMac'.
      Having huge macro definitions does not blot the output code.

      You might  have a macro for a circle with center point x-y, diameter, thickness and optional color.

      The invocation might be:
      circle 24. 385, small , fine, blue
      (first two numbers are the absolute co-ordinates.)
      and it would call a procedure that would do all that, but the print out of the program list would hide it from you.
      But you had to first create the macro yourself. Once you had it in a file, other programmers could use it. Programmers in a project would have to make a in-house handbook of what macros definitions are available.

      But, as you say, now there is so much more to worry about. With networking, you have to have permissions all that stuff.

      Yes, embedded systems are taking over. I once make a joke about my household garbage can having two IP addresses. Maybe it will someday not be an joke.

      JohnChapman



        Newbie

        • 3Gorillas
      • Experience: Beginner
      • OS: Unknown
      Re: Favorite programming language?
      « Reply #67 on: July 12, 2012, 07:56:36 AM »
      I have used other languages including C++, Java and various dialects of BASIC, but the fact is that C is the best programming language of all time.

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Favorite programming language?
      « Reply #68 on: July 12, 2012, 02:58:10 PM »
      I have used other languages including C++, Java and various dialects of BASIC, but the fact is that C is the best programming language of all time.
      ALL Time?  No, it is not.
      There was a time C was not available for a PC. And when it did become available, it was terrible.
      I was writing  communications programs for PCs back in the late 80s.  Then C was no help and was overpriced and under performing. I wrote routines in assembler. Of course my earlier training was in assembler and PL/M.


      Ryder17z



        Intermediate
      • Thanked: 2
        • Yes
      • Computer: Specs
      • Experience: Experienced
      • OS: Windows 10
      Re: Favorite programming language?
      « Reply #69 on: August 22, 2012, 02:32:35 AM »
      C++
      The cake is a lie...