The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Link me a working one, preferably a (free) download? I'm wary about submitting my hard work to an online source.
Try running some of your PHP through the link I posted below. Is it not more easily readable?
I simply don't have the time to reformat my php if I put say for an example put a new if in the function.
.if(blahblahblah) {
...dostuff();
...if(blahblahblah) {
.....dostuff();
.....if(blahblahblah) {
.......dostuff();
.......if(blahblahblah) {
.........dostuff();
.........if(blahblahblah) {
...........dostuff();
...........if(blahblahblah) {
.............dostuff();
...........}
.........}
.......}
.....}
...}
.}
Gets formatted from: -
if (blahblahblah){
...dostuff();
..if (blahblahblah){
.........dostuff();
if (blahblahblah){
...dostuff();
.....if (blahblahblah){
....dostuff();
if (blahblahblah){
..dostuff();
..if (blahblahblah){
dostuff();
.......}
...........}
.}
.....}
}
}
Try running some of your PHP through the link I posted below. Is it not more easily readable?
I simply don't have the time to reformat my php if I put say for an example put a new if in the function.
.if(blahblahblah) {
...dostuff();
...if(blahblahblah) {
.....dostuff();
.....if(blahblahblah) {
.......dostuff();
.......if(blahblahblah) {
.........dostuff();
.........if(blahblahblah) {
...........dostuff();
...........if(blahblahblah) {
.............dostuff();
...........}
.........}
.......}
.....}
...}
.}
> As a result, I use the same format regardless of the size of function
> - same with IF and WHILE statements - always use multiline format.
Yeha, that's exactly what I do.
function run()
{
this++;
that++;
etc--;
}
Never had to do anything with 50+ things to work with though!
> EDIT: I've never understood why people write functions as:
>
> function run() {
> blahblahblah; }
>
> Every tutorial on BASIC, or C I've ever read does it like that, when
> it makes much more sense to keep everything together on one line.
Erm, well think what would happen with a large function.... Many functions can often be in excess of 50 lines - that wouldn't be easy to read on one line!!!
As a result, I use the same format regardless of the size of function - same with IF and WHILE statements - always use multiline format.
function run()
{ this=20; etc++; }
if(something == somethingelse)
{ dothis(); }
while(something > somethingelse)
{ dothat(); something++; }
Quite simple and uncomplicated, just got to establish where your expressions go, function names, parenthesis, etc. Use a tab/line break combo for nested WHILEs or IFs, but I can't write that down properly here.
EDIT: I've never understood why people write functions as:
function run() {
blahblahblah; }
Every tutorial on BASIC, or C I've ever read does it like that, when it makes much more sense to keep everything together on one line.
EDIT #2: Oh, and I always try to declare variables I'll be using as early as possible in the script. For HTML pages I write everything from the top, and format my strings or open and read data files beforehand then echo the variable, instead of putting PHP angles bracketed tags everywhere:
$this = "blah blah blah";
$that = "blur blur blur";
print("
blah blah blah
$this
$that
");
?>
Hope that's some help for you.
Link me a working one, preferably a (free) download? I'm wary about submitting my hard work to an online source.