When the grey beards wake up they’re going to be fuming

int main() {}

Seriously. why isn’t there any C love around here?

How about some fun?

macniel
link
fedilink
41Y

Kotlin?

Yes

Andrew
link
fedilink
341Y

How about some fn instead?

So much better

Xylight (Photon dev)
link
fedilink
English
121Y

these puns are getting funcy

Chef’s kiss 👌

pub async fn foo() -> Pin>>>>>

oh fuck commonmark cant display the syntax :( well anyone who has done async rust can imagine

Pin<Box<dyn Future<Output=Result<AsyncResponseThatYouWillHaveToAwaitAgain<ActualResultType>, InscrutableErrorTypeThatDoesntImplementDisplay>> + Send + Sync + 'static + 20MillionMoreAutoTraits>>

Exactly, now we are talking

p a f fn(){}

@sbv@sh.itjust.works
link
fedilink
English
251Y

fun is the punchable face of keywords. I don’t know why, but I hate it.

I prefer good old def

For me it’s friend

Oh, you’re no fun.

^I’ll see myself out.^

autokludge
link
fedilink
English
121Y

How about some (defun)?

deleted by creator

darcy
link
fedilink
51Y

better than function

boletus
link
fedilink
331Y

Python is fine as a language I guess

But python programmers give it a bad name. I’ve never seen “well written” python code, it’s always shit that’s been thrown together cos it works.

It badly needs strong typing. And braces.

boletus
link
fedilink
41Y

I think python is good as it is for what it can do, mostly because I have no reason to use it.

What we need is lua with types!

Shush
link
fedilink
31Y

Have you heard of Typescript-to-lua? I used to do Dota modding (which is in lua) with TSTL and it works great!

You write TS code (using Typescript syntax that includes types) and it is compiled into lua.

Wonder if that could be an alternative that can work for you.

boletus
link
fedilink
21Y

That sounds pretty neat thank you. At some point lua had an official typed extension that is no longer maintained unfortunately. Hopefully there’s a stable fork one day.

Shush
link
fedilink
11Y

Oh yeah, I heard it was poorly recieved. The syntax wasn’t great and generally the support sucked. AFAIK there is no progress on types for lua.

just put int_ or str_ in front of your variables

problem solved 😌

Doesn’t Python 3 have types? I’ve seen a few well typed codebases and it really made the code much easier to understand. Or is it just that it’s not checking them strongly enough?

The type annotations are just fancy comments. They do not do anything at runtime. If you have a function that takes an int someone can still pass in a list or anything else.

But will it run? I’m used to typescript where it’s not checked at runtime but you can’t “build” unsafe types I’d assume it’s the same here

no they really are just fancy comments. You can do runtime reflection on them if you wanna make something fancy like a plugin system but that’s about it

boletus
link
fedilink
31Y

The main advantage of typing for me is static linting.

I use python exclusively when I want to quickly throw some shit together that nobody’s ever gonna spend any time maintaining, so that tracks.

Python sucks ass. Try Go if you don’t like Java

darcy
link
fedilink
01Y

i agree. python only be used if absolutely necessary, such as machine learning and what not. and only because of its popularity and libraries. scripting? try bash or lua. making a cli/tui? try rust or c or something. web backend? god have mercy if you decide to use python for that.

DarkenLM
link
fedilink
81Y

“Web backend”

Youtube has been real silent since that one dropped.

ripcord
link
fedilink
11Y

<ooo look we got a badass over here meme>

Having worked on all 3 of those I prefer python. I think C# is a much better Java alternative though. But it would depend on the project of course. Something like Python of JavaScript is nice for faster development. That’s my jam lol.

As for it sucking ass. Idk about that but it may be a cool feature to try out

That’s a nice argument, Senator. Care to back it up with a source?

Source: Global Interpreter Lock

GIL is awful for parallelism, but lots of problems don’t require threads.

@pingveno@lemmy.ml
link
fedilink
English
161Y

Much less of a big deal for most applications. For the applications that need it in some areas, use PyO3 to write a module in Rust. Of course, Python’s not going to be the perfect tool for every job, and that’s okay.

Nooo if a proframming language is not the best choice for every job it is worthless and all the programmers using it are heathens!

Except of course for the language i prefer because i am one of the few to not go insane doing application xy in it.

Well, I’ll be damned. Are you sure I’m still alive? Is Hell still hot? Pigs don’t have feathers yet, right?

pipenv venv virtualenv pyenv poetry

Spin the wheel

Depends what you are working on.

Like all languages, they all have pros and cons.

Language evangelism doesn’t help really…

While I personally agree that Python sucks, largely because I don’t agree with whitespace indentation defining blocks and I also don’t like Java…I’m neutral on Go, depending on the use case.

I know plenty of people who love Python, but I kind of wonder if it’s because they were brought up on it. I wasn’t. So we’re just in different camps. Whatever floats your boat I guess.

I was brought up on Python and also do not like it for a variety of reasons, both practical and by personal preference. I also have the opinion that if you are trying to learn software engineering it is not a good language to start out with, despite it being so easy to pick up at first.

Some people try to use Python’s popularity as a counterpoint, and while it does show that my view is a minority opinion, it’s not a very convincing argument for the language itself.

if you are trying to learn software engineering it is not a good language to start out with

Curious what options you would suggest instead? I’m an old C/++ embedded diehard, but I do use Python and have been considering it as the next step for my 9yo daughter after Scratch.

Python feels like the modern replacement for Basic that I grew up with as a kid. Interpreted, garbage collected, good library support, sane typing and not too wordy or confusing. Lots of options to do fun things with it from games to robots.

IMO for a young beginner the C-likes are too strict and segfault-y, Perl is too permissive and could breed sloppy habits, Basic is obsolete, all the web languages are way too application specific, I haven’t had a chance to get into Rust yet, and fuck Java as a matter of principle lol.

Well, I think for a 9 year old it’s fine. I think the stage where you would run into issues is when trying to get into “actual” software development, where the flexibility in scoping and typing afforded by Python can lead to some bad habits (e.g. overusing global/shared variables, declaring them from within functions, catching errors late instead of validating data first, …)

I don’t have a ton of experience with it but I think C# strikes a pretty good balance between strictness and beginner-friendliness. Modern Java isn’t all that bad either, though it doesn’t have very good options for fun things to build. But again, I don’t think this necessarily applies to a child; I’m an educator at a university so both my target audience and point of reference are freshman compsci students.

Thanks for your input, C# is a language I never really considered but it does sound like a good middle ground and possibility a good successor to Python for her. Very popular, powerful and a better approach to a “true OOP” language than Java IMO. Though as you state modern Java has come a long way from its origins.

overusing global/shared variables

I see you’ve been reviewing my Python code, lol. The structure of the language does lend itself to using globals as a shortcut when they shouldn’t be… And as a primary embedded dev I will admit that I’m already a heavier user of globals than most. But I agree being able to declare global variables inside a function is pretty gross, as is the scoping/declaration issue where you can easily end up with global and local variables with the same name without even throwing a warning.

you’ve probably read this many times before. prototyping, three users applications, routine, quick test, owning pretentious kids with some class inheritance, medium / small company data processing, free very good editors with all you need to code/debug, speed not necessary, my boss doesn’t like it… stuff like that

I love python just because of the community. It is a very popular beginner language (for better or for worse, depending on who you ask) and its community has grown to embrace that. They have the most active Discord I’ve seen for a language and they do a lot to curb elitism and plain old rudeness. Not that other communities are necessarily bad, but the Python community is where I end up whenever I really want to feel passionate about programming.

The Gay Tramp
link
fedilink
English
-51Y

Who doesn’t use arrow functions?

Arrow functions should be used only for callbacks. I hate that people has started defining named functions with arrow functions in JS. Arrow functions are not hoisted and the ordering of your functions is going to get wonky, because you need to define all you functions first before composing them, when it should be the other way around. Start with the most high-level function which calls lower level functions.

🔻Sleepless One🔻
link
fedilink
English
21Y

I think there’s also a good case to use them if your function is just evaluating and returning a single expression.

Paradoxvoid
link
fedilink
English
61Y

I had this exact fight with my team several months ago, and lost to popular opinion since the rest of my team are either zoomers or indifferent.

I’ve reached the point that I cringe at the mention of arrow functions because so many people seem to always want to use arrow functions.

Like I’m looking up something on stack overflow and half the answers are arrow functions that are that way for no other reason than to use the fun little =>

All good programming teams are run as benevolent dictatorships for precisely this kind of reason.

sum(your_mom &lt;- rep(69, 420))

NaN

your_mom is undefined

It’s being assigned and passed to sum at the same time. One of the many entertaining quirks of R.

Ewww default exports. Explicit named exports are better! And so it begins

👍Maximum Derek👍
link
fedilink
English
191Y

How very dare you share my opinion!

PascalCase default exports for Classes

camelCase named exports for functions

ALL_CAPS named exports for constants

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 120 users / day
  • 257 users / week
  • 744 users / month
  • 3.72K users / 6 months
  • 1 subscriber
  • 1.48K Posts
  • 32.7K Comments
  • Modlog