Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Which programming language did you choose and why?

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,430
Location
down under
Codex+ Now Streaming!
Impossible to inculcate them all many of them now have the 10 years of experience that many assume qualifies them to take senior positions.
Yeah, that's insane. Now after almost 20 years of coding professionally plus another 10-12 years of hobby coding before that, I think I'm worthy of the title "senior dev" and *now* I think I'm getting pretty good. Not "the best", but pretty good. And to quote the classic saying, the more I learn, the more I realise that there are are vast areas of computing/programming/math/etc. I know very little about.

Compare this to guys with some inflated sense of confidence who are considered to be mid-level after 2-3 years, senior after 5-6, and all they've ever used is NodeJS. First time they encounter some concurrency problem, they don't even know what hit them.

This reminds me of a story when I talked to some senior C++ dev guy at some trade show at the uni, looking for jobs before graduating.

Senior dev: Okay, so in your CV you're saying you're a "C++ expert". Don't you want to tone that down a bit? Because we can certainly ask expert level questions in the interview if you don't want to get hired...
Me: Hmm, sure, I'll fix that. Also, beside C/C++ I have lots of experience in PHP. Should I mention that too?
Senior dev: Only if you don't want to get hired...

Programmers only seem to get better when they are in mixed ability groups where the less experienced can pickup skills and get direction on what to study. It almost seems like a medieval guild/apprenticeship system would be the thing.
I 100% agree with that. I have learned a lot (and I'm still learning) from other good devs I've worked together with. It could be not just technical things, but how to break down problems, minimise risk, manage superiors, approach things logically, etc.
 

Azdul

Magister
Joined
Nov 3, 2011
Messages
3,329
Location
Langley, Virginia
So 1% increase in Facebook performance or any performance gain can still be achieved quite easily by improved hardware, and doesn't need to rely on high speed programming languages.
Both Facebook and Google use the same strategy: They don't care about latest and greatest expensive CPUs with increased base and boost clocks. When you take into account power usage, cooling requirements and lifetime of chip - the most cost-effective strategy is often to underclock the CPU from what Intel or AMD had intended.

At the time both companies already built their hardware infrastructure. Huge halls with rows and rows of (very underwhelming) x86 PCs of known power consumption, known cooling requirements and known performance.

They don't 'upgrade' hardware - they just add new data centers in new geographic locations. Sure - in a decade or two - if the company still exists - oldest data center may get retired. But Facebook and Google engineers cannot really rely on hardware getting better each year.
 

Burning Bridges

Enviado de meu SM-G3502T usando Tapatalk
Joined
Apr 21, 2006
Messages
27,562
Location
Tampon Bay
I think you cannot stress the psychological aspect enough.

People are not motivated to do their work if you give them blunt tools. Likewise, users will be less productive if they have to put up with shit that makes them wait all the time.

I try to always make sure the following

a) UI needs to look clean and have a good rendering engine - my users have to look at it all day
b) simple data driven architecture - my users want to have control
c) responsive as fuck - every second spent with needless waiting adds up to months or years of my users life

*as soon as you notice a delay between clicking and execution there must have a good reason. In that case show a progress bar that looks fast and people are happy with that too

Ironically, if an algorithm takes 10 minutes or even hours performance is actually much less critical to us. Because you can give the users additional computers for crunching algorithms or let shit run overnight. But many unnnecessary micro delays on things you do hundreds or thousands of times every day are inacceptable. Many professional software has gone into that trap lately. eg even the latest Visual Studio sucks in those terms - reason is that they are programmed with the same crap they are supposed to produce
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,430
Location
down under
Codex+ Now Streaming!
People are not motivated to do their work if you give them blunt tools. Likewise, users will be less productive if they have to put up with shit that makes them wait all the time
This a thousand times. Talking about psychological aspects, there's *tons* of subjective difference between letting the user wait for 1 second with no feedback, *or* displaying some spinner or progress bar immediately after initiating the operation, then having the exact same 1 second delay.

