this post was submitted on 30 Nov 2024
45 points (84.6% liked)

Programmer Humor

19747 readers
479 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 2 days ago

did someone call me

[–] [email protected] 6 points 3 days ago (1 children)

It's stupid to participate on either side of this discussion. If you think it's not a "real" language you are applying a 100% arbitrary definition to it, and if you say it is a "real language" you are conceding that calling it "not real" even makes sense in some way (which it doesn't).

Personally I like languages with real and strong data types but people are free to use whatever language they like most.

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

For the last time, Python is not weakly typed. It is dynamically typed. The statement 5 + "hello" results in a type error. Bash is weakly typed, and that same addition results in 5hello

[–] [email protected] 0 points 2 days ago (1 children)

Why do people think Python is ducktyped? The syntax is quite explicit, just because x = 5. is shorthand for x = float(5) doesn't mean it's doing weird mutations. The closest would be maybe that something like:

x = 5
y = 2.
z = x * y

works (I think) but that's not exactly a wacky behaviour. It's not like it ever does the wrong behaviour of casting a float to an int which can erase meaningful data and cause unpredictable behaviour.

I mean you can (and often should!) give functions/methods type signatures ffs.

[–] [email protected] 7 points 2 days ago* (last edited 2 days ago) (1 children)

Because to a certain extent Python is duck typed. Python has no concept of interfaces, unless you count the abc module combined with manual isinstance() checks, which I've never seen anyone do in production. In order to be passed to some function that expects a "file-like object", it just has to have methods named read(), seek(), and possibly isatty(). The Python philosophy, at least as I see it, is "as long as it has methods named walk() and quack(), it's close enough to a duck for me to treat it as one".

Duck typing is distinct from weak type systems, though.

[–] FooBarrington 2 points 2 days ago

Python has Interfaces in the form of protocols, but those are explicitly duck-typed

[–] [email protected] 2 points 2 days ago

Oh ok but what aboutt my HTTML? I made websute with it. So i'm suree its a programming lamguage

[–] [email protected] 2 points 4 days ago (2 children)

I personally draw a distinction between "real" programming languages and scripting languages. Scripting languages being languages that are traditionally source distributed. They tend to be much easier to write, run slower, often but not always dynamically typed, and operate at a higher level than "real" programming languages. That's not to say they aren't actually useful or difficult to learn etc. It's not a demeaning separation, just a useful categorization IMO. Not to say the categorization always holds water in all those attributes, luajit is way faster than Java but it does follow the other bits. As someone who loves C there are lots of languages that seem too limiting and high level, doesn't mean they aren't useful tho.

[–] [email protected] 9 points 2 days ago (1 children)

Surely "compiled" Vs "scripting" langs is better than throwing around (at best) meaningless terms like "real"

[–] [email protected] 1 points 2 days ago

Yeah I agree, they are but I guess what I'm trying to get at is in day to day conversation I use "programming language" as a term for compiled languages hence "real" and "scripting language" for scripting languages. I never say "real" in conversation, just in the context of this post and as I mentioned it's not to say scripting languages aren't good languages, just how I separate them. Your distinction is much better in more comparative dialog such as this

[–] [email protected] 4 points 3 days ago (1 children)

That line is blurring to the point where it barely exists any more. Compiled languages are becoming increasingly dynamic (e.g. JIT compilation, code generation at runtime) and interpreted languages are getting compiled. JavaScript is a great example: V8 uses LLVM (a traditional compiler) to optimize and compile hot functions into machine code.

IMO the only definition of “real” programming language that makes any sense is a (Turing complete) language you can realistically build production systems with. Anything else is pointlessly pedantic or gatekeeping.

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

I'm aware of the increasing prevalence of JIT, that doesn't change the other markers I listed. Ironically though the language the post is about, CPython still lacks JIT. Also I disagree in general, there are things scripting languages can't do and will never be practical for. It's not that they aren't useful programming languages, that's not what I'm saying but I think having a separate category for them is useful.

[–] [email protected] 2 points 2 days ago

Scripting languages being languages that are traditionally source distributed.

  • Source distributed means you can read the source if it hasn't been obfuscated. OTOH, it is trivial to decompile Java and C# so this isn't a real difference for those languages (which happen to be compiled languages). So it's only relevant for languages specifically compiled to machine code.
  • Source distributed means the recipient needs to install something. OTOH, Java and C#, again.

So the only ways that the distribution mechanism matter are really a difference between How does the distribution mechanism matter beyond that? And even those points are

They tend to be much easier to write

I'm assuming you are not saying "real" languages should be hard to write...

run slower

Objective-C and Go run slower than C and they're all compiled languages. Sure, an interpreter will be slower than a compiled language but modern languages aren't simply interpreted (i.e. JIT, etc).

often but not always dynamically typed, and operate at a higher level

There are dynamically typed compiled languages, and high level compiled languages.

It’s not a demeaning separation, just a useful categorization IMO.

Calling one class of languages "real" and another class something else is inherently demeaning. I wouldn't have cared enough to type this if you used "compiled vs scripting" instead of "real vs scripting". Though I disagree with using "scripting" at all to describe a language since that's an assertion of how you use the language, not of the language itself. "Interpreted" on the other hand is a descriptor of the language itself.

As someone who loves C there are lots of languages that seem too limiting and high level, doesn’t mean they aren’t useful tho.

I personally can't stand Java because the language designers decided to remove 'dangerous' features like pointers and unsigned integers because apparently programmers are children who are incapable of handling the risk. On the other hand I love Go. It's high level enough to be enjoyable and easy to write, but if you want to get into the weeds you can.