Still hardly any games, why entity systems suck, and why 4k is good

Do tell, I’m always interested in peoples paths to their current software philosophy. Mine is born out of working at two companies at either extreme.

Company A:
Writing firmware for routers/switches, the code base was gargantuan written in C and had evolved over time and pretty much no API’s at all, every variable was just extern’ed and used wherever it was needed. It was an unbelievable rats nest of dependency hell. It basically became impossible to change anything without breaking something else. Fixing a bug meant you were pretty much guaranteed to introduce a bug somewhere else. The management solution to this problem was more code reviews, it would take me a week to introduce a line of code. I lasted there for 6 months.

Company B:
Web based applications for managing people/processes. The code base was also gargantuan, written in Java and ridiculously over-engineered. There were more interfaces than classes and roughly only 10% of the code actually did anything. Fixing a bug was a nightmare as you had to drill down through layers upon layers of abstraction to find the code you were after. The company was all about frameworks and design patterns. It is here I grew to hate the phrase “business logic”, also lasted 6 months.

More of a pain than just highlighting it w/ “mark occurrences” toggled on, imo. If you have to do this for every field when coming back to some old code, ugh. But clearly, it works for you - it just wouldn’t for me.

I think blaming access modifiers for wasted time is a stretch. They’re just a tool - useful sometimes, not useful other times. Also a matter of style and taste. I don’t buy that when someone spends too much time deciding which ones to use, it’s the access modifiers’ fault. That problem is between the chair and the computer :slight_smile:

We have those both in same company. There is c side and java side and both do something about database thingy but I am not yet sure what and how. Even if I have been in company over six months.

@ShannonSmith - since you asked here is an out of date base CV (which is largely factual unlike most CVs I have to read through). It’s out of date now as I don’t need one any more, and this one is the base CV, not tailored to any particular job application. The phone number is deliberately incorrect as I don’t want a job ever again :wink:

Cas :slight_smile:

I think one of the mistakes of OO was that it taught that this:

class Point {
    private int x;
    private int y;

