The online racing simulator
How Big Is Lfs?
(81 posts, started )
How Big Is Lfs?
I have NO idea about programming what so ever...

but i'm interested to know roughly how many lines of code would LFS be?
Scawen has been busy updating code here and there and also added extra code. Just wondering what that actually means in terms of typing at a keyboard?
#2 - amp88
Unless we get a reply from Scawen or anyone else who's contributed parts to the system (has anyone else contributed code?) any answers here will just be educated guesswork. It'll certainly be in the tens of thousands of lines of code, maybe even more. To give you an idea of how quickly code 'grows' (especially when you're making a graphical interface), I wrote a quick interface for a program that performs a similar task to Window Washer's free space washing (i.e. it writes random junk to all the free space on a given hard drive). The interface alone was almost 300 lines of code, and it's nothing complicated at all.

edit: Interesting reply Scawen.

Here's another example for you mrfell. I wrote a little application not long ago that seems pretty simple but is actually composed of quite a bit of code. What it does, put simply, is to look at some paths on your hard drive to get a list of files. Then the user types in some text and it looks through the list of files it found before for matching files. Any matching files it finds it creates a new playlist file and opens that playlist file in a media player. Sounds simple...right? Took me roughly 1400 lines of code and about a week.
I counted recently in an answer to someone. Not lines but... here's what I wrote.

I don't know how many lines of code there are (anyway that would depend how many blank lines I include for readability and lines with just a bracket on them) but here's some hopefully more useful info : the source code is divided into 492 C++ source and header files and these include nearly 6 million characters of text.
ill start on lfs 2
Quote from Scawen :I counted recently in an answer to someone. Not lines but... here's what I wrote.

I don't know how many lines of code there are (anyway that would depend how many blank lines I include for readability and lines with just a bracket on them) but here's some hopefully more useful info : the source code is divided into 492 C++ source and header files and these include nearly 6 million characters of text.

/gulp!
So you have little headings for tyres, ffb, graphics etc....
Jeeze i'm well outta my depth here!!!
O_o
#8 - amp88
Quote from mrfell :So you have little headings for tyres, ffb, graphics etc....
Jeeze i'm well outta my depth here!!!

In object oriented programming (LFS is written in C++, an object oriented language), you create things called "Classes" which are bits of code that all represent one thing or all do operations on one thing. So, you might have a class to represent a car tyre, a barrier, a track etc. In reality things are never as simple as that, but you break things down into little bits then build up the full application using those parts. That playlist creator example I put in my edit above has roughly 10 classes in total.

edit: here's an example class from the playlist creator application. This class represents a file that you would find on your hard drive. This is Java code (Java is another object oriented programming language, similar to C++). Each of the lines which start with "public" are called methods. Methods are how you ask an object what it is, basically. So, if I want to know how big this file is, I call the getLength() method ("public long getLength()").


import java.io.Serializable;

/**
* Represents a FileObject to be serialised to store details of a File
* @author Gus
*
*/

public class FileObject implements Serializable {
private static final long serialVersionUID = -3583986253670672132L;
private long length, lastModified;
private String absolutePath, name;
private boolean isDirectory;

public FileObject() {

}

public FileObject(String name, String absolutePath,
long length, long lastModified, boolean isDirectory) {
this.name = name;
this.absolutePath = absolutePath;
this.length = length;
this.lastModified = lastModified;
this.isDirectory = isDirectory;
}

/**
* @return the absolutePath
*/
public String getAbsolutePath() {
return absolutePath;
}

/**
* @param absolutePath the absolutePath to set
*/
public void setAbsolutePath(String absolutePath) {
this.absolutePath = absolutePath;
}

/**
* @return the isDirectory
*/
public boolean isDirectory() {
return isDirectory;
}

/**
* @param isDirectory the isDirectory to set
*/
public void setDirectory(boolean isDirectory) {
this.isDirectory = isDirectory;
}

/**
* @return the lastModified
*/
public long getLastModified() {
return lastModified;
}

/**
* @param lastModified the lastModified to set
*/
public void setLastModified(long lastModified) {
this.lastModified = lastModified;
}

/**
* @return the length
*/
public long getLength() {
return length;
}

/**
* @param length the length to set
*/
public void setLength(long length) {
this.length = length;
}

/**
* @return the name
*/
public String getName() {
return name;
}

/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}

public void setFileDetails(String name, String absolutePath,
long length, long lastModified, boolean isDirectory) {
this.setName(name);
this.setAbsolutePath(absolutePath);
this.setLength(length);
this.setLastModified(lastModified);
this.setDirectory(isDirectory);
}

public String toString() {
return absolutePath+"\t"+length+"\t"+lastModified;
}
}

