There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

Lysergid , in JavaScript

How about SQL in PostgreSql query: select array_length(Array[]::text[], 1)Output: null

Dont get me wrong JS is still awful

thurstylark , in JavaScript
bungle_in_the_jungle ,

I come back to watch this every few years. It’s so good!

brbposting ,

How do I know so little about programming yet this is still so funny?

Maybe the neuroscientists have some insight:

https://sh.itjust.works/pictrs/image/e7206940-e3e5-44bd-8f4b-edb85b807f64.jpeg

davidagain ,

You can tell that they find the answers absurd and the WAT memes are universally funny.

bleistift2 ,

I’ve seen this guy referenced twice today. If only he knew how to write instead of giving talks…

ch00f , in JavaScript
tmpod ,
@tmpod@lemmy.pt avatar

Mandatory link

finkrat , in Old timers know

A lot are still doing that and haven’t moved up

(Please at least use SFTP!)

Zip2 , in Old timers know

Oh please, you didn’t even have to turn the cassette or floppy disc over. You and your luxuries.

zzx , in Old timers know

This is how I deployed an app less than 5 years ago (healthcare).

It’s sad

Flipper ,

This is how I deploy my personal website today. The holster doesn’t give ash access.

drathvedro ,

I know a place where they still do this. They’ve got an 8-digit user count, 7 digit monthly profits, all running on one server that costs something like $20 a month. They’ve downsized a few years ago to single-digit employee number and just sit there and collect profits. And this is why I’m now working for a company that casually dropped a few grand for a glorified CPU usage meter and a few grand on top of that for deployment tool that does the same thing that the old guy at a former place was doing with his trusty FTP client.

dan , (edited ) in JavaScript
@dan@upvote.au avatar

Use TypeScript, and nonsensical things like adding arrays to objects will be compile-time errors.

CanadaPlus ,

Yup. The libraries underneath will still allow nonsense at runtime, though, and it will now be harder to see, so it’s a partial solution as done in standard practice.

An all-TypeScript stack, if you could pull it off, would be the way to go.

dan ,
@dan@upvote.au avatar

Most libraries have TypeScript types these days, either bundled directly with the library (common with newer libraries), or as part of the DefinitelyTyped project.

CanadaPlus ,

DefinitelyTyped is the exact kind of thing I’m talking about. You put TypeScript definitions over things, but under the hood it’s still JavaScript and can fail in JavaScript ways.

intensely_human ,

It can’t fail in javascript ways that require specific sequences of code to be written, if those sequences of code aren’t in the range of output of the Typescript compiler.

Cethin ,

So a strictly typed language… I think those already exist.

thevoidzero ,

If there was an easy way to use rust or something on webassemly and use that instead of JS. I’d be so happy, but I can’t find how to do it without npm.

ObstreperousCanadian ,
@ObstreperousCanadian@lemmy.ca avatar

It’s in alpha, but there is a Kotlin to wasm compiler in the works.

MaggiWuerze ,

Does WASM do DOM manipulation nowadays?

intensely_human ,

Just use javascript and don’t try to add {} to [].

CanadaPlus ,

Well, you never try to.

ObstreperousCanadian ,
@ObstreperousCanadian@lemmy.ca avatar

Doesn’t look like it, unfortunately. But it’s planned. Kotlin can also compile to JavaScript with DOM manipulation. I’ve not tried either scenario, myself.

MaggiWuerze ,

I can’t wait for the day I can use something like Kotlin to write Frontend code. Maybe there’ll be something like vue or react build on it

rooroo ,

You could use Java ages ago and it was, very rightly so, abandoned.

MaggiWuerze ,

You meanbJavaFX? Yeah the web version of it never was great

rooroo ,

Even worse, I’m old enough to have used GWT at some point.

MaggiWuerze ,

shudder

CanadaPlus ,

Kotlin -> JavaScript would work. I assume there must be a Python version of that as well.

Ephera ,

We use this framework at work: leptos.dev

CanadaPlus , (edited )

Rust would probably be the wrong tool here. This is scripting, so pointers like Rust is built around aren’t really meaningful. Kotlin or Python or something are more on the ticket.

anton ,

Websites have grown beyond mere scripting.
Rust is about more than just nicer pointers, it has a very expressive type system that enables correctness rarely seen outside FP.

CanadaPlus ,

Websites have grown beyond mere scripting.

Parts of them, yeah. WASM in Rust makes total sense.

Rust is about more than just nicer pointers, it has a very expressive type system that enables correctness rarely seen outside FP.

If you say so. I’d suggest Haskell, but it doesn’t work very naturally with interactivity, either user or intersystem.

dan ,
@dan@upvote.au avatar

You can use WebAssembly today, but you still need some JS interop for a bunch of browser features (like DOM manipulation). Your core logic can be in WebAssembly though. C# has Blazor, and I wouldn’t be surprised if there’s some Rust WebAssembly projects. I seem to recall that there’s a reimplementation of Flash player that’s built in Rust and compiles to WebAssembly.

CanadaPlus ,

Yeah, ideally TypeScript would be natively supported. Or maybe just Python, which is sort-of strictly typed, and definitely won’t do “wat”. Alas, it’s not the world we live in, and browsers take JavaScript.

dan ,
@dan@upvote.au avatar

Python supports type hints, but you need to use a type checker like Pyre or Pyright to actually check them. Python itself doesn’t do anything with the type hints.

bleistift2 ,

The libraries underneath will still allow nonsense at runtime

Only if you use a badly written library. Most libraries have types provided by DefinitelyTyped. Those who don’t are (in my experience) so tiny that you probably aren’t using them; or, if you really wanted, can check yourself.

In the end, if you encounter a bug, it’ still 99% of the time not a library’s fault, even if it’s written in plain JS.

CanadaPlus , (edited )

Like I said to the other person, those are just types over top of JavaScript that can still fail if/when coercion happens under the hood.

I don’t even know how to search it now, but a specific example came up on here of a time when JavaScript libraries will cause problems, and problems you can’t even see very well if you’re expecting it to act strictly-typed.

Schadrach ,

By that logic what we really need is a modernization of Ada, where there are no compiler warnings and anything that would generate one in another language is instead a compiler error, everything is strongly typed, etc, etc.

If you aren’t familiar with Ada, just imagine Pascal went to military school.

dejected_warp_core ,

Pascal went to military school.

I’m not in love with the idea, but a language that cuts out the BS has a sudden appeal when on a group/team project.

Schadrach ,

That analogy was chosen for a reason. Ada was originally developed by DOD committee and a French programming team to be a programming language for Defense projects between 1977 and 1983 that they were still using at least into the early 2000s. It’s based on Pascal.

It was intended for applications where reliability was the highest priority (above things like performance or ease of use) and one of the consequences of that is that there are no warnings - only compiler errors, and a lot of common bad practices that will be allowed to fly or maybe at worst generate a warning in other languages will themselves generate compiler errors. Do it right or don’t bother trying. No implicit typecasting, even something like 1 + 0.5 where it’s obvious what is intended is a compiler error because you are trying to add an integer to a real without explicitly converting either - you’re in extremely strongly-typed country here.

Libraries are split across two files, one is essentially the interfaces for the library and the other is it’s implementation (not that weird, and not that different than C/C++ header files though the code looks closer to Pascal interface and implementation sections put in separate files). The intent at the time being that different teams or different subcontractors might be building each module and by establishing a fixed interface up front and spelling out in great detail in documentation what each piece of that interface is supposed to do the actual implementation could be done separately and hypothetically have a predictable result.

ChickenLadyLovesLife , in I'll have you know, my fork of a github repo has 3 stars 😎

I’m a school bus driver, and one of my weirder experiences is listening to a middle-school boy ripping on some middle-school girl for having “only” ten thousand followers.

passepartout OP ,
@passepartout@feddit.org avatar

That’s worrying. Imagine what things like that do to those poor children. I hope she can come up with the money to buy some more followers at least. /s

Psythik ,

I remember hitting 1000 subscribers on YouTube. I’m still proud of that achievement.

andioop ,

When I was in middle school, social media might have been omnipresent but even the really popular kids never exceeded 1,000 followers. In high school you could increase the upper limit on followers, but most people hovered around 250 to low 1,000s depending on their popularity. And I never heard anyone talk about their follower quantity, let alone insult people over it. I suppose this is my “kids these days” moment.

Then again, we all just had personal accounts for our friends to follow and weren’t trying to be some big influencer or social media star—maybe that’s what these kids are trying to do? Either way, I am really hoping what you overheard was just banter or an ironic joke between the two, and not legit bullying.

uis , (edited ) in Not everything can be done in constant time, that's O(k)

It may be efficient, not scalable for sure

vk6flab , in How big is your desk?
@vk6flab@lemmy.radio avatar

So, when you use 40 or so programming languages, your employer needs to supply a mansion…

I’m okay with that.

Now, where is the boss?

30p87 ,

'Yes boss, I need 16-Bit, 32-Bit and 64-Bit Arm and x86_64 ASM as well as MySQL, SQLite, Postgres, Firebird, Mongo and all other stuff too, so I need a lot of computers … of course all with Threadripper PRO 7995WX’s.

ZeroCool OP ,
@ZeroCool@vger.social avatar

Corporate be like “mandatory return to office aircraft hangar.”

Ephera , in How big is your desk?