    public Point(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() { return x; }
    public void setX(int x) { this.x = x; }

    public int getY() { return y; }
    public void setY(int y) { this.y = y; }
}

was somehow superior to this because it used data-hiding and encapsulation!!!


struct Point {
    int x;
    int y;
}

If you using Points as mutable data structures then really one hasn’t encapsulated anything by using a class. There is still the same dependencies on anything that uses it. These days I’m leaning towards keeping my data in raw form e.g. arrays, maps, basic types and writing functions to transmute it.

I still think global variables suck though because the singleton pattern, while it sounds cool and makes the speaker seem erudite, actually should be an anti-pattern because it sucks and most of the time you don’t even need it.

Ever tried to develope a map maker in 3 weeks? Sure singleton are helpful… more then you think I guess. and what are globals variables for you? Let’s say you have an entity with a postion… ist the postion field bad because it’s declared global (and public of course, can’t understand people who make getters… useless wank of OO imho^^)

There’s a big difference between a singleton (global) and an instantiated entity with a position that has public access.

The theory is that a subclass can override the getters and setters to use a different data structure for storage, or that it could implement an interface like Tuple2D so you could treat a Point2D and a Vector2D differently when you want, and uniformly when you want.

But if you don’t need any of that, then there’s no shame in designing a class for a specific purpose. I personally think getters and setters are a good thing, but Java is horrific at hiding that kind of boilerplate or providing nice syntax for it (both things my pet language has no problem with).

That’s quite a CV, and after all that you think that access modifiers are a bad idea? After 10 years and many different languages I’ve come full circle on a few things and have spent some time considering what I would put in an ideal language but I’ve never considered not having access modifiers. One thing I do agree with you on his how much I hate programming and how unfortunately necessary it is for writing games.

And that CV omits 13 years of non-commercial experience beforehand and the last couple of years too.

What it boiled down to was this: which features have actually ever made my life easier or harder, or got more or less done with? And access modifiers have sadly only ever made my life harder - on many occasions when I’ve been trying to use other people’s code and they’ve not foreseen some situation or other which requires tinkering - or less productive, as I’ve sat there and wrangled with designs to try and “encapsulate” stuff so that those poor diddums kiddy programmers who came after me wouldn’t accidentally blow their own heads off by writing the wrong bit of code or doing it in a way Benevolent But Menacing Caspian did not approve of. Or likely think of at the time. In short - just a huge waste of time and effort to patronise my fellow developers.

I could of course be totally wrong but as I’ve noticed, languages that lack these features don’t seem to suffer productivity problems, and therefore neither can they suffer maintainability problems. Maintenance is irrelevant if productivity is so high as to make it as cheap to rewrite as it is to try buggering around in someone else’s mindset. This is the reality of software development today.

Cas :slight_smile:

Pew~ I always thought I had to squeze my head into all that software engineering to get a job or at least have the chanve to do real programming but your CV shows that can also try the road of being a “target-programmer”. Nice to know :slight_smile:

(Also, I never knew you are the creator of LWJGL)

Unfortunately when such features are in the language you will be expected to use them as everyone else will be, so you’re still going to have to! Unless you get a job in one of these silicon valley startups where they do things in crazy disruptive ways.

I had a hand in the original LWJGL but sadly not been too involved in it for the last few years. Too busy using it!

Cas :slight_smile:

Since we’re on the subject, and just out of curiosity Cas, what’s your opinion on checked exceptions?

Weighing carefully on the 3 main implementations of exceptions that I know of (none at all, Java style, and C# style)… I’d say that checked exceptions are, on balance, not a great help. Yeah I know, heresy, etc. but the only real problem they solve is that you no longer have to co-opt special values from return codes to mean special things. The other problems that they allegedly solve I see routinely defeated by everyday programmers, and thus their effectiveness tends towards zero. Another evolutionary dead end.

C# on the other hand acknowledges that there is no real need to bully programmers into checking exceptions. All exceptions are safely propagated up the stack and end up either killing a thread (with a lovely stacktrace output to system.err) or eventually caught and dealt with somehow anyway. So I’d say the C# design is probably the most useful.

Cas :slight_smile:

Checked exception are dumb. Exceptions are not so dumb on their own. But with check exceptions you end up with nested try/catch blocks because dealing with an exception throws more checked exceptions.

Also i hate that i can not easily just check for EOF. Since its an exception, that is the way to find it (or a null line on BufferedReaders). Ok so i am almost ranting about imperfect APIs rather than lang features.

Also i am wasting time arguing the virtues of different coding styles rather than coding! :-\

[quote=“delt0r,post:195,topic:37519”]
As a general rule, either you use BufferedReader and get a null line or you use InputStream.read(byte[], int, int) and check for a return value of -1. I never catch EOFExceptions.

Cas, I think you put it about as well as I could have. I like the idea of checked exceptions, but I think not catching them should have been a warning, not an error. Possibly coupled with a command line flag that can promote specific warnings into errors. Theoretically they make sense, since the nonlocal return path of a method should be part of its signature that you must account for … but even as much as I love theory, this is one that just didn’t pan out in practice. For all its embrace of theory, Scala gave up on checked exceptions entirely.

Yeah… I’m not really into checked exceptions especially for any performance bound code, but handle unchecked exceptions intelligently from the clocking threads (potentially end the clocked runtime item silently, w/ a warning, log it, or if it is marked as a fatal error stop entirely) and via a default uncaught exception handler as to not crash the runtime, but provide some sort of reasonable response to the user, logging, or possible recovery if applicable. Any custom exceptions that are thrown in my efforts are all unchecked / runtime oriented.

As you say Sproingie if checked exceptions created a warning instead of an error if not handled I suppose there could also be an annotation that promoted it to an error state or could provide an IDE the ability to mark it visually instead of just a runtime JVM flag.

+1 to that. Something in-between Exception and RuntimeException, possibly. There’s a benefit to having to declare them in method signatures.

:o WHAT? There’s something Scala doesn’t have??? ;D

Scala doesn’t have break or continue either (well it kinda has break now). It also doesn’t have “static”, it has companion objects. It doesn’t have void, it has Unit which is an actual value. Sometimes improvement is a matter of taking things away.