Reading what Scawen wrote makes me appreciate the effort that goes into this sim.
#10 - wien
That's really something that sucks about being a programmer. Most people really have no idea how much work goes into the stuff you do. Something that seems easy and trivial to them (because the visible impact is minimal) may be days/weeks/months of work behind the scenes.

<programmer-blues>I deal with this all the time when customers are shocked by the price I give them on what they see as minor changes. Graphics artists on the other hand can easily charge more since their work is immediately visible.</programmer-blues>
LFS is about

|-----------------|


that big
Quote from wien :That's really something that sucks about being a programmer. Most people really have no idea how much work goes into the stuff you do. Something that seems easy and trivial to them (because the visible impact is minimal) may be days/weeks/months of work behind the scenes.

Damn that's right yeah! Sometimes I can explain what I've done in literally one sentence, while it's taken me a week to actually program it! Makes me feel stupid
Quote from Scawen :...the source code is divided into 492 C++ source and header files and these include nearly 6 million characters of text.

6 million characters is around the length of War And Peace Twice.

It also occupies an area of Internet the size of Ireland.
it's over 9000 !!!
Quote from Scawen :the source code is divided into 492 C++ source and header files

Actually, 492 files is surprisingly few, at least by the standards I'm used to working with. Of course when it's a one man show (from a coding perspective) you need to prevent bloat, and remember what all those files are for.

Quote from Scawen :and these include nearly 6 million characters of text.

Although am I reading that right - the entire source of LFS is merely 6MiB?

I'm curious, do you use something like a subversion or cvs repository for the files, to track changes/incremently backup?
wow, wonder how far this thread can go over my head...........
Quote from Bob Smith :Actually, 492 files is surprisingly few, at least by the standards I'm used to working with. Of course when it's a one man show (from a coding perspective) you need to prevent bloat, and remember what all those files are for.


Although am I reading that right - the entire source of LFS is merely 6MiB?

I'm curious, do you use something like a subversion or cvs repository for the files, to track changes/incremently backup?

Yes about 6 MB.

No I just do frequent zips of the code, don't need a source code control system, anyway one didn't come with Visual C++, I only paid £600 or so, would have had to pay £2000 or something for enterprise edition that came with SCCS. Can't remember the exact prices and names but it was something like that.

And yes I spend a lot of time cleaning up the code and restructuring in ways that are near to impossible with multiple programmer programs.
#19 - wien
Quote from Scawen :No I just do frequent zips of the code

Huh. Now that is really surprising. I couldn't imagine writing code without source control anymore, even if I'm the only programmer on the project. I just love the control it gives you over the changes you make. (branching, merging, diffing etc)

You can get Subversion for free as well (sweet, sweet open source). You don't even need a server to use it (though it's perhaps a bit neater that way). It won't integrate with Visual Studio without an extra plugin though, but I find TortoiseSVN does the job nicely from the explorer shell.
Quote from danowat :wow, wonder how far this thread can go over my head...........

I'm there now mate!!!!
how big?
it's ENDLESSSSSSSSSSSS
#22 - Juls
To keep versions of source code for free, I use Tortoise SVN (not CVS as I wrote). No need for a special tool working with visual C++.

It integrates directly in windows browser. Just commit the changes from time to time and all versions are saved in repository. It makes life a lot easier and you can quickly commit some sources before tweaking the code without having to do some archive and name it
Quote from Juls :To keep versions of source code for free, I use Tortoise SVN (not CVS as I wrote). No need for a special tool working with visual C++.

It integrates directly in windows browser. Just commit the changes from time to time and all versions are saved in repository. It makes life a lot easier and you can quickly commit some sources before tweaking the code without having to do some archive and name it

As a non programmer, I have absolutely NO idea what you've just said!!
#24 - wien
Ok, i must admit, i know pretty much nothing about coding on computers, all this C++ stuff, i know... nothing about, i am anything but knowledgable.

But when i think to myself, 6Mb, of characters? i mean, if i had to type that many characters... any characters in any order, it would take me months on end, and i would get finger cramps, and my eyes would hurt from looking at the screen.

But i must say its payed off! this has to be the best racing simulator i have ever played I must say, im glad i brought your game, i've gotten 3 years out of it and im still not bored! thanks for your hard work

How Big Is Lfs?
(81 posts, started )
FGED GREDG RDFGDR GSFDG