this post was submitted on 30 Sep 2023
61 points (85.1% liked)

Programming

17669 readers
211 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 121 points 1 year ago* (last edited 1 year ago) (9 children)

Bash script. Not necessarily hard to understand but very unintuitive in my opinion. I've written so much bash script over the years and still have to look up how to do simple things like iterate over associative arrays or do basic string manipulation. Maybe it's just a me problem though 🀷

[–] [email protected] 40 points 1 year ago (10 children)

I have to write powershell scripts and bash scripts at work. I hear people saying bash is great, powershell is bad, all the time in public, but honestly I feel like these people have barely actually written powershell. It's a bit wordy, but it feels much more intuitive to me, much more akin to regular programming languages.

[–] [email protected] 21 points 1 year ago

It's newer and Microsoft based. Easy way to get a bunch of people on the hate train for those reasons alone.

[–] [email protected] 9 points 1 year ago

PS was built from the ground up to be intuitive. There are some interesting videos from the MS devs talking about the design process.

load more comments (8 replies)
[–] [email protected] 14 points 1 year ago

Bash does have a weird syntax. I too have to look stuff up all the time.

[–] [email protected] 13 points 1 year ago

Yup, same. I've been a developer for years and used to code way before that and to this day I can't write any non trivial bash script without looking up half a dozen of things lol, glad I'm not alone.
I've recently come across nushell, and it's everything I've ever wanted when it comes to shell scripting. It's not POSIX compliant so you can't just run it anywhere but it helps keep my sanity in personal projects and whatnot. See also, elvish, xonsh.

[–] naonintendois 8 points 1 year ago

Even worse is Windows batch scripts. The syntax also changes depending on if it's in the terminal or run from a file

[–] [email protected] 7 points 1 year ago (1 children)

In shell languages, concurrency is easy and everything else is hard.

[–] nous 14 points 1 year ago

Concurrency is not easy if you need the output and exit status of the commands. Fire and forget concurrency/parallelism is easy in any language. It is when you need to sync state up that it becomes hard.

load more comments (4 replies)
[–] drew_belloc 53 points 1 year ago (1 children)
[–] [email protected] 16 points 1 year ago (1 children)

Actually one of the few languages you can learn in its completeness in less than a day, so I wouldn't really say it's "hard to understand". More like hard to read and understands programs written in it.

load more comments (1 replies)
[–] [email protected] 44 points 1 year ago (2 children)

Have you ever taken a look at Windows API, it's disgusting.

load more comments (2 replies)
[–] [email protected] 43 points 1 year ago (3 children)

If by "hard to understand" you're including trying to understand someone else's code, Perl can be a nightmare.

[–] [email protected] 22 points 1 year ago (3 children)

I’ve heard a few people refer to perl as a β€œwrite-only” language.

[–] [email protected] 47 points 1 year ago* (last edited 1 year ago)
// Dear programmer
//
// When I wrote this code, both 
// God and I knew how it worked. 
// Now only God knows!!
//
// Therefore if you are trying to 
// optimise this routine and it fails 
// (most surely) please increase 
// this counter as a warning for the 
// next person
//
// total_hours_wasted_here = 254
[–] [email protected] 8 points 1 year ago (4 children)

There's some truth to it, but it's mostly that junior developers and senior developers with no discipline that give it a bad name.

The major problem is that it has one of the the highest capacities for writting incredibly dense code there is, paired with very powerful language transformation tooling (i.e. switch statements were added as a module, but can also be used for funny evil.)

load more comments (4 replies)
load more comments (1 replies)
load more comments (2 replies)
[–] [email protected] 39 points 1 year ago (3 children)

Depends on what you already know.

Functional languages like Haskell, Clojure or Erlang have a reputation of being hard to grasp.

Rust's borrow mechanics are hard for some people at first, especially because it's very unique to the language.

Javascript can be frustrating because it also has some rare features among popular languages, and uses the same keywords for different concepts. It's not bad at all once you let go of your assumptions and dedicate the time to understand how it works under the hood.

C++ is also notorious for being hard but I haven't used it for a very long time so I can't say anything about it.

[–] tatterdemalion 11 points 1 year ago

Javascript can be frustrating because it also has some rare features among popular languages, and uses the same keywords for different concepts.

I don't think those are the reasons JS is frustrating.

[–] [email protected] 8 points 1 year ago (1 children)

For Erlang I would say that the hard part is not the language itself (maybe a bit because it is influenced by prolog) but because of the mental model. Using concurrency and parallelism as core concepts of the language and understanding that you don't need a lot of the external tools you would with the more mainstream languages is what's hard imo.

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 32 points 1 year ago (2 children)

Perl is a write-only language.

[–] [email protected] 8 points 1 year ago (1 children)

You can write clean Perl easily. But it's maybe a bit easier to write illegible code in Perl than in most other languages. It's all up to you though.

[–] [email protected] 9 points 1 year ago* (last edited 1 year ago) (1 children)

I am just regurgitating one of my favorite Perl jokes for a laugh. Though for me the joke contains some truth. Most of the Perl code I've ever seen is pretty impenetrable for non-Perl programmers. I quite literally have returned to my own Perl efforts after just a couple of weeks and had some trouble working out what the code is doing (in ways I do not experience with other languages).

When Python was trying to unseat Perl, that in my view was reason alone to prefer it: I didn't know Python but I could read Python. Though at that point Perl had the benefit of loads of libraries and ubiquity, and Python hadn't got there yet. But it was enough to have me cheering for Python's success at the expense of Perl. I get that Perl has many virtues, but they're nullified by the ugliness and relative inaccessibility of its code in my eyes.

I really hate the magic side-effect variables where you do a pattern match or something and then various obtusely named variables have meaningful values with relation to the last match. To me that's just flat out bad coding, and it's built into the language.

The above was my second-favorite Perl joke. My favorite being:

Perl is the vise-grips* of programming languages. It's a tool that can do most jobs, and it's the wrong tool for all of them.

*BrEng: mole-grips

load more comments (1 replies)
load more comments (1 replies)
[–] [email protected] 29 points 1 year ago (1 children)

C++ because you have multiple versions, you can write in different styles (C, OOP, functional, meta-stuff, very low level like assembly, very high level like Python), it has undefined behaviors, and you can waste your whole life optimizing code.

[–] [email protected] 9 points 1 year ago

you can waste your whole life

chuckles I am in danger

[–] GuybrushThreepwo0d 28 points 1 year ago

Any language if the code was written by me

[–] JackbyDev 22 points 1 year ago (5 children)

C and C++. The pointer syntax being slightly different than the pointer declaration syntax always confuses me to no end. I conceptually under pointers perfectly but their syntax is wack.

load more comments (5 replies)
[–] noproblemmy 22 points 1 year ago (5 children)

Fearing a bit to say it but Haskell. I know that it is a different concept, but it's not just that for me. The way the elements are separated, sometimes spaces sometimes symbols, makes it hard for me to understand how things are grouped, and what gets plugged into what.

[–] [email protected] 10 points 1 year ago (1 children)

Haskell for sure has a very sloped learning curve. The functional style, different syntax, a myriad of symbols and pragmas, as well as the tooling around it.

The only reason I was able to pick it up as quick as I did was because I was used to Elm due to my job. Then it was just learning about the IO type (and how to use it), cabal, stack, built-in symbols, and the most common pragmas.

But the symbols part is especially harsh, since symbols only hold meaning if they're universally understood. Sure, the base- language ones are kinda adopted at this point, so they'll stay, but the fact that external modules can also make symbols (sometimes without actually-named counterparts) adds some confusion. Like, would you just know what .: is supposed to mean off the top of your head?

load more comments (1 replies)
load more comments (4 replies)
[–] lysdexic 19 points 1 year ago (1 children)

Objective-C and Objective-C++ are an abomination. Extending languages with other language constructs is ok, I guess, but I find Apple's extremely poor documentation to worsen a situation that's already quite bad.

[–] JackbyDev 11 points 1 year ago

Objective C++ sounds scary. Two object systems living totally unaware of each other.

[–] [email protected] 17 points 1 year ago* (last edited 1 year ago) (2 children)

INTERCAL seems pretty hard.

For example, you have to occasionally say PLEASE or else the compiler will throw an error calling you unpolite. You can't also say PLEASE evey time because it will call you overly polite.

Here are some of the other compiler error messages: https://gist.github.com/kconner/a5c73557230dee1f7a3934d6a7abee13

load more comments (2 replies)
[–] [email protected] 14 points 1 year ago (4 children)

The hardest languages to learn are the ones that have a different paradigm than the ones you're used to.

Most modern languages today somehow derive from C, in a way or another. JavaScript, Go, PHP, Java, C#, even Python... If you're used to one of these languages, you should be able to get a high level understanding of code written in other languages. Some like Rust can be a bit harder when diving into idiosyncrasies (e.g. borrow checker and lifetimes), but it's not too hard.

But if I encounter a Lisp, or a more domain-specific language like Julia or Matlab, I need to put in a lot more effort to understand what I'm trying to read. Though Lisps are inherently simple languages, the lack of familiarity with the syntax throws me off.

load more comments (4 replies)
[–] naonintendois 13 points 1 year ago

Malbolge https://en.m.wikipedia.org/wiki/Malbolge

It required a cryptanalyst to write hello world.

[–] [email protected] 13 points 1 year ago (3 children)

I find syntax wise, Rust is very closely bordering on esoteric. My employer is currently considering switching to Rust and I can say working in a department with a bunch of Data Scientists with varying degrees of programming experience and capability, this switch, if it happens, will probably be poorly received.

[–] [email protected] 7 points 1 year ago (2 children)

Prayers man.

We brought in a dept of data scientists when we bought a company.

I never witnessed the worse code ever.

I don't know if they were all 1y bootcamp grads or something. I thought math formulas was supposed to be elegant. But everything was written top-down, no reusability, like coding excel formulas that feed one cell into another and takes a hour or two to calculate. I nope'd so fast out of one "system" they built which was just daisychaining SQL queries into a new file that is fed into another SQL query repeat 7 times.

[–] [email protected] 7 points 1 year ago (3 children)

Mathematicians and scientists are notoriously awful programmers. They get shit done but with absolutely 0 regard to good practices and reusability.

load more comments (3 replies)
load more comments (1 replies)
load more comments (2 replies)
[–] [email protected] 10 points 1 year ago

Probably whitespace.

[–] [email protected] 9 points 1 year ago* (last edited 1 year ago) (1 children)

Ignoring the intentionally esoteric languages, of languages in actual use: J, K. Any descendant of APL, basically, and APL itself, though arguably APL is less obtuse than many of its descendants.

E.g, quicksort in J (EDIT: Note Lemmy seems to still garble it despite the code block; see the Wikipedia page on J for the original and other horrifying examples)

    quicksort=: (($:@(<#[), (=#[), $:@(>#[)) ({~ ?@#)) ^: (1<#)

(No, I can not explain it to you)

load more comments (1 replies)
[–] [email protected] 8 points 1 year ago (1 children)
load more comments (1 replies)
[–] [email protected] 8 points 1 year ago (5 children)

No one has mentioned COBOL yet, but COBOL.

[–] [email protected] 6 points 1 year ago

The college I went to taught COBOL in 2 mainframe courses, and as far as I'm aware, they still do.

It was either you like it, or you absolutely despise it. It wasn't all the difficult, but it is very different than your standard java, C#, C++, etc, so the syntax really throws people off.

load more comments (4 replies)
[–] onlinepersona 7 points 1 year ago (4 children)

Haskell. I'll just repeat what I said elsewhere: monads are escape hatches to imperative programming. The majority of haskell code I've read in projects must've been written by imperative programmers who picked up haskell, because there are monads everywhere.

But the hardest to read are List, then C, then C++. Even PHP is easier to read.

load more comments (4 replies)
[–] [email protected] 7 points 1 year ago
[–] yogsototh 7 points 1 year ago

malbolge

and just after haskell

load more comments
view more: next β€Ί