There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lemmy.ml

topperharlie , to programmerhumor in optimal java experience

lol, last time I switched jobs some years ago I did the same but in the other side, I had a side small section with level of expertise on programming languages and explicitly added java with 1/10 to send a clear message xD

(is not that radical giving that I’ve been a embedded/graphics programmer most of my career, but still, funnier than not mentioning it)

Kolanaki , to programmerhumor in Programming Languages
@Kolanaki@yiffit.net avatar

“You guys are stupid. See, they’re gonna be lookin’ for army guys.”

TrismegistusMx , (edited ) to programmerhumor in optimal java experience
@TrismegistusMx@lemmy.world avatar

When I was in the military, the shooting instructors said they preferred training females because they haven’t been trained poorly by somebody else.

EDIT: Designating recruits as male and female is the way the military does things. I don’t use the terms male and female when referring to groups of humans. I felt the need to clarify since somebody already took offense.

Kryomaani ,

they preferred training females

It’s “women”.

TrismegistusMx ,
@TrismegistusMx@lemmy.world avatar

“They said”

Kryomaani ,

“They said”

If only there was some generally agreed upon symbol to denote direct quotes as opposed to paraphrasing an idea in your own words. If only…

TrismegistusMx ,
@TrismegistusMx@lemmy.world avatar

If only there were fewer dickheads looking for a fight online. If only.

JackGreenEarth ,

I don’t understand what you’re saying

daellat ,

They already gave you a downvote lol. Redditism has arrived.

Coreidan ,

You sound like a miserable person

Kryomaani ,

I’d rather sound miserable than incel.

Coreidan ,

Really? You sound both miserable and incel. You failed.

BigBootyBoy ,
@BigBootyBoy@sh.itjust.works avatar

Go back to reddit

ScrimbloBimblo ,

You’ve obviously never been in the military, because it’s definitely “females”.

Kryomaani ,

I’m from a country with mandatory conscription for men, so yes, I’ve been in the military and I’ve seen the misogyny (among countless other varieties of bigotry) rampant in that system from front row seats. We had a handful of female volunteer conscripts, as well as one of my NCOs was a woman, and it was blatantly obvious they were not recieving the same treatment as the majority of us who were men (and not in a good way, if there was any room for confusion).

Experiences like that are among the key reasons I’m not happy to see people keep perpetuating that kind of behavior, especially in other traditionally male-centric contexts like the IT industry and even here on this forum.

ScrimbloBimblo , (edited )

Whether or not you personally agree with the military’s choice of language is not relevant. You’re assuming the trainer agrees with your political views, but you weren’t there, so you have no idea what they said or didn’t say.

oce ,
@oce@jlai.lu avatar

In French, the literal translation of female and male, are only used for animals in the common language, but I have been taught that in English it is ok to use those for humans in common language. Is it not the case in your region?

Hazzia ,

It’s technically grammatically correct, but outside of a medical context (or military, as stated above), it has, in recent years especially, been heavily associated with incels and other creepy kinds of people. So in effect no, it’s not generally considered good to refer to women as “female” in day-to-day speech.

Examples:

“Females simply don’t have the emotional capacity that men do, which is why they’re so quick to cheat and betray” - typical incel line

“Today on the train I saw a beautiful female with silky hair and clear skin” - kinda sounds like a serial killer

AccountMaker ,

I don’t really see a problem with saying things like “my female friends” or “my female colleagues”, when it’s used as an adjective.

Jakeroxs ,

This, people just being weird about terms

ChrissieWF ,

No one claimed it is, when used as an adjective :)

kboy101222 ,

Adjective is fine! As a noun it’s creepy and makes you sound like an incel

Kryomaani , (edited )

Female/male are used in English as adjectives when describing humans, but as nouns they only refer to animals. “She is a woman” and “She is a female actress” are both okay but calling women “females” is purposefully demeaning and sexist. I do not believe there is any regional difference in this, nor should we really care about such since there are no regions when we’re on a global forum.

oce ,
@oce@jlai.lu avatar

nor should we really care about such since there are no regions when we’re on a global forum

English being a third language for me, I’m actually interested in understanding the differences coming from different cultures that I may not be aware of. I find global forum to be nice for this reason, although they tend to be dominated by the Northern American culture.

kboy101222 ,

I can’t speak with certainty, but I can speak subjectively on this -

I have family and friends all over the US (I’m only missing someone from both Dakotas to complete the collection), so I’ve heard damn near every accent, regional dialect, language, etc that there is to hear in the US, including some near dead native languages and Pennsylvania Dutch.

The only people I know that use “females” instead of women are either in the military like OP or they’re sexist. Sometimes it’s blatantly misogynistic, sometimes they’re casually sexist.

Or they’re both. It’s frequently both.

Dohnakun ,

Whatever.

Yearly1845 ,