There's simply no excuse for non-instantaneous reaction times for simple UI interactions and operations these days. If you ask me, there wasn't an excuse even in the early 90s as MS-DOS programs had already achieved peak UI responsiveness then.
 

J1M

Arcane
Joined
May 14, 2008
Messages
14,616
Do you really think average business applications are doubling in programming language performance requirements every year?
You're joking, right? Programmers have been getting sloppier each year (companies going for the "Most Viable (shit) Product" is often to blame too, to be fair), so much that even with the performance doubling every 3 years or so the net effect has been software been getting _slower_, and not by a small margin. My blood pressure always goes up a little before I need to edit some diagrams in Confluence; everything is so sloooow in these marvellous Web2.0 apps, sometimes I just say fuck it, I edit the diagram locally in Inkscape or whatever then just upload a PNG.

Seriously, I miss the snappiness of old Amiga and MS-DOS software that JustWorks(tm), and quickly. Guess what, there's still good software that is fast and not bloated (e.g. Blender, REAPER), but usually those guys compile their carefully optimised code to native binaries.
At some point everyone decided it was a great idea for every character you type or click you make to fire off a network packet to a server that would remotely check your spelling or try to sell your clicks. It doesn't matter how fast CPUs can get if we are always waiting on the wire.
 

J1M

Arcane
Joined
May 14, 2008
Messages
14,616
Do you really think average business applications are doubling in programming language performance requirements every year?
You're joking, right? Programmers have been getting sloppier each year (companies going for the "Most Viable (shit) Product" is often to blame too, to be fair), so much that even with the performance doubling every 3 years or so the net effect has been software been getting _slower_, and not by a small margin. My blood pressure always goes up a little before I need to edit some diagrams in Confluence; everything is so sloooow in these marvellous Web2.0 apps, sometimes I just say fuck it, I edit the diagram locally in Inkscape or whatever then just upload a PNG.

Seriously, I miss the snappiness of old Amiga and MS-DOS software that JustWorks(tm), and quickly. Guess what, there's still good software that is fast and not bloated (e.g. Blender, REAPER), but usually those guys compile their carefully optimised code to native binaries.
IMO: way too many new people into the field over the last 10-20 years. Impossible to inculcate them all many of them now have the 10 years of experience that many assume qualifies them to take senior positions.

It's gotten far worse since covid. My firm has an intake of new grads each year in Aug/Sept. Most of the ones from 2 years ago (ie: mid 2020, so have spent a majority of their career WFH) have simply not advanced to the point we can think of them as a safe pair of hands and we are not sure what to do about it. I have a feeling we will just dismiss them, as painful as that is given the investment we've made in them. Decision time is coming up - by the end of next month we either dismiss them or we have 3 cohorts of grads rather than the usual 2. 2021 cohort is a bit better looking but perhaps too early to say.

Programmers only seem to get better when they are in mixed ability groups where the less experienced can pickup skills and get direction on what to study. It almost seems like a medieval guild/apprenticeship system would be the thing.
https://en.wikipedia.org/wiki/Eternal_September
 
Joined
Dec 17, 2013
Messages
5,110
At some point everyone decided it was a great idea for every character you type or click you make to fire off a network packet to a server that would remotely check your spelling or try to sell your clicks. It doesn't matter how fast CPUs can get if we are always waiting on the wire.

And if it's not the network, it's the DB connection pool, or the bad code, etc. The programming language selection is way down on the list of slow-down factors in most real world programming situations.
 
Joined
Dec 17, 2013
Messages
5,110
Fixed it for YOU! :smug:



qNIhv7v.png
 

Jasede

Arcane
Patron
Joined
Jan 4, 2005
Messages
24,793
Insert Title Here RPG Wokedex Codex Year of the Donut I'm very into cock and ball torture
I got asked at work to implement the functionality of a python script in a Java plugin and I was pretty baffled by two things:

1) I thought everyone could read Python. Who can't read Python?
2) The whole thing just wrapped an rsync shell call. The whole giant script just boiled down to a single shell command. Why do people do this?
 

Blutwurstritter

