Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Multi file programming

Name: Anonymous 2016-11-22 4:17

hello

tell me about your experiences with programming projects that use multiple files.

How do you organize code, how do you make sure ecah file is able to see the symbols defined in the other ones? what kindof module systems are you using and what ways are they good or bad? Do you have any visions for a radical change in the way to manage stuff like this?

Name: Anonymous 2016-11-22 6:54

I use the "#pragma once" module system

Name: Anonymous 2016-11-22 7:44

I use the time-tested '1 file = 1line of code' paradigm. I put everything in a single directory in an alphabetic order and then build my project based on this ENTERPRISE build script:
cat * | $COMPILER_OR_INTERPRETER

Name: Anonymous 2016-11-22 8:06

>>1
Hi,

I think it's practically always better to just use single file. But if you ever need to use multiple files, you can just buy a very big monitor that fits them in single screen. So just open an editor for all your files. But you need all files open, or you will eventually forget what's in the files that you can't see. It would be impossible situation for most people to handle.

>>3
You're joking, right?

Name: Anonymous 2016-11-22 8:12

>>4
no, I'm serious. you're just jealous of my build automation

Name: Anonymous 2016-11-22 8:55

I don't like Make or any of that shit. I use a shell script, or sometimes a FIOC script if I need to check for more complex configurations or parameters passed.

Name: Anonymous 2016-11-22 13:52

>>6
It's much easier just have comment at the start of the code file that contains the command to compile&run the file. That way you can just copy/paste that and no need for separate script file.

Name: Anonymous 2016-11-22 13:59

>>6
Why do you need python when sh is Touring complete?

Name: Anonymous 2016-11-22 14:01

>>8
Why does anyone need more than one language?

Name: Anonymous 2016-11-22 14:46

>>8
Because sh is shit. If I need more than just a static sequence of commands to be executed then I want a real scripting language, and I don't want to have to use dumb UNIX commands and pipes everywhere. I not having a space between a variable name and the equal sign and then the equals and the value is ugly. This is rarely the case though.

Name: Anonymous 2016-11-22 15:27

What I can't understand is why no one has made a sane wrapper language the compiles down to sh yet. Even the Javascript Appers managed to do it, it can't be that fucking hard.

Name: Anonymous 2016-11-22 16:20

>>11
I've seen both batsh[0] and bish[1] do it, haven't tried either.

The problem is that every OS and Linux distro wants to do something differently, so either you'd have to let a lot of the ugliness leak into your language or you'd have to support several backends too.

By the time you've started implementing this monstrosity you'll hopefully have realized that you could just use FIOC instead, which is installed on basically everything these days anyway. Either that or you end up with autotools.

[0] http://batsh.org/
[1] https://github.com/tdenniston/bish

Name: Anonymous 2016-11-22 17:50

>>6
Make is ok, it's nice to be able to say recompile only the files that need recompiled in a declarative way. It can get bad if people start to bloat it with autoshit scripts though.

it's true that sh is shit, but python is shit too (although in a more subtle way).

Name: Anonymous 2016-11-22 18:11

>>12
Python is deprecated. You should use Perl.

Don't change these.
Name: Email:
Entire Thread Thread List