deleted_by_author

  • Loading...
  • ChrissieWF ,

    “Males” sounds just as awkward in such a context.

    Kryomaani ,

    Perhaps because people aren’t going around calling others “males” to demean them?

    These are not difficult concepts if you turn on your brain.

    grandkaiser ,

    Nah. In the military, you aren’t “men and women” you are “soldiers” (or sailors, Marines, or airmen). If you are referring specifically to a specific gender such as a “female” soldier, then that’s what you call them.

    No one says “women soldiers” except maybe a civilian.

    Kryomaani ,

    No one says “women soldiers” except maybe a civilian.

    And I’m not telling you to, stop putting words in my mouth. Female as an adjective is fine, “female soldier” is fine, calling a group of human women “females”, as in a noun, is demeaning and incel lingo.

    AlmightySnoo , (edited ) to programmerhumor in optimal java experience
    @AlmightySnoo@lemmy.world avatar

    I know the guy meant it as a joke but in my team I see the damage “academic” OOP/UML courses do to a programmer. In a library that’s supposed to be high-performance code in C++ and does stuff like solving certain PDEs and performing heavy Monte-Carlo simulations, the guys with OOP/UML background tend to abuse dynamic polymorphism (they put on a pikachu face when you show them that there’s also static polymorphism) and write a lot of bad code with lots of indirections and many of them aren’t aware of the fact that virtual functions and dynamic_cast’s have a price and an especially ugly one if you use them at every step of your iterative algorithm. They’re usually used to garbage collectors and when they switch to C++ they become paranoiac and abuse shared_ptr’s because it gives them peace of mind as the resource will be guaranteed to be freed when it’s not needed anymore and they don’t have to care about when that is the case, they obviously ignore that under the hood there are atomics when incrementing the ref counter (I removed the shared pointers of a dev who did this in our team and our code became twice as fast). Like the guy in the screenshot I certainly wouldn’t want to have someone in my team who was molded by Java and UML diagrams.

    ForegoneConclusion ,

    Depends on the requirements. Writing the code in a natural and readable way should be number one.

    Then you benchmark and find out what actually takes time; and then optimize from there.

    At least thats my approach when working with mostly functional languages. No need obsess over the performance of something thats ran only a dozen times per second.

    I do hate over engineered abstractions though. But not for performance reasons.

    declination ,
    @declination@programming.dev avatar

    You need to me careful about benchmarking to find performance problems after the fact. You can get stuck in a local maxima where there is no particular cost center buts it’s all just slow.

    If performance specifically is a goal there should probably at least be a theory of how it will be achieved and then that can be refined with benchmarks and profiling.

    CanadaPlus ,

    Writing the code in a natural and readable way should be number one.

    I mean, even there it depends what you’re doing. A small matrix multiplication library should be fast even if it makes the code uglier. For most coders you’re right, though.

    Dohnakun , (edited )

    Even then you can take some effort to make it easier to parse for humans.

    CanadaPlus ,

    Oh, absolutely. It’s just the second most important thing.

    Aceticon ,

    You can add tons of explanatory comments with zero performance cost.

    Also in programming in general (so, outside stuff like being a Quant) the fraction of the code made which has high performance as the top priority is miniscule (and I say this having actually designed high-performance software systems for a living) - as explained earlier by @ForegoneConclusion, you don’t optimize upfront, you optimized when you figure out it’s actually needed.

    Thinking about it, if you’re designing your own small matrix multiplication library (i.e. reinventing the wheel) you’re probably failing at a software design level: as long as the licensing is compatible, it’s usually better to get something that already exists, is performance oriented and has been in use for decades than making your own (almost certainly inferior and with fresh new bugs) thing.

    PS: Not a personal critical - I too still have to remind myself at times to not just reinvent that which is already there. It’s only natural for programmers to trust their own skills above whatever random people did some library and to want to program rather than spend time evaluating what’s out there.

    CanadaPlus , (edited )

    Thinking about it, if you’re designing your own small matrix multiplication library (i.e. reinventing the wheel)

    I thought of this example because a fundamental improvement was actually made with the help of AI recently. 4x4 in specific was improved noticeably IIRC, and if you know a bit about matrix multiplication, that ripples out to large matrix algorithms.

    PS: Not a personal critical

    I would not actually try this unless I had a reason to think I could do better, but I come from a maths background and do have a tendency to worry about efficiency unnecessarily.

    I think in most cases (matrix multiplication being probably the biggest exception) there is a way to write an algorithm that’s easy to read, especially with comments where needed, and still approaches the problem the best way. Whether it’s worth the time trying to build that is another question.

    Aceticon ,

    In my experience we all go through a stage at the Designed-Developer level of, having discovered things like Design Patterns, overengineering the design of the software to the point of making it near unmaintainable (for others or for ourselves 6 months down the line).

    The next stage is to discover the joys of KISS and, like you described, refraining from premature optimization.

    magic_lobster_party ,

    I think many academic courses are stuck with old OOP theories from the 90s, while the rest of the industry have learned from its failures long time ago and moved on with more refined OOP practices. Turns out inheritance is one of the worst ways to achieve OOP.

    fidodo ,

    I think a lot of academic oop adds inheritance for the heck of it. Like they’re more interested in creating a tree of life for programming than they are in creating a maintainable understandable program.

    einsteinx2 ,
    @einsteinx2@programming.dev avatar

    That’s the problem, a lot of CS professors never worked in the industry or did anything outside academia so they never learned those lessons…or the last time they did work was back in the 90s lol.

    Doesn’t help that most universities don’t seem to offer “software engineering” degrees and so everyone takes “computer science” even if they don’t want to be a computer scientist.

    zbecker ,
    @zbecker@mastodon.zbecker.cc avatar

    @einsteinx2 @magic_lobster_party

    This is most definitely my experience with a lot of CS professors unfortunately.

    jungle , (edited )

    There’s an alternative system where this doesn’t happen: pay university professors less than a living wage.

    You do that, and you’ll get professors who work in the industry (they have to) and who love teaching (why else would they teach).

    I studied CS in country where public university is free and the state doesn’t fund it appropriately. Which obviously isn’t great, but I got amazing teachers with real world experience.

    My son just finished CS in a country with paid and well funded university, and some of the professors were terrible teachers (I watched some of his remote classes during covid) and completely out of touch with the industry. His course on AI was all about Prolog. Not even a mention of neural networks, even while GPT3 was all the rage.

    rbhfd ,

    who love teaching (why else would they teach)

    Professors love doing academic research. Teaching is a requirement for them, not a passion they pursue (at least not for most of them).

    jungle ,

    Yeah, that makes it even worse.

    To be clear, I’m not advocating for not paying living wages to professors, I’m just describing the two systems I know and the results.

    I don’t know how to get teachers who are up to date with industry and love teaching. You get that when teaching doesn’t pay, but it’d be nice if there was a better way.

    roq ,

    deleted_by_author

  • Loading...
  • magic_lobster_party ,

    OOP can be good. The problem is that in Java 101 courses it’s often taught by heavily using inheritance.

    I think inheritance is a bad representation of how stuff is actually built. Let’s say you want to build a house. With the inheritance way of thinking you’re imagining all possible types of buildings you can make. There’s houses, apartment buildings, warehouses, offices, mansions, bunkers etc.. Then you imagine how all these buildings are related to each other and start to draw a hierarchy.

    In the end you’re not really building a house. You’re just thinking about buildings as an abstract concept. You’re tasked to build a basic house, but you are dreaming about mansions instead. It’s just a curious pastime for computer science professors.

    A more direct way of building houses is to think about all the parts it’s composed of and how they interact with each other. These are the objects in an OOP system. Ideally the objects should be as independent as possible.

    This concept is called composition over inheritance.

    For example, you don’t need to understand all the internals of the toilet to use it. The toilet doesn’t need to be aware of the entire plumbing system for it to work. The plumbing system shouldn’t be designed for one particular toilet either. You should be allowed to install a new improved toilet if you so wish. As long the toilet is compatible with your plumbing system. The fridge should still work even if there’s no toilet in the house.

    If you do it right you should also be able to test the toilet individually without connecting it to a real house. Now you suddenly have a unit testable system.

    If you ever need polymorphism, you should use interfaces.

    AstralWeekends ,

    This was a nice analogy, thanks for the write-up.

    Aceticon ,

    The Design Patterns book itself (for many an OO-Bible) spends the first 70 something pages going all about general good OO programming advice, including (repeatedly emphasised) that OO design should favour delegation over inheritance.

    Personally for me (who started programming professionally in the 90s), that first part of the book is at least as important the rest of it.

    However a lot of people seemed to have learned Patterns as fad (popularized by oh-so-many people who never read a proper book about it and seem to be at the end of a long chinese-whispers chain on what those things are all about), rather than as a set of tools to use if and when it’s appropriate.

    (Ditto for Agile, where so many seem to have learned loose practices from it as recipes, without understanding their actual purpose and applicability)

    I’ll stop ranting now ;)

    wolf ,

    I fully agree about the damage done at universities. I also fully agree about the teaching professors being out of the game too long or never having been at a level which would be worth teaching to other people. A term which I heard from William Kenned first is ‘mechanical sympathy’. IMHO this is the big missing thing in modern CS education. (Ok, add to that the missing parts about proper OOP, proper functional programming and literally anything taught to CS grads but relational/automata theory and mathematics (summary: mathematics) :-P). In the end I wouldn’t trust anyone who cannot write Assembler, C and knows about Compiler Construction to write useful low level code or even tackle C++/Rust.

    Dohnakun ,

    OOP/UML courses

    Luckily, i had only one, and the crack who code-golfes in assembler did the work of us three.

    odbol ,

    That’s wild that shared ptr is so inefficient. I thought everyone was moving towards those because they were universally better. No one mentions the performance hit.

    Duralf ,

    Atomic instructions are quite slow and if they run a lot… Rust has two types of reference counted pointer for that reason. One that has atomic reference counting for multithreaded code and one non-atomic for single threaded. Reference counting is usually overkill in the first place and can be a sign that your code doesn’t have proper ownership.

    hellishharlot ,

    I have been writing code professionally for 6ish years now and have no idea what you said

    deadly4u , to programmerhumor in optimal java experience

    That’s really interesting. Maybe it’s like @nxtsuda said. For a lot of folks, OOP was the way we learned and operated for years

    Could they have just asked it differently? Or do they just have Java hate.

    SpaceNoodle ,

    It’s obviously an embedded role. Java and its developers are notorious for throwing memory and compute usage out the window.

    Nechesh ,

    If all I knew about java was some of the garbage projects I’ve inherited over the years I might hate it too.

    nxtsuda , to programmerhumor in optimal java experience

    OOP does things to a person

    cosmicboi ,

    a PersonImpl, you mean? :P

    Sanchokan , to programmerhumor in optimal java experience

    Ool about it. Where does the java hate come from?

    serinus ,

    OOP is fine. It’s particularly Java culture that’s terrible.

    I never want to see the word Factory in a class name ever again.

    When a Java dev writes in any other language, you can tell. Too many layers of abstraction is a key indicator. They make simple problems complex.

    I once inherited a C# website project from a Java dev. I couldn’t even figure out how to modify the CSS. And I’m a C# dev.

    magic_lobster_party ,

    Factories can be good in moderation. If you make factories for every class, maybe you need to rethink your practices.

    kboy101222 ,

    I was part of a fun era at my university where they switched from C++, which is what I took in intro to programming, to java. So by the time I was doing some group projects senior year, I was working in C# with people who had only done Java.

    They wanted to abstract everything. Everything had to be a class. Any time they repeated 2 lines of code it got put into a helper class.

    We ran into an issue where the code just would not run no matter how hard we tried and of course no one on the project but me bothered to use git (they would literally send me the zipped up project on discord and I had to copy and paste everything into the actual code). I ended up rewriting the entire project overnight. It actually wasn’t that bad once I got into the flow of things. Turns out none of them knew how to program without being explicitly told how.

    Still not the worst college group project though. Maybe top 5.

    Aceticon ,

    I’ve worked with Java for decades (kid you not: learned it from reading the Java Language Specification 1.0 back when it came out) and there’s definitivelly a stage (often a long one) in one’s career when one thinks him/herself so great at OO and just overengineers every single software design way (way, WAY) beyond the actual objective of behind the whole OO design concept (maintenability and bug reduction), actually achieving the opposite objectives (an unmaintainable POS, riddled with hard to track bugs because of way too many unnessary details having overwhelmed the developer’s ability to keep track of it all).

    Eventually you learn KISS design and Refactoring as a sort of housekeeping practice for code and design.

    But yeah, as a freelancer I’ve very commonly landed in the middle of maintenance-stage projects with existing code bases that were clearly done by somebody at that oh-so-special stage in their career, and often it’s better to just reverse engineer the business requirements from the application and redo the whole thing (in the process cutting the codebase size to a small fraction of what it was).

    drew_belloc , to programmerhumor in optimal java experience
    @drew_belloc@programming.dev avatar

    It’s time to show off my java hello world with 7 errors on line 34

    elvith ,

    I don’t know what I did wrong, but the bug must be somewhere in HelloWorldExampleClassForTutorialBuilderFactory.HelloWorldExampleClassForTutorialBuilderFactory(StringBuilderFactory myHelloWorldExampleClassForTutorialStringBuilder, int numberOfTimesToDisplayHelloWorld)

    Tolookah , to programmerhumor in Programming Languages

    C or c++ should be the one in the back, pointing at things…

    ohlaph ,

    Absolutely…

    The_Hideous_Orgalorg , to memes in monopoly

    Supposed to be unable to collect rent while incarcerated.

    dontblink , to programmerhumor in Programming Languages
    @dontblink@feddit.it avatar

    May i ask why everyone hates JavaScript so much? It’s not ironic it’s a real question, i can’t really get it, is it just because it doesn’t have types? Or there’s more?

    fiah ,
    @fiah@discuss.tchncs.de avatar

    it has a lot of cruft and gotchas and lacks a good standard library (which is why npm is a thing). That means there’s a lot of bad javascript code out there and a lot of people who have had bad experiences with it. But, if you take care to not shoot yourself with the included footguns and you know your way around npm, it’s a perfectly fine language for its purposes in front- and backend development IMO

    monk ,

    Let me suggest a simple exercise for you.

    1. Print “Hello world!” to stdout in Javascript.
    2. Show me the standard that guarantees that everything you’ve used exists and works as intended.

    I’ll wait.

    masterspace ,

    Show me the standard that guarantees that everything you’ve used exists and works as intended. I’ll wait.

    I think you fail to understand the very basics of web development if you’re operating on the assumption that everything you need is always reachable.

    monk ,

    I think you’re misunderstanding what “everything” means (it was “everything needed for a hello world”) and trying to divert the discussion to whatever Web has devolved into, which is an abomination that’s definitely unsuited for learning the ropes of software development.

    Feathercrown ,

    In the browser you cannot access stdout, but you can use console.log to write to the dev console which is basically the same thing.

    In Node, you can use process.stdout.

    Both are available from the top-level globalThis objects that are part of each platform’s respective default library.

    monk ,

    And in GJS? All other runtimes?

    In, say, C, such basic stuff is right there, in the standard.

    Javascript isn’t even standardized, some ECMAScript is, so I don’t even know what we’re talking about.

    Feathercrown ,

    All ECMAScript is standardized because that refers to the standard.

    I think you’re discounting the different environments that JS runs in. Something like C runs in a much more uniform environment (the OS) while JS must be able to run in different runtimes. It’s like how windows has APIs that C can access, but obviously you can’t access them when running C from other OSes (forgive me if that’s inaccurate, I don’t use C often).

    monk ,

    Making it an excellent choice for a programming beginner --sarcasm

    oktupol ,

    I believe the amount of hate and mockery Javascript receives is heavily skewed, simply because almost every programmer who is active today has at least some experience with the language, and with more users there are also more people capable of complaining about it.

    I work with languages that are much worse than Javascript, yet they don’t receive nearly as much hate because hardly anyone uses them.

    One that comes into my mind is ABAP:

    https://discuss.tchncs.de/pictrs/image/4308e5c7-2b57-4a37-b4df-d1e63a42593e.png

    NichtElias ,
    @NichtElias@sh.itjust.works avatar

    What the fuck

    oktupol ,

    My colleagues and I joke around that SAP stands for Sadness and Pain.

    alec ,

    “Joke”

    twei ,

    As you may know SAP is a German company and the name originally was an acronym for SanduhrAnzeigeProgramm, which translates to “hourglass displaying program” - a nod to when busy software would change the mouse cursor into an hour glass - since it was initially conceived as a hardware stress test software - expanding to employee stress tests was just the logical next step.

    Things got weird when scammers found a new hustle charging hundreds of dollars per hour pretending it was an ERP solution or similarly outrageous ideas that non-technical people in all kinds of business fell for.

    (copied from reddit before it gets deleted)

    drew_belloc ,
    @drew_belloc@programming.dev avatar
    fiah ,
    @fiah@discuss.tchncs.de avatar

    that’s a crime against humanity

    QuazarOmega ,

    Goddamn, now I’m glad I didn’t go forward with an ABAP developer job offer

    Zucca ,

    Oh boy…

    Imo, both methods should set the same value for x. That’s madness. 🤪 Just look at awk for example. There’s a dedicated substr() and it doesn’t care about spaces. But then awk is quite loose in everything… and niche… But I love it.

    Iteria ,
    @Iteria@sh.itjust.works avatar

    Because it’s inescapable. Web development is by far the most common type of programming work and even if you’re a backend developer you tend to have to touch javascript at some point, so everyone knows the pain of javascript’s foot guns and javascript has a lot.

    The fact that it’s mandatory to do your work invokes bitterness in people. For backend, you can kind of switch around until you find a language you like. For frontend, it’s javascript or nothing at all.

    Javascript as a language is very out of sync with other commonly used languages. Its footguns are very easy to run into. As a result you have a lot of rituals around just not shooting yourself in the foot. The rituals, libraries, and frameworks around avoiding Javascript’s foot guns have been very shifting and changing. Of course, because the javascript ecosystem changes far faster than other languages, there are a lot of rakes for developers to step on to add to the naturally existing foot guns.

    Javascript as a language probably shouldn’t be the sole language of the internet for a variety of reasons. It’s a very hateable language because of how easy it is for newbies to make new terrible code and how common it is. Until something like WASM takes off, the downpour of hate for javascript will continue.

    masterspace ,

    Javascript as a language is very out of sync with other commonly used languages.

    How so? Moving back and forth between Typescript and C# / Java is pretty natural imho, as long as you understand the compiled vs interpreted differences.

    RagingNerdoholic ,

    In my experience (Javascript and PHP, which both have plenty of footguns), these pitfalls can be avoided by using good practices.

    Just because they are dynamically typed doesn’t mean you have to use dynamic typing. Don’t type switch your variables.

    Just because you don’t have to use brackets in a certain scenario doesn’t mean you can’t. Use them as needed for clarity.

    That kind of thing.

    masterspace ,

    It’s wild that Python is getting a shoutout over javascript despite being an even bigger loosely typed mess.

    I think it’s partially because Python has a reputation as being a serious language for serious people because it’s popular amongst data scientists and academics, whereas Javascript is still seen as being popular amongst script kiddies and people building crappy websites for $100 / pop.

    That being said, most of the time i hear javascript jokes at work they’re pretty tongue in cheek /ironic / the dev isn’t really hating on it. I have heard a dev or two make those javascript jokes with a more serious critical tone, and everyone tends to ignore them and not engage because they’re pretty clearly just haters who have a general tendency to dislike popular things.

    AGuyNamedMay ,
    1. What lol, python has type hints (ie gradual typing)
    2. Python is absolutly not popular at all in academics lol, most over there use haskell/ocaml/c
    RagingNerdoholic ,

    Python programmers, brace yourself for this…

    Oh wait.

    Faresh ,

    If by «loosely typed» you mean weakly typed, then that’s not true. Python is a dynamically and strongly typed language. Attempting to do an operation with incompatible types will result in a TypeError.

    
    <span style="color:#323232;">>>> "3" + 9
    </span><span style="color:#323232;">Traceback (most recent call last):
    </span><span style="color:#323232;">  File "", line 1, in 
    </span><span style="color:#323232;">TypeError: can only concatenate str (not "int") to str
    </span>
    

    You may be thinking of the following, but this only works because the __mul__ and __add__ methods of these objects have been written to accept the other types.

    
    <span style="color:#323232;">>>> "A" * 4 + "H"
    </span><span style="color:#323232;">'AAAAH'
    </span>
    
    masterspace ,

    I meant that you do not declare types and a variable’s type can change at any time.

    Regardless of semantics, it results in code that is not scannable.

    Faresh ,

    But it is in no way worse than javascript in that regard, though?

    I don’t think static typing in Python is really so essential. I see it above all as a scripting language, so its applications don’t benefit as much from static typing as other languages do.

    Maybe a better hypothetical python would have used some kind of type inference system, like in haskell, which allows for static typing while still allowing to write code unencumbered from types and stuff, but I really think, for Python’s target domain, its type system is actually adequate or good. Maybe its documentation could benefit from type hints, though.

    masterspace ,

    But it is in no way worse than javascript in that regard, though?

    No, but OPs original post was implying that it was better than JavaScript, when in my mind they’re pretty similar in that regard, with the major exception that there is no python equivalent of Typescript which is rapidly passing JavaScript in professional settings.

    I don’t think static typing in Python is really so essential. I see it above all as a scripting language, so its applications don’t benefit as much from static typing as other languages do.

    For a scripting language it’s fine, but problems arise when you start building giant applications with it (which does happen).

    ursakhiin ,

    I’m a backend engineer. My biggest issue with JavaScript is environments that use it in the backend.

    JavaScript is designed to run in a way that continue to try to do things even when it’s running in to errors. But it does that because I’m a front end that’s what you want. In the front end, working but ugly is better than not working at all. In the backend that can be catastrophic, though.

    jjjalljs ,

    It has a lot of gotchas and an unstable ecosystem.

    A lot of basic stuff is confusing of weird. How do you loop over an object? There’s like five ways. How do you declare a function? There are two very different ways that behave differently, and the new one has like five variations in its syntax that can throw you.

    Here’s an example of something that continues to bother me:

    <pre style="background-color:#ffffff;">
    <span style="color:#323232;">const foo = "hello";
    </span><span style="color:#323232;">const bar = { foo: "world"}
    </span>
    

    What do you think bar looks like? If you thought it had a key of “hello” and a value of “world”, that’s sensible but wrong. It has a key of “foo”. Object keys don’t need to be quoted in JavaScript. If you want the key to be a variable you have to write it like { [foo] : “world” }. Which looks like a list.

    There’s a lot of this kind of stuff in the language. Small things that once you know you can work around, but are still weird, annoying, and prone to causing errors.

    The standard library historically hasn’t been very good. This has lead to many libraries being maintained by the community. But the community is fickle, and the quality of libraries is not guaranteed.

    The standard library was bad at some basic operations, so underscore was created. But then someone made lodash, and most people (but not everyone!) moved to it. But then the standard library caught up some more, so maybe you don’t need either? When you start working on a new-to-you project you don’t know what you’re going to get.

    Dates were a mess so momentjs got big, but now that’s deprecated. Move to datefns, which has a completely different interface.

    Node releases a new major version every six months. Every six months! Python has been on major version 3 for years and has no plans for a version 4, for comparison. The constant version releases is a potential source for headaches.

    In my experience many libraries are kind of fast and loose with major releases, too. It can be a pain to keep up, especially if you have peer deps.

    The debugger is kind of bad. Sometimes it will pause but you typically can’t like treat it like a repl. Python’s, for comparison, blows it out of the water.

    Many things are async in JavaScript. Sometimes you don’t expect a particular call to be async or you forget, and you have a bad time. The async/await keywords were a godsend. The giant stack of “then…then…then…” was not fun. Combine with the weak debugger and you have an extra bad time. I bet there are a lot of console.log(“code is here”) debug calls out in the wild because of this.

    For your actual front end view layer, react is the current hotness. But older projects are still out there with angular, backbone, probably some with just jQuery. React isn’t terrible but how long is it going to be king? What breaking changes are they going to put out in the next version? The ecosystem is unstable.

    Also redux kind of sucks. Not a fan of global variables. I think the community has moved on from redux though? Again, the ecosystem is unstable.

    In my experience there are many developers who only know JavaScript, and they want to use it for everything. It is the dungeons and dragons of languages. Much like how it is frustrating when your friends want to run a cyberpunk murder mystery in Dungeons and Dragons, it can be frustrating when your team wants to write everything, even your backend, in JavaScript.

    We had browser tests at one job. They’re a very synchronous thing. Open the browser, load the page, enter name and password, wait for login. We had all of this written in python working fine, but people wanted to switch to a JavaScript toolset. Sorry, I mean they wanted to switch to JavaScript but there were three different browser testing tools the different teams wanted to use. Because the javascript ecosystem is like that. After a more candid talk with one of the guys I knew personally, he admitted it wasn’t because JavaScript was the best tool but rather he didn’t want to use python.

    I can’t authoritatively say this is typical, but in my experience I’ve had a lot of resistance from JavaScript devs using other languages. Again, I think it’s like DND. DND is a unnecessarily complicated game full of exceptions and gotchas. If that’s what you learn first, you probably think everything is like that, and why would you want to go through that again? But of the popular languages/games, javascript/DND are exceptional for their weirdness.

    In fact, thinking about it for more than a minute, my current team lead is a JavaScript main and he’s great. Super willing to learn other languages and has never been pushy. So it’s definitely not everyone.

    The stack traces tend to be kind of bad. In production shit is probably minified so you might get “error on line 1, column 4737373”. In other contexts you may get a few hundred lines of node_modules to sift through before finding your actual code.

    At least jest and (react) testing library aren’t bad. Mocha + chai were annoying. Enzyme is not great. Again, things change rapidly. You might join a company and find they’re still using mocha and enzyme, and switching never gets prioritized. If JavaScript made things better without breaking changes or swapping to an entirely new toolset it wouldn’t be a serious problem, but the standard mode seems to be “fuck it let’s make an entirely new tool”.

    The lack of type hints isn’t great. You can use typescript but that’s a whole new set of stuff you have to set up. Python also doesn’t have types but they managed to add them as an option without making us switch to like TypeThon. But that’s not the JavaScript way. If you’re not making a breaking change are you really doing JavaScript?

    I could go on, but my cat is getting up to some bullshit and I need to see what he’s screaming about. Probably not JavaScript.

    tldr:

    • standard library kind of bad
    • ecosystem unstable and of variable quality
    • unpleasant personal experiences with JavaScript developers wanting to use it for everything
    dontblink ,
    @dontblink@feddit.it avatar

    Gotta say thar for someone who is currently following a JavaScript course this is pretty descouraging ahaha

    I gotta say i also fell in that category of people trying to use JavaScript for stuff that is not exactly JavaScript suited. For example i’m writing a little script that changes markdown links in some files using the fs node, this is probably better suited to do in bash or other languages but the first thought was: i know a bit of JavaScript and that took a lot of time, what would be the point of learning a new syntax with all the stuff i will have to learn only on js!

    jjjalljs ,

    If it makes you feel better, many of the things you learn in JavaScript will be helpful in other languages. You already know what functions are, for example, so you don’t need to relearn that. Even though JavaScript has some weirdness about functions.

    SolarMech ,

    It has a rocky start, and a lot of cruft from that era sticked around.

    There are also a lot of horrible legacy projects from the pre-ES5 era which are a pain to work with. Often older projects were coded either before people knew how to do javascript right, or before the devs who wrote it knew how to write javascript right.

    pazukaza ,

    My problem with it is that it gives people too much freedom. They can write the code in very, VERY ugly ways… And they do. It’s a language that let’s you write a mess pretty easily.

    That’s really my only complaint. The ugliness happens mainly in:

    • callback hell. For some reason some people still do callback hell in 2023.
    • functions as objects. This is pretty neat actually, one of the best things in Javascript, but some people just abuse the hell out of it.
    rikudou , to programmerhumor in Programming Languages

    Yeah, gonna have to disagree. If I had to choose between JS and Python, I’d shoot myself in the head.

    Llewellyn ,
    @Llewellyn@lemmy.ml avatar

    So you choose JS.

    Valmond ,

    Python is cool IMO, got loads of libraries and gets your little app up in notime.

    Not for larger projects though.

    JavaScript is like the unsafest language I have touched in the last 20 years, yikes!

    Still would use it as a web front end instead of python ofc.

    Hazzia ,

    I’ve only used python as a bash alternative for scripting, even though I’ve heard it’s capable of more. Can you explain what makes it bad for larger/frontend projects?

    jflorez ,

    Before 3.9 the lack of type hints made it a nightmare for large projects. Strong typing is, among other benefits, a way of self documentation and helps IDEs with auto-complete. If I use Python I always use type hints and if I have to use JS sigo with Typescript instead

    pazukaza ,

    Python without type hints is torture. I always need to have the fucking docs opened for anything, and if the docs are bad you’re screwed, get ready to read the source code. Like fucking hell man, just let me autocomplete this shit…

    dwraf_of_ignorance ,
    @dwraf_of_ignorance@programming.dev avatar

    What languages did you use 2 decades before?

    Valmond ,

    Turbo Pascal, Go, assembler and Basic I guess :-D

    dwraf_of_ignorance ,
    @dwraf_of_ignorance@programming.dev avatar

    What languages did you use 2 decades before?

    pazukaza ,

    Well, it’s not like you have any option. Browsers only run Javascript, right?

    Valmond ,

    Well you can do it the ‘old’ way serving front (pages) from the back like PHP did it.

    pazukaza ,

    Ah ok, server side rendering with no JS. I mean, server-side rendering is good. But a front with no JS? Idk, the page would feel pretty outdated. I wonder if there modern front-ends with zero js.

    AnonymousLlama , to programmerhumor in Programming Languages
    @AnonymousLlama@kbin.social avatar

    Every few years I go back to giving JS a chance and every time I'm left frustrated. At least it's not as bad as it was a decade ago I guess

    abraxas ,

    So bizarre how life experience drives attitude. I’m one of those who has worked in a dozen languages, and Javascript (well, Typescript now) simply wins out for me. I run a C# team right now (have been for nearly a decade), and I can say as much as I love my job I hate the language. We get less done with slower code and with more bugs and more (very talented) people than the little $10M operation 4 of us did with node.js a couple jobs ago.

    And as an aftethought since language and tooling are different topics… the ops toolchains for javascript are so much better than anything I’ve worked in any other language. Code released to production often ends up costing us less (dollar value) in the time to deploy, and then less per-user and per-hour.

    I know a lot of C# diehards and I respect their passion. I just cannot relate to their experience. And I can say that with over a decade of experience in many of the languages in the original meme.

    WeDoTheWeirdStuff , to programmerhumor in Programming Languages

    Python?

    lowleveldata , to programmerhumor in Programming Languages

    ah yes programming languages are jokes themselves, and not the programmers using the wrong tools for the wrong job

    Kryomaani ,

    While true, there are some languages that are the wrong tool for every job. JS is one of them. I’ve dreamt of a future where web frontends switched to something sane but instead we got stuff like typescript which is like trying to erect steel beams in quicksand. For web frontends I can understand that historical reasons have lead to this but whoever came up with node thinking JS would be a great backend language has a lot of explaining to do.

    ParsnipWitch ,

    I am also interested if anyone can tell me the exact time in our history when JavaScript turned from “Don’t you ever use that anywhere on your websites!” into “It’s basically every website”.

    abraxas ,

    It was when better sandboxing came out and the only valid complaints about javascript became invalid.

    I was there. It was a good time.

    LeFantome ,

    XMLHttpRequest

    salient_one ,
    @salient_one@lemmy.villa-straylight.social avatar

    Probably when V8 came out. Also Node.js.

    abraxas ,

    I happened to be a fullstack developer when the transition happened, so I saw it firsthand. I would say it predated V8 by a year or two. By the time V8 came out, I was already writing plenty of (simple) javascript for applications.

    I would say it was more about plugged security holes and Ajax becoming more viable for real-world use. The “don’t ever use javascript” rule came from people disabling javascript because javascript was being used for malware. V8 was a part of that transition and growth, but at least in my memory not the shot that started it all.

    There were developers (and books) pushing Rails+Ajax pretty hard in 2007, a full year before V8’s first release in September of 2008.

    salient_one ,
    @salient_one@lemmy.villa-straylight.social avatar

    You’re right! I stand corrected and thank you for sharing. There were already big JS apps (notably, Gmail in 2004) before V8 came out. Yet, am I wrong to think Node.js started the JS obsession that lasted for a while?

    abraxas ,

    I think that’s a hard question. Node definitely helped evolve it. The idea of isomorphism was slow-growing (and yes, originally pretty rocky), but foundational to what we now see as web development. But if I really had to describe the start of the “JS obsession” by my experience, it would be the AJAX explosion, which led to the advent of the “web-based app”. That very first moment of realization that yes, you can do anything on the web. It might be hard for a developer who started after that time, but functionality used to be relegated to windowed and console apps. In that world, you could imagine how useless javascript must have seemed - why do I need to write code to give “functionality” to what was basically seen as a remote pdf?

    But then, I think there’s no surprise to the fact every big company under the sun has some critical contribution to server-side javascript. Back then, most of the dev world were using Perl, Python, Ruby, PHP for their web backends (Java, VB, and C# were used, but too damn hard to write in). At best, those languages were non-ideal but reasonably comparable to javascript. At worst, some of those languages (Perl, lookin at you) were worse than javascript at all the reasons people make fun of javascript now.

    It took a while to kick Rails off the “next big thing” podium, but it was pretty quick that Node was showing offerings that were just better than Perl-catalyst or early Python-Django. It’s funny, Rails was the one with fancy ways to ship javascript from server routes (what a shit show that tech was) back when Node was establishing new best practices on non-isomorphic web apps. I remember when Hapi first came out, backed by Walmart. I then went from being a node hobbiest to believing it was the future. 1 year later I was running a scrappy little node team and we had this little $10M+ telephony app (of all things).

    salient_one ,
    @salient_one@lemmy.villa-straylight.social avatar

    Thank you, that was an interesting read!

    LeFantome ,

    XMLHttpRequest

    lorgo_numputz ,

    I’ve commented to my cow-orkers that “Typescript is the bag they put over Javascript’s face so you don’t have to look at it anymore.”

    pazukaza ,

    Come on, Javascript is pretty nasty. Trying to read that shit always gives me brain tumors. Why do they need to wrap every fucking thing in a function inside a function inside a function that is passed as a parameter to a function inside another function?

    Like, bro, you know people are meant to understand what you just wrote?

    It just gives too much freedom and people forget they need to write code that is easy to read for people who aren’t totally familiar with the code base.

    They even bring that shit into typescript. Like they are already using a language that is meant to fix that shit and they are like, nope, let me create 5 nested functions just because.

    NotSteve_ ,

    Can you give an example of the multi nested functions? I was a TS dev for a while and don’t remember anything like that. Unless you mean the promise callback functions. Those were a mess but luckily we’ve mostly moved away from those

    pazukaza ,

    People creating functions as objects inside of other functions. A few days ago saw a person create a function with two object functions inside, then passed one of the functions as an argument to the other function. Then returned the second function.

    It’s hard to find such a mess in other languages. Yeha, functions as objects are cool. Closures are also cool… But why abuse that shit?

    NotSteve_ ,

    Ahh I remember that sort of JS programming from way back. Do people still do that?? You can just create a class now

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines