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.

Maoo , in Yes
@Maoo@hexbear.net avatar

You’re not at scale unless you’re deploying OpenStack to run a WordPress site.

msage ,

Which is hilarious since PHP scales incredibly well on its own.

Maoo ,
@Maoo@hexbear.net avatar

Regrettably, it does do that

moonpiedumplings ,

No I swear, I was gonna do more than that.

Maybe like, a static site as well. And a backup server. Y’know, things you need openstack for.

*looks away guiltily*

moonpiedumplings.github.io/…/build-server-2/

GBU_28 , in Merge then review

Let the users do the testing

ArmoredThirteen ,

Oh hey a fellow game dev, how long you been in the industry?

CeeBee ,

They’re a Windows dev, clearly.

vrkr , in A lot of YAML
@vrkr@programming.dev avatar

I like YAML.

FooBarrington ,

That’s okay, not everyone can be right :)

jasondj , in We did this to ourselves

I’m sorry, I’m only a novice Python guy. Know enough to get two RESTful APIs to talk to each other and do some network automation or rudimentary Ansible plugins.

What’s wrong with if isinstance(x, str):?

Knusper ,

Apparently, “Theorems for free!” is a paper that talks about an extensive ability to reason about parts of programs, if you follow some rather basic rules.

However, lots of popular programming languages throw this ability out the window, because they do not want to enforce those basic rules.
Most languages, for example, allow for rather uncontrolled side effects and to be able to reason as a programmer, you have to make the assumption that no one else abused side effects.

The instanceof is rather referring to dynamic typing, though, as e.g. employed by Python and JS, which makes it difficult to make any assumptions at all.

So, in statically typed languages, when you’re implementing a function, you can declare that a given parameter is a number or a string etc. and the compiler will enforce that for you. In dynamically typed languages, you have to assume that anyone calling your function is using it correctly, which is a difficult assumption to make after a refactoring in a larger codebase.

All in all, such different levels of rigorosity can be fine, but the larger your codebase grows, the more you do want such rules to be enforced, so you can just ignore the rest of the codebase.

irdc , in Hobbyte

So the Fellowship of the Ring was made up of an elf, a dwarf, two humans, a maia and one hobnibble?

Poggervania ,
@Poggervania@kbin.social avatar

Thorin and Company were running with 1Hb across 3 movies while The Fellowship ran with 4Hb across 3 movies.

So we could theoretically say The Hobbit movies sucked because they were bottlenecking their performance due to not downloading having more Hb per movie.

irdc ,

Yeah, hobbit-serial architectures lack performance.

nybble41 , in I mean it could be right

I’m fairly certain that last one is UB in C. The result of an assignment operator is not an lvalue, and even if it were it’s UB (at least in C99) to modify the stored value of an object more than once between two adjacent sequence points. It might work in C++, though.

Beanie ,

That was my first thought when trying to figure out what it did

onlinepersona , in Did someone say emacs?

IBM thinkpad in the background with a CRT

I can send it to you via FTP

Nailed it.

edinbruh ,

But he’s using a model M, not a symbolics space cadet. Totally inaccurate

xnasero , in D or d come on

Op does not know about $CDPATH and tab completion keke

PennyJim ,
@PennyJim@lemmy.world avatar

I’ve seen a number of comments imply the possibility of case insensitive tab completion. Is this real and how do I do it?

I have multiple times fumbled with forgetting to capitalize something, only for the terminal to ‘dunk’ at me

F04118F ,

There’s probably some way to add it in bash, but if you install zsh and use the default options for everything, it just works! I especially love zsh for things “just work”: not just tab completion for directories but also having completion for tools like git, docker, kubectl, etc is super easy, and you don’t need any weird magic like in Bash if you want to use an alias with the same completion

bnjmn ,

Hmm, it didn’t “just work” for me. I had to set it up recently:

zstyle ‘:completion:*’ matcher-list ‘’ ‘m:{a-zA-Z}={A-Za-z}’ ‘r:|=*’ ‘l:|=* r:|=*’

That line needs to go in .zshrc. Maybe it’s enabled by default with oh-my-zsh?

F04118F ,

I’m sorry, that must be it, I immediately installed oh-my-zsh after switching to zsh

bnjmn ,

I tend to always install both of them together too! Which makes it a little hard to know where things are coming from. This time I decided to start from scratch, so certain aspects of the config are still salient in my mind

zlatko ,

For bash, this is enough:


<span style="color:#323232;"># Bash TAB-completition enhancements
</span><span style="color:#323232;"># Case-insensitive
</span><span style="color:#323232;">bind "set completion-ignore-case on"
</span><span style="color:#323232;"># Treat - and _ as equivalent in tab-compl
</span><span style="color:#323232;">bind "set completion-map-case on"
</span><span style="color:#323232;"># Expand options on the _first_ TAB press.
</span><span style="color:#323232;">bind "set show-all-if-ambiguous on"
</span>

If you also add e.g.CDPATH=~/Documents, it will also always autocomplete from your Documents no matter which directory you’re on.