Learned
Joined
Sep 18, 2021
Messages
875
Location
Germany
Is there a best practice for implementing interfaces in Python? There is the abc module and ABC class which enables the definition of an abstract class that can enforce the definition of methods and properties that derived classes must implement, but I haven't found a good way to enforce signatures of methods. This sounds like a basic problem with a standard solution that I'm simply unaware of and I'd rather not reinvent the wheel. Or does this go against some Python paradigm?
 

gaussgunner

Arcane
Joined
Jul 22, 2015
Messages
6,151
Location
ХУДШИЕ США
Is there a best practice for implementing interfaces in Python? There is the abc module and ABC class which enables the definition of an abstract class that can enforce the definition of methods and properties that derived classes must implement, but I haven't found a good way to enforce signatures of methods. This sounds like a basic problem with a standard solution that I'm simply unaware of and I'd rather not reinvent the wheel. Or does this go against some Python paradigm?
Python is dynamic. It's not big on enforcement. Use Java or Ada or some shit for that.
 

Tramboi

Prophet
Patron
Joined
May 4, 2009
Messages
1,226
Location
Paris by night
Is there a best practice for implementing interfaces in Python? There is the abc module and ABC class which enables the definition of an abstract class that can enforce the definition of methods and properties that derived classes must implement, but I haven't found a good way to enforce signatures of methods. This sounds like a basic problem with a standard solution that I'm simply unaware of and I'd rather not reinvent the wheel. Or does this go against some Python paradigm?
Python is dynamic. It's not big on enforcement. Use Java or Ada or some shit for that.
Or anything with decent static typing that floats your boat, but yes.
 

gaussgunner

Arcane
Joined
Jul 22, 2015
Messages
6,151
Location
ХУДШИЕ США
Or anything with decent static typing that floats your boat, but yes.
Not just static typing, also private/friend methods etc - black box abstraction enforcement. It's a pain in the ass. C++ and C# have it too. Ada was infamous for implementing all sorts of restrictions, even security I think, at the language level.
 

Blutwurstritter

Learned
Joined
Sep 18, 2021
Messages
875
Location
Germany
I don't think typing is the same as what I'd like to do, but I'm not overly familiar with the specific meaning of CS terms, so correct me if it does. I am looking for a way to enforce a certain signature i.e. fixed amounts of arguments or certain named arguments in a method. The type of these arguments can/should still be dynamic but the child classes should match the amount and names of he arguments. Here is an example,
Python:
from abc import ABC, abstractmethod

class AbstractInterface(ABC):
    @abstractmethod
    def some_method_that_derived_classes_must_implement(self, arg0, arg1, named_arg0=None):
        return arg0, arg1, named_arg0
    
class ConcreteClass(AbstractInterface):
    def some_method_that_derived_classes_must_implement(self):
        print("blub")
        return None

if __name__ == "__main__":
    concrete_instance = ConcreteClass()
    concrete_instance.some_method_that_derived_classes_must_implement()

The child class `ConcreteClass` must implement the method `some_method_that_derived_classes_must_implement` or it can't be instantiated, but the signature and return value are completely independent from the specification in the abstract class. The signature in the AbstractInterface does not matter all, you could leave the function empty in the abstract class, it has the same effect. I thought it would be convenient to enforce matching of signatures while retaining the dynamic typing for the arguments/return values. It seems that the abstract class in python only serves specifying names of methods/properties and nothing else, which I find a bit weird. I haven't found a reference that explains why that is the case or a reference that gives a standard way to do so. Which is usually an indicator that the reasons are either extremely obvious to people in the field so they don't bother explaining them, or that there is an commonly known solution that is so basic that its barely mentioned in great detail. I am not sure what to make of it for the moment.
 

Tramboi

Prophet
Patron
Joined
May 4, 2009
Messages
1,226
Location
Paris by night
Well Python dynamism means that you can "only" do your signature check at runtime.
Most people don't do it because you can invoke the said functions at runtime and have... runtime errors instead.
So not much gain, because dynamic typing people are not that interested in this kind of thing. They believe/think that programs should be proved, designed and tested correct.
Static typing people want to leverage the type system to catch this kind of mistakes up front.

(All this is very approximate but no Codex post can replace reading lots of CS books)
 
Last edited:

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,430
Location
down under
Codex+ Now Streaming!
You're trying to turn Python into something it wasn't designed to be. Just use a statically typed language as many others have already advised.
 
Last edited:
Joined
Dec 17, 2013
Messages
5,110
Abstract classes are pretty much the same as interfaces in Python (since multiple inheritance is supported), but in general, it's not really the way Python is used. It's used more with duck typing, where you just expect an object to have certain methods/attributes, and call them (and handle the exception if they don't). If you are developing a generic framework to be used by a lot of other companies/developers, interfaces can be useful/necessary, but if you are just working on your own code/your company's code, you can get by without them just fine. The emphasis in Python is to churn out working code quickly that does specific stuff, not so much to build out generic frameworks.

I like the concept of interfaces and generic code in principle, but some of the most boring development I have ever done was on these massive Java/C# projects using huge frameworks with interfaces up the ass.
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,430
Location
down under
Codex+ Now Streaming!
you can get by without them just fine
Until you put the project aside for a few months, then you have no idea what the fuck you were doing back then...

some of the most boring development I have ever done was on these massive Java/C# projects using huge frameworks with interfaces up the ass.
Except it's next to impossible to work efficiently together in a team environment without such interfaces/contracts. I don't see what is boring about it; in the end you end up with *some* interface anyway, it's just ad-hoc, undocumented, and error prone in the long-term.
 
Joined
Dec 17, 2013
Messages
5,110
you can get by without them just fine
Until you put the project aside for a few months, then you have no idea what the fuck you were doing back then...

This doesn't really have to do with interfaces so much. Interfaces are about creating highly generic code for frameworks and such, so third party users can implement their own classes while still using your framework. Code readability, on the other hand, is much more affected by the quality of your code:

1. Writing clean, logical code.
2. Adding relevant comments in key places.
3. Splitting up code/data into manageable pieces (whether classes, methods, etc). OOP is great for this, btw.
4. Using descriptive names for variables/methods.
5. Avoiding "cute" shit and keeping code straightforward, e.g. writing very complex code statements using some of the language's tricks, or things like lambdas might seem leet in the moment, but it really fucks with the code's readability.

If you do the stuff above, your code should be fairly easy to understand.


some of the most boring development I have ever done was on these massive Java/C# projects using huge frameworks with interfaces up the ass.
Except it's next to impossible to work efficiently together in a team environment without such interfaces/contracts. I don't see what is boring about it; in the end you end up with *some* interface anyway, it's just ad-hoc, undocumented, and error prone in the long-term.

I am not criticizing it in the sense that it was the wrong way to do it. They were large projects, so you needed these huge frameworks, but I am just saying that it was very boring work. Instead of focusing on writing interesting creative code that does cool things, a very significant percentage of time is spent on churning out boilerplate code or code that joins these frameworks with your stuff.
 

Rincewind

Magister
Patron
Joined
Feb 8, 2020
Messages
2,430
Location
down under
Codex+ Now Streaming!
I am not criticizing it in the sense that it was the wrong way to do it. They were large projects, so you needed these huge frameworks, but I am just saying that it was very boring work. Instead of focusing on writing interesting creative code that does cool things, a very significant percentage of time is spent on churning out boilerplate code or code that joins these frameworks with your stuff.
Yeah, that's just life, I think. I enjoy the prototyping phase the most, but that's like 20% of the work in most cases. Then you gotta do the remaining 80% perfect to make things really robust and production ready, which can get a bit tiresome... but needs to get done by someone :shrug: Best to give that job to interns/juniors, if they don't screw it up :P
 

Tramboi

Prophet
Patron
Joined
May 4, 2009
Messages
1,226
Location
Paris by night
Opposite experience there. "Anybody" can do the bootstrapping of most projects.
Making it polished, correct, maintainable yet optimized and shiny is where experienced engineers shine the most.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom