Programming

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jesse
    Weird Turned Pro
    • May 2003
    • 505

    #16
    Originally posted by 0versight
    There is too many 'tards using their limited knowledge of C releasing programs that are completely stupid and insecure. They releasing 35/40 dollar programs that are fuckin worthless.
    And this makes C different from any other language? Every language has tards releasing useless shit in it. If you really want to ply this faulty argument, apply it to a language like Visual basic.
    "Those who would willingly trade essential liberty for temporary security are deserving of neither." --Benjamin Franklin

    Comment

    • bascule
      omgpwnies!
      • Jul 2003
      • 1946

      #17
      Originally posted by 0versight
      There is too many 'tards using their limited knowledge of C releasing programs that are completely stupid and insecure. They releasing 35/40 dollar programs that are fuckin worthless.
      Is someone (perhaps an employer?) forcing you to use these applications? If not, what is the problem?

      Unfortunately I'm charged with installing and maintaining certain Java programs that we use at my job, and I spend as little time doing that as possible...

      Java is *very* limited, of course, that's how its supposed to be, programmers can release the shittiest code with java, but if it compiles fine, then fuck it, release it and in most cases it won't cause any harm to anyone.
      Java in its current incarnation uses casting rather than generics for general purpose data structures. Consequently, you have absolutely no type safety on any general purpose data structures you utilize in your Java programs.

      Java is not some magic catch-all language which makes bad code miraculously work. If there's some type safety issue with the use of general purpose data structures, the compiler isn't going to catch it... the runtime will, and just as in C your program will crash. The same can be said of buffer overruns or null pointer dereferences (You can call them "null object handle dereferences" if you want to use Java semantics)... these are still programatic errors in Java which will bring down the entire program. Java doesn't have any magic pixie dust it can sprinkle on these problems to simply make them go away.

      As far as type safety in complex programs goes, C++ provides templates, which not only provide the full functionality of Java generics (which will be available whenever Java 1.5 comes out) but also a fully Turing complete macro language. With templates it's possible to implement something as complex as a Fast Fourier Transform without loops or function calls, and have the compiler optimize away redundant expressions at compile time, resulting in up to a 3x performance increase over a standard implementation with loops. Java promises similar performance increases through run-time optimization, but consistently lags behind native code, especially in terms of trig performance. You can see my own benchmarks on the matter at http://fails.org/benchmark.html

      Java may make it harder for bad programmers to write bad programs, but bad code in any language is still bad code and there's still a number of programatic errors a bad programmer can make which will cause the entire program to crash.

      Making it harder for bad programmers to write bad code lowers the threshhold of entry for a computer programmer, and thus the initial outlay for the cost of implementing a given program. Consequently, however, it increases program maintenance cost, as companies must write much smarter programmers to fix and work around bad design and implementation which arises through the use of bad programmers.

      If a poorly implemented Java program works, the Java programmer has no impetus to seek a better implementation. When a poorly written C/C++ program crashes, the programmer is compelled to analyze the failure and learn from his/her mistakes.

      Java is also relatively young compared to C, C++, so sure its easy to tear it apart and bash it while its still in its infancy stages.
      I would have hoped that in the 8 years I've been using Java Sun would have remedied a mistake so egregious as lack of unsigned types, or the lack of generics. If anything, Java 1.5 seems to be largely prompted by .NET, and Microsoft's solutions to all the horrible design errors Sun made with Java.

      Even though I hate Sun now, and don't program much in Java anymore, I think its a great language to start with, because when everyone starts programming they love to release their *first* program, and why release something that you made in C or C++ that could be harmful. I know a beginner to C did not fuckin audit the security of their code because they dont know how to.
      And what would you be developing as a novice programmer which would be useful enough to warrant attention?

      By the time anyone is developing program products in C/C++, I'd hope they're at least smart enough to do unit testing with a memory debugger. With GPL memory debuggers like valgrind available, there's really no excuse for not doing proper testing.

      Java does not negate the need to do proper testing on your programs (otherwise why would JUnit exist?) I suppose you could argue that Java might allow programmers to get away with releasing their programs without doing any testing or debugging whatsoever, and this makes me cringe. There's no excuse for anyone releasing software not to do testing.

      I also think its a good first language because the transition from Java, the language on training wheels, to C++ is not very hard.
      I really hate reading and working with code produced by any C++ programmer with a Java upbringing. While programmers who started with C will tend to underuse object orientation, where it's utilized it's generally done properly, with objects being utilized to manage complex invariants. Java programmers, on the other hand, overuse object orientation to extremes. Here's a hint to all the Java programmers out there... if your invariant fits in a machine word, you probably don't need an object!

      I've seen Java books teach the implementation of linked lists using objects with get/set methods for the data pointer/handle and next node pointer/handle, and further insisting that making these members public is a "Bad Thing" in terms of OOP. Meanwhile no C/C++ programmer in their right mind would/should even consider using data hiding with respect to linked list nodes... the struct/class definition should be safely hidden within that particular module, with the data and next node pointers/handles accessable publicly. It's impossible to abuse the public members of a linked list node because there is no invariant state which can be tainted within a linked list node itself... the invariant state would be maintained by a linked list class. Implementing something like a linked list node with get/set methods only needlessly increases code complexity.

      By the time one knows how to code in Java, they have learned alot of concepts of coding and have other things in grasp.
      Java programmers will have a tenuous grasp of the underlying machine architecture as it is throughly abstracted by the language. They won't know how to manage system resources such as the heap and file descriptor table properly. They will most likely come in to a language like C++ with an overzealous desire to utilize object orientation, and will consequently write needlessly complex and difficult to maintain code. Without an extensive background in resource management, a Java programmer's code is likely to leak all kinds of resources... namely file descriptors and heap allocations. While it's easy to find leaked memory with a memory debugger, it's significantly more difficult to track down leaked file descriptors.

      If you never intend to program in anything but a managed environment, then Java may be an okay language to start with, provided you aren't instantly confused with things like the inability to store primitive types in class library data structures thanks to Java's horrendous lack of boxing, or the inability to manipulate values stored in primitive type wrappers thanks to the poor design of the class library.

      Bottom line, If you ever want to be a good C/C++ programmer, that's what you should start with. If you start with Java and move on to C/C++, you'll waste a lot of time trying to unlearn Java-isms arising from Java's poor design.
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B0
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B1
      [ redacted ]

      Comment

      • Qu|rk
        Member
        • Jan 2004
        • 178

        #18
        Originally posted by bascule
        By the time anyone is developing program products in C/C++, I'd hope they're at least smart enough to do unit testing with a memory debugger. With GPL memory debuggers like valgrind available, there's really no excuse for not doing proper testing.
        If you have a decent job, and can get them to fork over the $$, I'd recommend writing a proposal and layout for cost analysis vs R&D time, and submit it - they will go nuts over the $$ saved, and you can get Rational PurifyPlus, which runs quite nicely on HP-UX, SGI IRIX, *indows, and Linux. I find Purify to be one of, if not the best tool for finding memory corruption and memleaks.


        Quirk-

        Comment

        • Chris
          Great Satan of the East
          • Oct 2001
          • 2866

          #19
          Originally posted by 0versight
          it depends on what architecture and what kind of application/s you are going to most likely create.

          I actually started to post almost this exact same thing a couple of days ago.

          I think this is the best advice in this thread.
          perl -e 'print pack(c5, (41*2), sqrt(7056), (unpack(c,H)-2), oct(115), 10)'

          Comment

          • murakami
            Member
            • Jul 2002
            • 700

            #20
            Originally posted by Chris
            I actually started to post almost this exact same thing a couple of days ago.

            I think this is the best advice in this thread.

            Here's another piece of advice: JUST PICK ONE. It really doesn't matter. Choosing a programming language is not like buying a gadget with a bunch of controls that you learn to manipulate. Programming requires that you do it day-in and day-out to gain proficiency.

            After you can turn out craftsman quality code at a reasonable rate, then you can go and learn another one.

            Comment

            • Mr. Peabody
              Banned
              • Feb 2004
              • 64

              #21
              Wow, I didn't know everyone on these forums knew how to program. I can tell alot of people in here are basing their opinions soley on their own person experiences and prejudices. It's easy to agree / disagree with just about everyone on this matter, since as it's been stated. It all depends on what platforms you are developing on, and how you plan on applying your skills.

              The only reason I even bothered to reply to this topic, is the abundance of disregard for what I think is the most obivious answer, and another language that has been completely disregarded.

              Modula-2 is probably the easiest to learn, and best designed programming language out there today. Anyone new to programming should pick up on this conceptually and syntatically(sp?) simple language that produces very small and clean code. This is a very diverse and flexible language that is suitable for everything from large software projects to real time embedded systems. Their website includes everything you need to get started.

              ADA is another powerful programming language that is majorly overlooked by the inexperienced programmer. It's been called the international language for software engineering, and is used extensively worldwide. This is another language you will find common in real time embedded systems such as cell phone switching, air traffic control, stock transaction systems, NASA space shuttles, and Strategic military embedded systems.

              If all else fails, you can always start with C. Note the distinct lack of the pluses. C++ is not even a true subset of C, and there are many variants of this language that can be stemmed from this predecessor. Personally I think Objective-C is better than C++ anyday of the week.

              Don't limit yourself to the "Microsoft Certified" development tools, we all know how bad Microsoft is at programming. Just my 2 cents. Modula-2 owns.
              Last edited by Mr. Peabody; February 4, 2004, 12:06.

              Comment

              • Qu|rk
                Member
                • Jan 2004
                • 178

                #22
                Originally posted by Mr. Peabody
                ADA This is another language you will find common in real time embedded systems such as cell phone switching, air traffic control, stock transaction systems, NASA space shuttles, and Strategic military embedded systems.
                I would have to agree that ADA is overlooked, but I wouldn't recommend it as a beginner language. No one just starting is going to be playing with strategic military embedded systems(hopefully) and those that are familiar with any strategic military embedded systems know that ADA is combined with a few other things and is not flat out ADA. I felt that statement was a bit misleading, so I felt the need to clarify it.

                Quirk-

                Comment

                • Nicatu
                  Member
                  • Dec 2003
                  • 8

                  #23
                  wow

                  Wow that is a great listing and will help me on the good way for sure

                  i'll start with C++

                  it seems to be arround for so long and i think i better build up from the beginning
                  First i kill u, then...

                  Comment

                  • Webster
                    Local Grue
                    • Feb 2004
                    • 92

                    #24
                    I recommend BASIC and SQL :) than move on to others.
                    blowfish:.2x10x448
                    www.gnivirdrawn.com

                    Comment

                    • CuRoi
                      Member
                      • Jun 2003
                      • 8

                      #25
                      K, so say one has progressed beyond their first language (maybe even had some exposure to several.) What are your thoughts on learning assembly in order to better understand programming as an art?

                      I'd like to eventually become a very proficient programmer. And once learning a language in each of the five paradigms, is asm the next logical step?

                      Comment

                      • murakami
                        Member
                        • Jul 2002
                        • 700

                        #26
                        Originally posted by CuRoi
                        K, so say one has progressed beyond their first language (maybe even had some exposure to several.) What are your thoughts on learning assembly in order to better understand programming as an art?

                        I'd like to eventually become a very proficient programmer. And once learning a language in each of the five paradigms, is asm the next logical step?

                        assembly is a good step, but learning a language is not enough. You should master at least one language.

                        Comment

                        • Mr. Peabody
                          Banned
                          • Feb 2004
                          • 64

                          #27
                          Originally posted by CuRoi
                          K, so say one has progressed beyond their first language (maybe even had some exposure to several.) What are your thoughts on learning assembly in order to better understand programming as an art?

                          I'd like to eventually become a very proficient programmer. And once learning a language in each of the five paradigms, is asm the next logical step?
                          asm is quite an invaluable tool for debugging and your optimizing routines. You will develop an all new appreciation of compilers once you can undersand and compare what they have compiled and how. Coding entirely in asm requires quite a fervor for the language, more often linking crucial routines is the ideal solution.

                          Comment

                          • minik
                            Member
                            • Nov 2003
                            • 3

                            #28
                            I'm still pretty new to C++, but it was the first language I got into. Now that I'm learning a bit of Scheme as well, I'd say learning basic Scheme before going onto C/C++ probably would've been better.

                            E.g., you're forced to keep methods short if possible, making helper methods. Otherwise readability of your code decreases exponentially... all those brackets drive me nuts. Also, since there isn't a built-in looping construct in Scheme, if you learn Scheme you'll definitely learn recursion.

                            Comment

                            • Solid-Acid
                              Member
                              • Feb 2002
                              • 5

                              #29
                              Scheme is a horrible first langague to learn. The practicality of what you can do with it is pretty small. Having taken a semester of scheme programming as part of my degree requirement, I can think of many other languages that help teach the ideal practices of programming while at the same time allowing you to create productive, practical code you could use later in your programming life.
                              We had to write a scheme interperter in scheme, in a lame attempt to learn how compliers work. If I ever have to program in a language where I have to type (damn (parenthesis (after (everything)))) it will be too soon.
                              There is no knowledge that is now power ~ Emerson

                              Comment

                              • bascule
                                omgpwnies!
                                • Jul 2003
                                • 1946

                                #30
                                Originally posted by minik
                                E.g., you're forced to keep methods short if possible, making helper methods. Otherwise readability of your code decreases exponentially... all those brackets drive me nuts. Also, since there isn't a built-in looping construct in Scheme, if you learn Scheme you'll definitely learn recursion.
                                I hope by "short" you mean a few dozen lines, and not... one line...

                                While C++ does let you write inline accessor methods and thus be efficient about it, this isn't how Bjarne Stroustrup intended you to use C++. Objects are state management tools, with the constructor initializing an invariant and various methods manipulating that invariant state. If your invariant is... say... an integer... you're not using C++ properly...
                                45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B0
                                45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B1
                                [ redacted ]

                                Comment

                                Working...