PennyJim ,
@PennyJim@lemmy.world avatar

Setting CDPATH=:~/Documents/Dev makes navigating to any of my projects so much easier.

Thanks for bringing it to my attention

csm10495 ,
@csm10495@sh.itjust.works avatar

Thanks kind stranger. Never knew of this.

zlatko ,

No problem!

As an aside, I see we’re bringing the strangers thing over from Reddit. I hope more of the fun and funny stuff gets over, I miss some of the light shitposting.

kattfisk ,

Well completion-ignore-case is enough to solve this particular problem, the other options are just sugar on top :)

I’m going to add completion-prefix-display-length to these related bonus tips (I have it set to 9). This makes it a lot easier to compare files with long names in your tab completion.

For example if you have a folder with these files:

FoobarSystem-v20.69.11-CrashLog2022-12-22 FoobarSystem-v20.69.11.config FoobarSystem-v20.69.12 FoobarSystem-v20.69.12-CrashLog2023-10-02 FoobarSystem-v20.69.12.config FoobarSystem-v20.69.12.userprofiles

Just type vim TAB to see


<span style="color:#323232;"> ...1-CrashLog2022-12-22   ...1.config   ...2   ...2-CrashLog2023-10-02   ...2.config   ...2.userprofiles
</span><span style="color:#323232;">$vim FoobarSystem-v20.69.1
</span>

GNU Readline (which is what Bash uses for input) has a lot of options (e.g. making it behave like vim), and your settings are also used in any other programs that use it for their CLI which is a nice bonus. The config file is ~/.inputrc and you’d enable the above mentioned options like this


<span style="color:#323232;">$include /etc/inputrc
</span><span style="color:#323232;">
</span><span style="color:#323232;">set completion-ignore-case on
</span><span style="color:#323232;">set show-all-if-ambiguous on
</span><span style="color:#323232;">set completion-map-case on
</span><span style="color:#323232;">set completion-prefix-display-length 9
</span>
lugal , in What came first, the programmer or the code?

OUR code

Fal , in Monitor Alignment Alignment Chart
@Fal@yiffit.net avatar

How about only a laptop monitor?

Psythik ,

And what about using a 65" 4K TV to replace four 32" 1080p monitors? Where do I fall on this chart?

BeigeAgenda ,
@BeigeAgenda@lemmy.ca avatar

Yeah, it’s missing: [Laptop] [Monitor 1] [Monitor 2]

or the Chaotic version: [Monitor 1] [Laptop] [Monitor 2]

Amilo159 ,
@Amilo159@lemmy.world avatar

That don’t you look down at my corner office desk setup! It’s balance. 32" 1440p, 14" 1080p, 32" 1440p. Perfectly balanced, as all things should be.

ursakhiin ,

My work setup is [Monitor 1] [Laptop] [Vertical monitor 2]

merc , in 0.30000000000000004

It’s not + that’s scary, it’s =.

maniacal_gaff ,

==

merc ,

Sometimes…

MonkderZweite , in Programming Languages as Essays

Unpopular opinion: Ruby is too widely used, because it’s the least performant language.

Sometimes even for stuff, where performance matters (Asciidoctor).

lars ,

Yeah I usually run my backend in Asciidoc too. The level of its performance might surprise you.

Quill7513 ,

Ruby’s popularity in the early 10s thanks to Ruby on Rails feels like it happened by accident. The language is hard to read and low performance, but Rails is completely automagic. But this is also the worst thing about rails. You create your app fast, but then maintaining it is expensive because you can’t onboard new developers easily. Even if they’re familiar with rails’ automagicisms, it will take them quite some time to parse what the hell the code is doing.

Meanwhile I seem to recall Ruby’s creator finding the situation of his language being popular because he’d created it as an experiment and never thought it would be used in production grade environments

AnomalousBit ,

language is hard to read


<span style="color:#323232;">for item in array do
</span><span style="color:#323232;">  puts item[:name]
</span><span style="color:#323232;">end
</span>

Whew, iterating and working with data in Ruby is so hard. How does anyone read this stuff.

low performance

Ruby is a syntax-sugar-loaded C-wrapper, just like Python and countless other languages that don’t compile straight to machine code. If anything other than C and Rust are slow to you, then sure, maybe Ruby isn’t a good fit for your project (but Crystal might be).

create your app fast

Damn right, I’m two or three times as productive as I ever was in C#/Razor, Java/Spring or kludging through the countless JS boilerplate-heavy web frameworks.

but then maintaining it is expensive

As with any app that grows into something successful and widely used, technical complexity becomes exponential. I’ve found once web applications grow to a certain number of models and controllers, the relationships between them start to grow exponentially as well. This means one small change can ripple throughout your application and have unintended consequences where you least expect.

This is not even remotely a unique problem to Ruby. It’s happened across every project I’ve seen that grows beyond 30 models and a couple of dozen controllers, regardless of language. This is why unit testing is so important.