Early on in my career, I had to do a project in Python, together with another junior. Neither of us had any clue how to handle Python and he was on Windows, so, if I remember correctly, he had to install some dependencies from Pipenv, others from Conda, and his setup would break every two weeks in novel ways.

Eventually, we became quite good at installing a working setup, but correctly removing the broken setup was a pain. Often times, I thought that just reinstalling the whole OS would be quicker. 🫠

ignotum ,

Every now and then a new hire comes along with a windows pc, every time they decide they want to try to get everything working on windows, after a week they give up.

On linux it’s one pip install and you’re done

WalrusDragonOnABike ,

On linux it’s one pip install and you’re done

Isn’t that how packages/dependencies work on windows as well? Once I got pip updated, I’ve never had any issues with it.

ignotum ,

No clue, all i know is that i never have to do more than that, and noone has managed to get it working on windows 🤷‍♂️

When i started learning programming, everything was always a pain to set up, needed to install weird IDEs from shady websites and they only worked half the time. Then a friend showed me linux where stuff just worked out of the box, just slap some code in a textfile and compile it, i never looked back (was working in c/c++ but from what i’ve seen it’s not much better for python)

OsaErisXero ,

Since some wsl features started coming with windows out of the box python has been pretty trivial to install. It's a far cry from the conda/cygwin nightmare hell scape it used to be

Ephera ,

I believe, it’s because various Python libraries ship with a pre-compiled C/C++/Rust library. That library needs to be compiled for a specific target, and you often only get Linux x86_64 on Pypi, because that’s what most library devs use themselves.

Conda tries to solve that by providing a separate repository, where they do have builds for more targets available, but as a result, they have fewer libraries available in that repo. That’s why we needed to install some via Conda and some via Pipenv/Pypi.

HappyRedditRefugee ,

We have a development system for python on Windows at work, works very well also.

On linux is one pip install, buy maybe first do a venv^^

Aceticon ,

Last time I checked, it was way easier in Windows to have a VM running Linux just for Python, than to get Python to reliably work nativelly in Windows.

Zagorath , in How big is your desk?
@Zagorath@aussie.zone avatar

Actually long desks are no longer considered best practice. At my work, some devs have a lazy suzan, while others prefer a circle that they can pivot around to face the right computer.

key ,

I got one of those desks with a vertical pneumatic lift so I can stack the computers vertically in a rack and just raise/lower it so the right one is at eye height

AmidFuror ,

Waste of money. Build the chair to go up and down instead.

variants ,

The trick is you hire a runner who comes over when you ring a bell and he unplugs your computer and plugs in the one you need and then takes the other computer to someone else that needs it, I think they call him a vm short for vamoose machine

And009 ,

I don’t like my feet hanging when using the top monitor. My floor splits in half and goes up instead

vk6flab ,
@vk6flab@lemmy.radio avatar

At one point, before we virtualised everything, I had a custom desk built in an L-shape. Instead of a desk and a return, I had the refurbishment team put together a desk with two desks instead. It gave me two sets of drawers, two computer cubby holes and the gap was too small for the horrible keyboard adjustable shelf that kept hitting your knees, so they replaced it with a fixed surface instead.

People laughed.

Colleagues sniggered.

Then they wanted one too.

Now I have a mobile lectern with an iMac clamped to it. Height adjustable, wheels, enough space for keyboard, trackpad and USB hub. I move around my office as the mood or light takes me.

dejected_warp_core ,

I swear, overcoming fixed functional-ness is like a superpower when you can apply it.

I once shared a small office with a co-worker. I had the idea to move the desks away from the walls and place them back-to-back, diagonally, in the middle of the room. Other co-workers scoffed and remarked at how dumb and unconventional this looked. Then I explained that we each now had nearly full privacy from each other, much more personal space in our respective corners, no more glare from the window, and nobody could sneak up on us from the door anymore. Things got pretty quiet after that.

flerp ,

Ah, the Neil Peart drum kit solution

WhiskyTangoFoxtrot ,

A TARDIS console.

dejected_warp_core ,

Useful? Not exactly. But you’d never look lazy or idle, that’s for sure.

Semi_Hemi_Demigod ,
@Semi_Hemi_Demigod@lemmy.world avatar
lolola , in How big is your desk?
@lolola@lemmy.blahaj.zone avatar

That’s why programmers have all those monitors. They’re each hooked up to a different computer.

01101000_01101001 , in JavaScript

Just wait until OP learns about cross product of matrices.

sparkle ,

mfw non-commutativeness

rem26_art , in How big is your desk?
@rem26_art@fedia.io avatar

Those people you see on LinkedIn with like 20 programming languages on their resume are really looking for a job just to pay off the debt of buying 20 computers

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines