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
link
fedilink
English
41Y

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

APL and J have made there appearance in here with their awkward syntax and have the advantage of being practical languages in actual use.

Esolanguages are often things that are designed to be difficult in some way, shape, or form. Brainfuck is awkward, but it’s the source of some interesting problems that are only practical because it is such a simple language.

The thing is, once you get your head around it, it isn’t too bad of a language.

I was introduced to FRACTRAN (wiki) in Project Euler - https://projecteuler.net/problem=308

That one… still is beautiful and confusing. It’s based on the manipulation of variables through Gödel numbering (wiki). The program: ( 455/33 , 11/13 , 1/11 , 3/7 , 11/2 , 1/3 ) will multiply the exponents of 2a3b leaving the result in 5ab.

The program ( 17/91 , 78/85 , 19/51 , 23/38 , 29/33 , 77/29 95/23 , 77/19 , 1/17 , 11/13 , 13/11 , 15/2 , 1/7 , 55/1 ) will loop forever, however as it runs the state of the program will occasionally be just a power of 2 with all the other powers (variables) being zero. Those values are: 22 , 23 , 25 , 27 , 211 , 213 , … and so on. It computes prime numbers and stores them in the power of 2 before going to compute the next one.

While I understand the idea of Gödel numbering, the manipulation of those numbers through this process still is difficult for me.

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.

you can waste your whole life

chuckles I am in danger

@sping@lemmy.sdf.org
link
fedilink
English
181Y

Perl is a write-only language.

I love perl. 20y on I still think in perl.

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.

@sping@lemmy.sdf.org
link
fedilink
English
5
edit-2
1Y

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

Those magic match variables from regexen weren’t very legible if you weren’t a little familiar with them, but they were super useful in lots of cases. Perl could be a godsend to quickly parse lots of text.

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.

@AA5B@lemmy.world
link
fedilink
1
edit-2
1Y

I had the most problems with Ruby, or was that Rails. However I have to admit I gave up quickly. It left me with the impression the language itself doesn’t do much but the magic is all in the framework. You can’t follow the logic but have to know where things are, you have to know whatever assumptions the framework started with, but they don’t seem to be set anywhere.

That was the paradigm jump I didn’t make, didn’t want to make. APL was just so much more straightforward, because it was logical. Variants of C and Java are all pretty easy. PERL and Groovy have been two of my favorites except I’m a strong believer in strict variable typing. I have to admit Python took some getting used to, because who makes spacing part of your code structure these days: I thought we gave that up many decades ago. The COBOLs of the world are pretty focused - I’m not sure if even call them a programming language, but fairly easy to embed a query or report in a real language

From personal experience making the jump from Python to Julia was overall painless, it was probably made to be as well. I do agree that rust on the other end is something else. Even after clearing the whole rustlings course I was still brute forcing my way through code by relying on the compiler to tell me where borrowers were missing. Spoiler: everywhere!

I’m not much of a programmer, but when I was a kid I used to play around in QBasic. Then dropped all programming for decades and picked up Lua a few years back. Made me realise it’s more of a dialect than a new language.

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.

Clojure : if lisp had an illegitimate baby with java. Add to it the pain of setting up fireplace in vim or having to use emacs. At a former employer we had one area in closure. I could read it without much difficulty but damn if it didn’t take me weeks to write or update it

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.

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.

Drew Belloc
link
fedilink
351Y

Brainfuck

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.

Drew Belloc
link
fedilink
21Y

You have a point

pinchcramp
link
fedilink
English
70
edit-2
1Y

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 🤷

Lupec
link
fedilink
111Y

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.

My running joke, after four different friends told me they were using ChatGPT to help them with it, is that the language is so hard to learn that we invented an entirely new class of AI to help.

It’s a joke, of course, but it does have some “surprising” syntax, since some stuff is whitespace sensitive, and there are subtle differences between () and [] and [[ ]], for example. All of that’s due to the long history of shell behavior, so I don’t necessarily blame bash.

JackbyDev
link
fedilink
English
31Y

Yeah, anything to do with iterative over strings. Basically anything that involves IFS is unintuitive.

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

@nous@programming.dev
link
fedilink
English
101Y

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.

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

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.

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

It’s not necessarily PS itself, I bet it would be fine on a Linux machine with a typical Linux terminal. It’s just that I cannot stand the rest of Windows, especially the CLI part, especially cmd: Awful to no tab complete support, no command history across cmd restarts, if tab complete works its only for files and even sucks there because of the ignore case design and completing a full name instead of to the next clear step (eg. “tes” for a dir containing “test.exe” and “test.mp4” will complete to “test.exe” instead of “test.”). Additionally, I associate PS with Windows and tasks on it. Most things I want to run on Linux only I write in C/C++ (depending on the task itself ofc). If I want compatibility with Linux and Windows I use python. To install that script to a usable state it’s literally a single command on Linux, if the method of transferring the script (probably a git repo) supports saving the executable permission bit: sudo cp script.py /usr/local/bin/patchjar.py. Even if you want an own directory with your own path, that’s no problem: Just cp a .sh file to /etc/profile.d/ that appends to the path. And removing it is as easy as deleting that file. On Windows? Chocolatey has a ~100 line script just for that purpose, backs up the path just in case and even explicitly states uninstall it can break your whole system? Why? Because Windows uses a single global PATH variable for everything. You need to edit the registry, extract your path with loops, remove it and write it back. And that’s a pattern being repeated through the whole OS. You want to move a window on the screen or start something on another monitor? Well fuck you. On Linux? assign [app_id=TuxKart] workspace gaming. For an OS claiming to be integrated with everything in itself that seems like pretty damn dumb and frustrating to a dev.

You’re talking about PowerShell but then complaining about cmd. Are you unaware that PowerShell is its own cli?

@lud@lemm.ee
link
fedilink
31Y

You shouldn’t really use CMD at all anymore. It’s pretty shit. Just use PowerShell (I prefer the newer version 7)

I have done a lot of powershell scripting and found some very annoying edge cases, they all have solutions, but feels unnecessary. I once had a issue, where I had a dynamic array of strings and if thst array was only 1 long it would give you the first character instead of the first string. I don’t know exactly what made that happen, but I think it had something to do with functions or classes.

I can see how PS might be better for writing actual programs in but the wordiness really gets in the way when youre just trying to write something on the command line so it feels poorly optimized for cli usage. Bash is very poorly optimized for writing programs otoh.

The object model is much easier to understand in PowerShell.

My main issue with PS is that it is JavaScripty. And by that I mean, it makes tons of assumptions on what I “mean” by my command. And it’s usually right and thus I don’t see any issues. But when those assumptions are wrong, I have to do all kinds of parameter fuckery to make it be what I “expect”.

None of that is true is bash. It doesn’t make many assumptions at all (at least none that I’ve come across). Things act the same when I’m using bash in a script vs the cli vs over an ssh connection vs within a subshell, etc.

And ya the whole “it’s pretty verbose” is irritating too (though that could also be a counter argument against bash relying on magic variables and abusing the shit out of symbols).

I don’t hate PS but I don’t enjoy spending time in it. I don’t hate bash but it hurts me less when I use it

UFO
link
fedilink
21Y

I don’t think it’s just a you problem :)

I’ve been curious to try fish or zsh to hopefully run into less weirdness.

pinchcramp
link
fedilink
English
2
edit-2
1Y

I don’t think it’s just a you problem :)

I didn’t think so. I guess Reddit has conditioned me to not state my opinion without a disclaimer, lest someone wants to start arguing :D

Btw. I don’t think you’ll find ZSH more intuitive to program. While it is an awesome interactive shell, the scripting part is Bash taken to the extreme.

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

malbolge

and just after haskell

@nyan@lemmy.cafe
link
fedilink
English
21Y

Forth. Gotta love that RPN . . .

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

qevlarr
link
fedilink
21Y

Uh? It’s about what I expect. Anything in particular?

I honestly don’t think it’s so bad. There are some things which make it look ugly, the Hungarian notation, the fact that it’s a C API which means everything has to be functional and there are many limitations, and there is a lot of legacy stuff kept for backwards compatibility. There is a lot of "we did it this way before we knew the right way of doing it, but now we’re stuck with it because of backwards compatibility.

I think MFC is a lot worse. It’s basically a C++ API that wraps a lot of things from the win32 API. It heavily relies on macros, and I really dislike it in general. And don’t get me started on COM.

@lud@lemm.ee
link
fedilink
5
edit-2
1Y

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 ever time because it will call you overly polite.

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

V H
link
fedilink
11Y

The most delciously evil part of INTERCAL is “COMEFROM” (though COMEFROM was proposed a number of times as a joke long before INTERCAL)

Prolog. I like Prolog but it’s unlike any other language, and it’s pretty hard to fully understand.

I made a Prolog program to solve Sudoku puzzles for a college project. The basics are quite easy, I’d say.

@jeffhykin@lemm.ee
link
fedilink
2
edit-2
1Y

I’d say there’s an initial learning curve of the basics that isn’t bad. Kinda like learning programming for the first time; it’s a different way of thinking and for something like Sudoku I’d say it’s even pleasant.

But when you try to write a CLI videogame, or anything with an evolving internal state, then Prolog stops being the elegant logic system and instead becomes big bundle of edgecases where nothing makes sense practically or theoretically.

V H
link
fedilink
9
edit-2
1Y

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)

https://www.rosettacode.org/wiki/Category:APL and https://www.rosettacode.org/wiki/Category:J for fun links.

ackermann←{
     0=1⊃⍵:1+2⊃⍵
     0=2⊃⍵:∇(¯1+1⊃⍵)1
     ∇(¯1+1⊃⍵),∇(1⊃⍵),¯1+2⊃⍵
 }

Traditional APL required its own typewriter ball for printing out programs.

Create a post

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 !webdev@programming.dev



  • 1 user online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1.11K users / 6 months
  • 1 subscriber
  • 1.21K Posts
  • 17.8K Comments
  • Modlog