But, specifically you mentioned you can’t “onboard new developers easily”. I don’t see how. I’ve taken two CS grads straight out of college and had them adding features with tests within a couple of days on Ruby projects. Ruby was designed to be most friendly to humans, not the compiler. If Rails is what is tripping you up, imagine trying to learn a new web framework on top of an even more complicated language than Ruby. I just don’t see this argument at all, from my experiences.

Ruby’s creator finding the situation of his language being popular because he’d created it as an experiment

Pretty sure most any language that was created by an individual and not by BigCorp™ is a feat in and of itself. This speaks more widely to a language’s capabilities and value if it can reach popularity without corporate backing. This argument seems to imply that because of it’s origin, it will always be some kind of experimental toy that was never intended for wide-use.

Meanwhile, Linus Torvalds:

I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones.

Things have to start somewhere, I guess?

I kindly ask you to be more constructive in your criticism of Ruby. It’s a great, powerful language with a low barrier to entry. There’s no reason to spread FUD about it.

morrowind ,
@morrowind@lemmy.ml avatar

<span style="font-weight:bold;color:#a71d5d;">for</span><span style="color:#323232;"> item </span><span style="font-weight:bold;color:#a71d5d;">in</span><span style="color:#323232;"> array </span><span style="font-weight:bold;color:#a71d5d;">do
</span><span style="color:#323232;">  </span><span style="color:#62a35c;">puts</span><span style="color:#323232;"> item[</span><span style="color:#0086b3;">:name</span><span style="color:#323232;">]
</span><span style="font-weight:bold;color:#a71d5d;">end
</span>

What’s with the weird syntax, isn’t idiomatic ruby


<span style="color:#323232;">array.each </span><span style="font-weight:bold;color:#a71d5d;">do </span><span style="color:#323232;">|item|
</span><span style="color:#323232;">  </span><span style="color:#62a35c;">puts</span><span style="color:#323232;"> item[</span><span style="color:#0086b3;">:name</span><span style="color:#323232;">]
</span><span style="font-weight:bold;color:#a71d5d;">end
</span>

(or the shorthand version)?

AnomalousBit , (edited )

First time I’ve ever heard someone call a for loop “weird“. They’ve been around for 50 years 😂

The whole point was on readability, not trying to make rubocop be quiet. Sure, .each is great, but I’m not sure about it being shorthand. What did you save? Like 3 characters? I find the for loop more readable unless I’m method chaining.

morrowind ,
@morrowind@lemmy.ml avatar

Not in ruby, the for loop was initially put there to make it friendly for people from other languages and is discouraged. It’s just syntax sugar on top of each.

By shortand version I meant


<span style="color:#323232;">array.each(</span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp;</span><span style="color:#0086b3;">:to_s</span><span style="color:#323232;">)
</span>

(although in this case I’m not calling puts anymore)

edit: lemmy keeps putting the &amp; there, but you know what I mean

AnomalousBit ,

Not in Ruby

It’s valid syntax, it’s part of Ruby. It’s easy to read and familiar across many languages. Write what you want to write, I’m not sure why you feel the need to finger wag.

larouxn ,

Was about to say as someone who’s been using Ruby for over a decade, 8 of which professionally, I’ve never once come across a for loop. each on the other hand, all day every day.

Slimy_hog ,

“ruby is hard to read” is a really strange take…

snowe ,
@snowe@programming.dev avatar

Yeah there’s multiple people in here saying that and it seems like maybe they’ve never actually written Ruby. I don’t think Ruby is a good language for writing business apps in, but it’s incredibly easy to read. Way easier than pretty much every single language out there.

Now if you start including shit like rails, sure. But that’s not Ruby. That a framework and just like Spring or Django or Boost or whatever, it has its own semantics and can be incredibly difficult to read. That has nothing to do with the language though.

morrowind ,
@morrowind@lemmy.ml avatar

It’s as performant as python which is way more widely used.

MonkderZweite ,

No, there circulated a performance list a while ago. Python was in the lower third while Ruby was bottom.

morrowind ,
@morrowind@lemmy.ml avatar

Which benchmark are you talking about? The most common I know of is the computer language benchmarks game, here’s a nice implementation of it.. You can see ruby is actually a decent bit faster.

It’s an annoyingly persistent myth that ruby is significantly slower than python.

mojo , in call the doctor, the CS doctor

You count one finger up as the same as no fingers up? Counting is not the same as an index.

jjjalljs , in How the IT guys see the users

Most people are fine.

One time I had a boss receive a spreadsheet I sent, print it out, and ask the team to verify the sums by hand.

But most of the people I work with are fine.

Pyr_Pressure ,

My current boss will print out Excel sheets and use a calculator to sum things and then write in sharpie on the page the changes that he wants me to make to the sheet.

xantoxis , in How the IT guys see the users

haha user dum

dylanTheDeveloper ,
@dylanTheDeveloper@lemmy.world avatar

Printer bad upvotes to the left

Obi ,
@Obi@sopuli.xyz avatar

Akshually they’re to the right on my app.

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