RFC Code Reorganisation

For people working on the C++ code.
Post Reply
sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

RFC Code Reorganisation

by sapier » Post

Hello

No-Half-Measures suggested sorting data for sound and graphics, what about sorting code files too?

A first step would be move all header files to a folder inc parallel to src folder.

I'm not known to all parts of minetest by now but probably it would be possible to divide source files to different folders.

e.g.
server files ->server
client files -> client
common parts ->common

What do you think about it?
DON'T mention coding style!
(c) sapier all rights reserved

No-Half-Measures
Member
Posts: 149
Joined: Tue Jul 26, 2011 00:42
Contact:

by No-Half-Measures » Post

Not sure its Worth it, Images & Sound are different because People can edit Textures & possibly sounds in the near future.

VS Organises into

- External Dependencies
- Source Files


External Dependencies are Irrlicht .h & .cpp files as well as Minetest .h files.
Source Files are Minetest's cpp files.

Whether this is how CMake does it or what I'm not sure though all i can say is that Organising the Source Files isn't really beneficial to anyone.
But organising it in VS Would be Beneficial.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

Several folders would be very nice to make a easy difference between server/client/common... Why not?

No-Half-Measures
Member
Posts: 149
Joined: Tue Jul 26, 2011 00:42
Contact:

by No-Half-Measures » Post

Calinou wrote:Several folders would be very nice to make a easy difference between server/client/common... Why not?

Because VS does not pick up on Fancy Folder Organisation thus making it Pointless, unless of course you don't use VS which then it might possibly be beneficial .

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

Most "good" devlopers that actually like/use open-source hate VS ;)

User avatar
dannydark
Member
Posts: 428
Joined: Fri Aug 12, 2011 21:28
Location: Manchester, UK

by dannydark » Post

See now I'd have to disagree with that, I use VS2010 within my job as well as pretty much every software/game developer I know, the only people I know who program in C/C++ etc and don't use VS is because they can't afford it and/or don't use a windows based system, accept for an ex-work college I know who is just an anti-microsoft guy, but that's his problem haha.

Although saying that It has been something that I have always found annoying from time to time about VS :D but still not a deal breaker.

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

In my opinion relying on features of a specific IDE isn't a good idea. In software development nothing is more subject of change than tools and os.

That an os and it's features isn't a thing you can rely on is already visible within this thread.

I think No-Half-Measures and dannydark do code and play in windows (correct me if I m wrong). I do only use Linux in private, calinou seems to use some sort of open source os too. And as a Mac port exits there are probably some people using MacOs too.

I know VS2010 is a great tool I use it from time to time too. But some of the worst code I've ever read was written by using and relying on great Tools.
If VS2010 can't benefit of a existing well done folder structure this is in my opinion a shortcoming of VS2010, but when I used it this was possible.

And of course minetest seems to be a cross platform project so shouldn't any tool that developent depends on be available to all platforms?
Last edited by sapier on Sat Aug 20, 2011 22:19, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved

No-Half-Measures
Member
Posts: 149
Joined: Tue Jul 26, 2011 00:42
Contact:

by No-Half-Measures » Post

Calinou wrote:Most "good" devlopers that actually like/use open-source hate VS ;)
Errr you know Most BIG Games Developing companies use VS right?
Calinou wrote:Most "good" devlopers
That's Like going your a crap Dev ¬.¬ and i'm insulted

--

@sapier Agreed, Every Developer is Different and their OS effects what tools they use too.
Its not the case VS doesn't read Folder structures, its the case that CMake doesn't read them, I might be wrong though but as far as I can tell that's the case.
I know VS2010 is a great tool I use it from time to time too. But some of the worst code I've ever read was written by using and relying on great Tools.
That's the coders fault not the tools fault, As far as that sentence goes its almost like your blaming the tool for the bad coding which is far from that. Coders don't rely on the tool to write the code for them, they are responsible for the coding they do and if its bad then that's their bad programming not the tools fault.

sapier
Developer
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Post

@No-Half-Measures:
I didn't want to blame the tool for bad code. I wanted to stress out that good tools sometimes make it easy to work with bad code so some developers forget their responsibility to write code not dependent to this tools.

A Simple example is the "Outline" feature of Eclipse showing all functions in one file as a short list, VS has a similar feature too .... You can still handle a file with hundreds of different functions and thousend lines of code if you do have a feature like that. But therefore the code isn't better at all.

There are some huge files in minetest too but thats another issue.


@all please don't insult anyone it won't do any good to the issue discussed here.

In my opinion what tools someone uses isn't at all a usefull criteria to decide how good or bad a developer is. Some very good developers I know do write in simple text editors because of beeing anoyed of switching from one IDE to another on each project they work on.


Let's get back to the issue, would it be a problem for vs or cmake to use subfolders?

Even if it wouldn't be an improovement on VS all developers not using VS would benefit of it.
Last edited by sapier on Sun Aug 21, 2011 12:36, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved

User avatar
dannydark
Member
Posts: 428
Joined: Fri Aug 12, 2011 21:28
Location: Manchester, UK

by dannydark » Post

Well I've just done a test on a few of my projects which I had started in VS05 (which didn't support fancy folder structure as far as I can remember, that or I never bothered organising them) and it seems VS2010 does support it :D

Although saying that my other projects are all in VB, C# and even F# so not tested using a C++ project but don't see why if it works for the others why it won't for C++ :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests