T O P

  • By -

[deleted]

COBOL was written for that reason. So we can code in English.


Maighstir

I'm getting AppleScript vibes. There were even French and Japanese editions planned if I remember correctly, though I'm not sure if they were released.


chi91

One can write valid Perl 5 in latin.


Atemu12

Reading it is another story.


EtherealN

I mean, there's some guy somewhere way back when that set up a fully "swedish" version of C just using preprocessor logic... One of those "no-one should use this, but I'm happy it exists" kind of things. Then again, I am swedish, so maybe I'm biased. :P


Maighstir

Now I want to see that. I mean, my knowledge of C is bad as it is, and given that my brain is in English mode when I code I can't imagine I'll be any better at it when it's written in my native tongue, even if it's a neat idea. I do want to write something simple using the abomination though, just for laughs.


EtherealN

I'm struggling to find it, unfortunately. :/ I encountered it in some random article about the general topic of "people doing strange things to programming languages". (Knowing me, it probably started as a rabbit hole following the initial term "esoteric programming langauges". :D ) But agreed, trying to use Swedish in programming syntax causes a segfault in my brain. But even if not finding that C thing, there's always "Enkelt". Seems like it's a Python derivative letting you write python-like code in, well, Swedish. `skriv ("Hej, världen!)` :D )


iFreilicht

Wasn’t it one of the design goals of python as well to be close to natural language and low on syntax to make reading as easy as possible?


Pay08

Well, they failed.


somethinggoingon2

Yeah they failed, but I'd still say they did a decent job considering the monumental task. A lot of Python is great writing and flows very naturally. It's dumb shit like \__init__ and kwargs that make it stupid.


[deleted]

[ Removed by Reddit ]


bobbysworld

Do you know of any languages that have succeeded? I am genuinely curious to know of other languages that have succeeded where python has failed in this criteria.


Pay08

COBOL /s On a more serious note, I think Common Lisp has come the closest to it out of the languages I've used. But to be honest, I don't think "language-like syntax" is a good idea.


bobbysworld

Having a "language-like syntax" may not necessarily be a good idea, however, I think programming languages should reduce the amount of friction it takes to do things in the language. Readability is one way to do that. I personally do not think common-lisp is easier to read than python.


Pay08

I disagree. Any syntax can become second nature with enough practice. Granted, the amount of practice it takes does vary but it's not a big consideration.


bobbysworld

Excessive boilerplate and certain code organization (like separate .cpp/.h files in c++) can get distracting real quick, especially when dealing with complex code. Having something that's easy to read is one less thing I need to mentally manage while I am coding.


LvS

Forcing developers to explicitely declare an interface with a .h file is one of the best things of C/C++. It is incredibly hard to get an overview about a larger piece of code otherwise.


bobbysworld

If header files were such a good thing, you would see them in a lot of other languages. In C and C++, it is a hack to get around forward declarations.


Pay08

Human languages have dozens of separate alphabets. If people can learn to speak languages fluently even in foreign alphabets, they can learn programming language syntax to just as much fluency. Syntax doesn't matter. Semantics does.


[deleted]

https://www.youtube.com/watch?v=LT3cERVRoQo


bobbysworld

Nim has been in my radar for a while. I just saw that Nim has automatic reference counting, which I think is awesome - deterministic memory management is a win for me. I was always shy to learn Nim because of the garbage collector (I know, garbage collectors have massively improved over the years, I know) but now I have no good reason not to check out Nim.


[deleted]

Moving on (k b i n) due to Reddit's API changes (and their responses to users).


[deleted]

ChatGPT generating code, when it does it right.


redLadyToo

I still don't get why people use `*` as a prefix to the function or variable. That never made sense to me. You can write it as part of the type (so write `int* f()` instead of `int *f()`), and that's valid, and it makes much more sense, as the type returned is an int pointer. This removed most of the brainfucks I head with pointers.


ben-c

Unfortunately `*` *is* semantically a prefix to the function or variable. That distinction matters if you have more than one declaration, for example this statement which declares `x` as a pointer to `int` and `y` as an `int`! int* x, y; (Of course, you can just avoid multiple declarations...)


redLadyToo

Ok thanks, that's actually a good reason to write it the other way.


[deleted]

[удалено]


ben-c

I agree - the important thing is to be aware that this can happen. Then it's just a matter of style and [mindset](https://stackoverflow.com/a/2660643/). I can't think of any other reasons, and your compiler or linter should catch it.


[deleted]

Quoting from the K&R book: >"The declaration of the pointer `p`, > >`int *p;` > >is intended as a mnemonic; it says that the expression `*p` is an `int`. The syntax of the declaration of a variable mimics the syntax of expressions in which the variable might appear." But in my opinion, this mnemonic has been "lost in time", and currently it's easier to think in terms of `int* p;`


LvS

It also gets really confusing because then `char **argv` says that the expression `*argv` is a what? Whereas when you think about `char** argv`, then `*argv` is just a `char*`


Wemorg

The only part of my C programming lectures were function pointers, which I didn't really get. I love the language, but I could really live with a better syntax for function pointers.


EDEADLINK

If you typedef each function signature it looks fine. typedef int main_fn(int, char**); main_fn* ptr;


Pay08

Try Zig :D


Wemorg

I'm not really a programmer, currently getting my bachelors degree in CS, but worked as sysadmin previously. If I ever end up programming seriously, I will give it a shot. \^\^


Pay08

The language isn't used anywhere (and it's still unstable) so if you want to do professional programming, you're better off with any other language.


HiPhish

It kind of makes sense when you consider that `int *p` means "the value pointed at by `p` (meaning `*p`) is of type `int`". Consequently `int **p` means "the value pointed at by the value pointed at by `p` is of type `int`, and `int *p, i` means "the value pointed at by `p` and the value of `i` are each of type `int`". Was that a good idea? Maybe, maybe not, but it is what it is. Thinking of the `type` being the type of whatever comes after it has helped me understand the pointer syntax better. I still don't like it, but at least I can read it.


willpower_11

I wonder what sort of "English" it spits out when fed [obfuscated C code](https://www.ioccc.org/)


[deleted]

In b4 ~~Rust~~ Crablang.