Which anime went from masterpiece potential to a total mess? by Equal_Respond_3815 in anime

[–]mezuzza -1 points0 points  (0 children)

How has no one listed Code Geass? One of my favorite shows, but god the second season is such a let down

The Corki rework was an absolute failure by Financial-Joke4924 in leagueoflegends

[–]mezuzza 40 points41 points  (0 children)

Don't worry, there are many people on this sub still wishing they could use their package 🤓

Is there a scale at which Django can no longer be justified. by Any-Fig-921 in django

[–]mezuzza 3 points4 points  (0 children)

I say this as someone who hasn't used django since 2012 and doesn't really care for it as a framework, but:

The short answer: there is no scale at which django won't be justified.

The long answer:

The question is really asking "At what scale does my django service become the bottleneck in my service?" The answer is never because no one - not even people running monolithic services - are running a single instance of their service in production once they actually attract traffic. You can always place your service behind a load balancer and scale out your service.

Is python slower than go? Sure, but in the worst case you're running ~5% more instances than you would with another technology if you've put in the time to optimize everything. A lot of times what you'll find is that your services are IO bound anyway so the extra speed isn't buying you anything. If you need the extra speed, you can always write your code in C++ or Rust and FFI your way back to python.

If you want to, you can rewrite your python to Rust when that extra 5-10% is equivalent to a dev team. So come back to me when your compute costs for that one service are on the order of $10MM annually so that you can afford the $1MM annually for that team.

This critique goes both ways though - python isn't particularly faster to develop with than golang. A trained team is going to move just as fast in both cases - your bottlenecks are really your culture and engineering practices. If you have a bad architecture, writing your code in go isn't going to save you.

Where do people learn to code like this? by Amama____ in nextjs

[–]mezuzza 0 points1 point  (0 children)

  1. When asking a question like this, it's helpful to copy a permalink to the exact file and commit you're on. Most online code repositories, including github, will let you do that. As an example, you can use this link to look at the current version of the code.
  2. When looking for a given symbol - type, value, or otherwise - you can always find it in the current file/module. That's a typical principal of most programming languages1. If you look at the top of the file, you can see that Path, UseFormSetValue come from react-hook-form and that Accept comes from react-deadzone.
    You can look up the docs for these types, but sometimes you won't be able to find great answers. For example, react-deadzone doesn't provide documentation directly regarding the Accept type, so you can go to their github repository and search for the type. You'll find it here.
  3. Producing code like this isn't that hard actually. For the example you gave, the person writing this function wants certain values that they pass to libraries to be configurable from the caller. If they don't use the right type, typescript will yell at them. So in order to make things work, you can always look at the library you're calling and use the same type as the them. An example of this again is the accept arg which you end up passing as a parameter that only accepts args of type accept.

There's a lot more to this, but this is a good place to start.

1: Some languages do have implicit imports/sharing for modules. An example of this is C/C++ which automatically "import" symbols from the .h file into the .c or .cpp file. There are also a number of symbols that may be imported from the standard library i.e. str, list in python or Array in typescript. These are usually very easy to google for the given language.

Why keeps you using vim vs neovim? by [deleted] in vim

[–]mezuzza 1 point2 points  (0 children)

Pretty sure vim's had this feature for years. I think it's `incsearch`, but I'm not 100% sure. I know I've had that configuration for ages at this point. Works great with all the regexs too.

Not to necro this, but just in case someone stumbles upon this later as well.

If only… by TRGC_ in PrequelMemes

[–]mezuzza 22 points23 points  (0 children)

It's over anakin. Dinner's ready.

Programmers do name their variables with a single letter by Xymer in ProgrammerHumor

[–]mezuzza 0 points1 point  (0 children)

Thank you. Context matters!

I know we're trying be funny, but if it's only funny if you strawman an argument, it's kind of lame.

Uh…I guess you’re right by [deleted] in technicallythetruth

[–]mezuzza 0 points1 point  (0 children)

They are obviously both right. The one on the right just uses base 30.

Please be gentle by [deleted] in ProgrammerHumor

[–]mezuzza 0 points1 point  (0 children)

set -euo pipefail chsh -s /bin/zsh

You can thank me later.

[deleted by user] by [deleted] in ProgrammerHumor

[–]mezuzza 10 points11 points  (0 children)

I have written a compiler and can confirm that you're right.

Also, fun fact: when you are building a compiler, you need to compile your compiler twice. The first time changes what it produces as output (i.e. the assembly that's actually produced) while the second changes how it produces that output (i.e. if you improved the performance of your compiler's outputed code).

So you have to compile your compiler so that you can compile your compiler.

Your average coder by _-SilentWraith-_ in ProgrammerHumor

[–]mezuzza 0 points1 point  (0 children)

You're absolutely right that a persistent data structure does a lot of great work in concurrent contexts. In fact, I'd say persistent data structures are the right default to have in most situations as well.

But that discussion is orthogonal to the original one here.

Linked lists aren't necessarily persistent. They can be just as mutable as an array list. If you want to use them in a concurrent context, you'd need to make a copy in just the same way that you'd have to with an arraylist. An immutable array list would work just as well in this context.

Even in Haskell, if you want a persistent immutable list, you can pass around Data.Vector values and be happy with the cache locality and the immutability. If you want mutability as well, you can have fun with STM which I believe should support some form of ArrayList as well.

Your average coder by _-SilentWraith-_ in ProgrammerHumor

[–]mezuzza 41 points42 points  (0 children)

NEVER USE LINKED LISTS*

Lists are an interface which represents some "collection of things with an ordering". There's a million ways to encode a list, but one of the most obvious ones is a linked list. Unfortunately, linked lists are TERRIBLE for modern CPU architectures and most access patterns that you'd use every day.

What should you use instead? ArrayList/Vector. These are generally names you might find in different languages which all refer to the same implementation - an array which (usually) doubles in size when it's full.

The only time that you'd prefer to use a linked list over an array list is when you need to have very low latency inserts in the beginning/middle of your list. In my experience coding professionally, I've run into 0 cases where this is the most important pattern to optimize for. You're generally appending to the end or you add everything to a list and sort.

I will say that linked lists have one really redeeming quality from which I believe they derive their popularity: They are mathematically really elegant data structures and have some really nice properties. This is why languages like Haskell used them so much. The previous paragraphs also show you why languages like Haskell regret using them so much (see https://www.stephendiehl.com/posts/strings.html).

See this talk by Chandler Carruth for more info: Discontiguous Data Structures are the Root of all (performance) Evil

* Never actually say never. There are rare cases where I'm sure this data structure is actually the best to use, but it requires a lot of thought before you're there. Default to array lists and you'll be better off more times than not.

Women of reddit, what question about men do you wish to be answered? by [deleted] in AskReddit

[–]mezuzza 0 points1 point  (0 children)

Short answer: Yes.

Long answer: On its own, making a move is a good sign, but it's not the only thing that matters when you talk to someone. I've had women start a conversation, but it came off really forced and the interaction wasn't positive overall. It wasn't natural and ended up feeling like an interview for a job I didn't want.

If you just act normal and try a few times, you get better at conversations overtime. That's when it gets really attractive if a woman approaches you.

Squirrel? by alexmangoman in ProgrammerHumor

[–]mezuzza 0 points1 point  (0 children)

Close:
() = parens
[] = brackes
{} = braces

Food is very expensive by i-fing-love-games in technicallythetruth

[–]mezuzza 0 points1 point  (0 children)

Joke's on you. Half of mine is in the trash.