Sign in to follow this  
AcidZombie24

what language has least bugs in code?

Recommended Posts

What language help you make the least amount of runtime bugs? Most of my bugs are silly runtime bugs. The last few i remember are forgetting to push something in a stream, grabbed the wrong type of value/going into the child twice (which gave me an empty container) instead of once (which had the test values i wanted). Silly minor things like that. What language (or scripting language) is good for that?

Share this post


Link to post
Share on other sites
Quote:
Original post by AcidZombie24
forgetting to push something in a stream, grabbed the wrong type of value/going into the child twice (which gave me an empty container) instead of once (which had the test values i wanted).


I'm afraid your language choice probably isn't going to help you for those types of mistakes, if you're basically asking for the language to cover for you when you forget to do a stage of processing (pushing something in a stream).

Best thing to do would be to practice programming in the language your already using until you getter better.

Share this post


Link to post
Share on other sites
C# is probably the most programmer friendly language I'd use for gameplay programming. Other than that, it seems that your problem has more to do with code habits/design/bad practices. I code in C++ all day and hardly ever have unexpected runtime errors because I'm programming very defensively, and adding a lot of asserts/bounds checking code to detect runtime errors early on.

Share this post


Link to post
Share on other sites
Programmers for strictly typed functional programming languages such as Haskell or ML have often remarked that when the program compiles, you know it's right -- that is, that things that would be logic errors in other programming languages are compilation errors in these. I've noticed that myself, to a great extent.

Share this post


Link to post
Share on other sites
sometimes I feel as if I want a compiler that would automatically correct annoying little compile time bugs. Then I realise that would turn the compiler into a new version of Word. cue paperclip, "I've notice you've made an syntax error!" did you mean to type "'for(i..' or 'fork(i);'".

sorry, slight tangent there.

Share this post


Link to post
Share on other sites
Sneftel: i am going to check out Haskell.


My original post is more about two things. 1 is i am experience enough that those mistakes are the only ones i make. So which script or programming language should i use? (i use c++ 100% of the time). The other is what language is good for preventing those mistakes in general. 2) Say if i havent programmed for a long time or i am using a foreign library and multiple foreign class. I'd probably make tons of mistakes so what language is good to prevent bugs for a new programmer or a programmer that isnt experienced with the classes?

Share this post


Link to post
Share on other sites
Quote:
Original post by AcidZombie24
My original post is more about two things. 1 is i am experience enough that those mistakes are the only ones i make. So which script or programming language should i use?
Haskell would be worth a look, although unfortunately its performance and memory needs probably make it unsuitable for game development.
Quote:
Say if i havent programmed for a long time or i am using a foreign library and multiple foreign class. I'd probably make tons of mistakes so what language is good to prevent bugs for a new programmer or a programmer that isnt experienced with the classes?
C# and Java are pretty good in this regard. Java moreso: the language is so simple that it's difficult for there to be ambiguity about how the library wants you to play. Also, integrated documentation, at your fingertips in all major Java IDEs, helps out a lot.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sneftel
Quote:
Original post by AcidZombie24
My original post is more about two things. 1 is i am experience enough that those mistakes are the only ones i make. So which script or programming language should i use?
Haskell would be worth a look, although unfortunately its performance and memory needs probably make it unsuitable for game development.

It can be done, but it's not easy nor 'pretty' (the example is named after monads for a reason). As far as I know there are OpenGL bindings available, but I have never used them myself. I'm not sure how experienced you are, but if you have never used Haskell before, unless you limit yourself to text-based games, this probably will make your (programming) life harder rather than easier.

It could be a fun challenge though, and you'd be one of the very few that completed an entire game in the language. :)

Share this post


Link to post
Share on other sites
Integrating Objective Caml as a scripting language has already been done (I think by a member of these forums). It, too, has access to algebraic types which ensure a higher probability of correctness of the code.

The basic idea behind the typical observation that "when it compiles, it works" is that an algebraic type system is superior for finding errors when comparing to a standard "define type, use type" approach: the ability to create new types on the fly when developing, through the use of the algebraic combinators, increases the number of types in the program.

And the more types you have in a program, the higher probability that an expression which has the wrong behavior also has the wrong type.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this