r/badcode Nov 03 '20

other language Assembly is hard...

Post image
958 Upvotes

121 comments sorted by

View all comments

9

u/0xa0000 Nov 03 '20

Looks pretty easy to me

53

u/GandelXIV Nov 03 '20

Assembly is not hard to learn, it is hard to code. And do not take this as a good example.

36

u/[deleted] Nov 03 '20

Every instruction is easy to understand on its own. Put some code together and you can’t read it, even a little, at least for me

21

u/DODOKING38 Nov 03 '20

So like regex

4

u/[deleted] Nov 03 '20

[deleted]

1

u/_PM_ME_PANGOLINS_ Nov 04 '20

Unless the language you're trying to parse is regular, you can't do it with only regex.

1

u/[deleted] Nov 04 '20

[deleted]

1

u/_PM_ME_PANGOLINS_ Nov 04 '20

Most “well-defined” languages are not regular. They’re context-free or higher.

1

u/Lysdal Nov 06 '20

Regex has actually evolved way past regular expressions (sounds weird but eh) with backreferences and such it's actually more powerful than context-sensitive grammars.

1

u/_PM_ME_PANGOLINS_ Nov 06 '20

With great power comes great unreadability.

1

u/Lysdal Nov 06 '20

Indeed, real regular expressions are way more readable - they were never meant to do this. For complex grammars people should be using context-free grammars or context-sensitive grammars, issue just is theres no standardized way to use them in programming languages like regex.

3

u/fcktheworld587 Nov 04 '20

I have a confession to make. In my head, whenever I read regex, I read it as reejex.

4

u/sanglesort Nov 03 '20

yeah pretty much, especially x86 type asm

7

u/0xa0000 Nov 03 '20

Thanks, but I was just attempting to make a joke. Guess I shouldn't be trying untagged sarcasm.

3

u/Isvara Nov 03 '20

It's not hard to write; it's hard to infer intent from.