[Help] When you are programming, does the program run faster Updates to this post /post/217733-when-you-are-programming-does-the Sun, 29 Nov 2009 19:39:04 +0100 Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4490193 [quote spiratec9]it won’t make any difference because the compiler will substitute
the variable in for you.[/quote]
Only if the variable is defined as constant. If it is a changing variable than it couldn’t be replaced by the compiler, it would be constant than.

Marcos & Constants can be used to make the compiler subsitute, however vairables, are variant.

]]>
Ed23454 Sat, 15 Nov 2008 04:06:49 +0100
Reply from spiratec9 /post/217733-when-you-are-programming-does-the#reply-4490173 it won’t make any difference because the compiler will substitute
the variable in for you.

]]>
spiratec9 Sat, 15 Nov 2008 03:57:27 +0100
Reply from M. Wright /post/217733-when-you-are-programming-does-the#reply-4490042 Thanks. Good luck.

]]>
M. Wright Sat, 15 Nov 2008 03:13:39 +0100
Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4490040 Goodluck with whatever it is =D

]]>
Ed23454 Sat, 15 Nov 2008 03:13:18 +0100
Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4490022 okay…. I don’t know those languages.

In C++, (I just looked ‘em up in my C++ Book =D)
they are written

#define var3 37474.343475

so whenever you type var3 it really means 37474.336….

It is prabely simular in those languages

]]>
Ed23454 Sat, 15 Nov 2008 03:10:43 +0100
Reply from M. Wright /post/217733-when-you-are-programming-does-the#reply-4490016 I’m learning Perl, Fortran, and Assembly just to learn about them. I know assembly has macros, but I’m not sure about the others.

]]>
M. Wright Sat, 15 Nov 2008 03:09:17 +0100
Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4490013 yeah…

than when you type out x2 the compiler changes it to the number.

Java and other languages might have them too…. what language is it in?

]]>
Ed23454 Sat, 15 Nov 2008 03:08:26 +0100
Reply from M. Wright /post/217733-when-you-are-programming-does-the#reply-4490009 Macros. I heard about those.

]]>
M. Wright Sat, 15 Nov 2008 03:07:10 +0100
Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4490006 Yeah. If you are programming in C++ you can use a marco, so you can save time typing out.

You write with the other global declarations:

#define x2 = 2743345734.34538

somthing like that….I don’t think the format is right…
But thats only good for C++ anyway.

]]>
Ed23454 Sat, 15 Nov 2008 03:06:41 +0100
Reply from M. Wright /post/217733-when-you-are-programming-does-the#reply-4489996 Somewhere in the future I am planning on writing a large program, and every bit of speed will matter. Right now I will use the variable because it is a long constant and just a small program.

]]>
M. Wright Sat, 15 Nov 2008 03:04:13 +0100
Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4489995 Awsome…lol

]]>
Ed23454 Sat, 15 Nov 2008 03:03:55 +0100
Reply from M. Wright /post/217733-when-you-are-programming-does-the#reply-4489992 That’s what I was thinking.

]]>
M. Wright Sat, 15 Nov 2008 03:03:30 +0100
Reply from Ed23454 /post/217733-when-you-are-programming-does-the#reply-4489987 I’m not completely sure, but I think instance of a constant in its place. This is becuse it dosn’t have to acess the programs alloacted space for random memory storage and withdrawl the variable. Either way, it only makes less than a millisecond diference. It is impossiable to see, in simple programs anyway.

But you can’t really go by me, becuse I am just a beginner programmer in C++, .NET, and Java.

]]>
Ed23454 Sat, 15 Nov 2008 03:02:23 +0100