thtroyer

joined 1 year ago
MODERATOR OF
[–] thtroyer@programming.dev 1 points 1 year ago

I might be wrong, but the 2nd case looks like an anti pattern, the loop switch sequence .

The last case looks the most readable to me. Always start with that unless there's a clear reason not to (eg inefficient multiple nested loops).

[–] thtroyer@programming.dev 2 points 1 year ago

I think that's a fair argument. PICO-8 definitely could be called a primitive IDE. I think it's closer to being a primitive game engine with so much of its focus being on graphics and sound tooling.

While you can code simple things within PICO-8, I've found that as I've built bigger things, I work better in an outside editor, even if it only gets me smaller fonts, splitable windows, vim bindings, limited linting, and somewhat broken code completion.

This isn't a criticism of PICO-8 as an environment. I think there are a lot of strengths in its simplicity, especially for beginner coders.

I tend to make a distinction between a customizable editor with some support for a language (like vim+plugins) vs a dedicated all-in-one tool that fully understands the language and environment (IDE). PICO-8 is hard to place on that spectrum given it's an all-in-one tool, but switching to a modified editor gives you more features.

[–] thtroyer@programming.dev 10 points 1 year ago (1 children)

This is a very strange article to me.

Do some tasks run slower today than they did in the past? Sure. Are there some that run slower without a good reason? Sure.

But the whole article just kind of complains. It never acknowledges that many things are better than they used to be. It also just glosses over the complexities and tradeoffs people have to make in the real world.

Like this:

Windows 10 takes 30 minutes to update. What could it possibly be doing for that long? That much time is enough to fully format my SSD drive, download a fresh build and install it like 5 times in a row.

I don't know what exactly is involved in Windows updates, but it's likely 1) a lot of data unpacking, 2) a lot of file patching, and 3) done in a way that hopefully won't bork your system if something goes wrong.

Sure, reinstalling is probably faster, but it's also simpler. If your doctor told you, "The cancer is likely curable. Here's the best regimen to get you there over the next year", it would be insane to say, "A YEAR!? I COULD MAKE A WHOLE NEW HUMAN IN A YEAR!" But I feel like the article is doing exactly that, over and over.

[–] thtroyer@programming.dev 6 points 1 year ago (2 children)

I'm reluctant to call much "bloat", because even if I don't use something doesn't mean it isn't useful, to other people or future me.

I used to code in vim (plus all sorts of plugins), starting in college where IDEs weren't particularly encouraged or necessary for small projects. I continued to use this setup professionally because it worked well enough and every IDE I tried for the main language I was using wasn't great.

However, I eventually found IDEs that worked for the language(s) I needed and I don't have any interest in going back to a minimalistic (vim or otherwise) setup again. It's not that the IDE does things that can't be done with vim generally, but having a tool that understands the code, environment, and provides useful tooling is invaluable to me. I find being able to do things with some automation (like renaming or refactoring) is so much safer, faster, and enjoyable than doing it by hand.

Features I look for/use most often:

  • Go to (both definition and usages)
  • Refactor tooling (renaming, inlining, extracting, etc).
  • Good warnings, along with suggested solutions. Being able to apply solution is a plus.
  • Framework integrations
  • User-friendly debugger. Ability to pause, drill in, and interact with data is immensely helpful with the type of applications I work on.
  • Configurable breakpoints.
  • Build tool integrations. Doing it on the console is... fine... but being able to set up what I need easily in the IDE is preferable.

Features I don't use or care so much about? Is there much left?

  • My IDE can hook up to a database. I've tried it a few times, but it never seemed particularly useful for the apps I work on.
  • git integration. I have a separate set of tools I normally work with. The ones in my IDE are fine, but I usually use others.
  • Profiler. I use it on occasion, but only a few times a year probably.

I do code in non-IDE environments from time to time, but this is almost always because of a lack of tooling than anything else. (Like PICO-8 development)

[–] thtroyer@programming.dev 2 points 1 year ago

Which they could have done a much better job with.

It was basically just hosted SVN if I remember right, and they never added git support when it became the de facto version control system.

[–] thtroyer@programming.dev 3 points 1 year ago

In my experience, Java has a lot fewer breaking changes with upgrades compared to other languages. Compared to Python or even PHP and Java looks slow, steady, and predictable.

[–] thtroyer@programming.dev 1 points 1 year ago

I'm somewhat confused by your statements, so perhaps I don't understand.

Function/objects that allow changing their behavior by passing different objects into them, based on some interface, is called dependency injection. Some subset of behavior is determined by this passed behavior. E.g. To keep a logger class from having to understand how to write logs, you could create a WriteTo interface and various implementations like WriteToDatabase, WriteToFile, WriteToStdout, WriteToNull.

When you create this example logger, you'll need to make a choice of what object to pass when you write the code. e.g. new Logger(new WriteToDatabase(config)) But maybe you don't want to make that decision yet -- you want to let a config file decide which writer(s) to create. The pattern to pick between dependencies at runtime is called a factory. In this case, you might make a WriterFactory to pick the right writer, or perhaps a LoggerFactory to hide the creation of both Writer and Factory objects.

So, a factory is only really a facade to hide the runtime switching of how an object is created.

Also, the term dependency injection often gets confused with what you see in various Java / C# / and various frameworks in other languages -- those usually use what's called a "DI Container" or "IoC Container". These manage and facilitate how dependency injection happens within the project, often with various annotations (e.g.@Autowired). These containers are powerful, but sometimes complicated.

However, you can absolutely still do DI without DI containers, and I think advocating for not using DI generally (and related patterns like factories) is rather misguided.

[–] thtroyer@programming.dev 8 points 1 year ago

There is a version mismatch. lemmy.world is having trouble upgrading, which I believe also causes federation between instances to fail between these versions.

They have a thread about it here

[–] thtroyer@programming.dev 4 points 1 year ago

I've found pair programming to be fantastic, but only when used rarely in certain situations.

If you've got a good rapport with a teammate and a legacy project has landed in your lap neither of you understand, I've found pair programming to be the fastest way to figure out how it works. As you work together, you'll both understand different parts of it better and be able to quickly figure out what's going on. I guess this is probably less pair-programming and more like collaborative dissection of code though.

I've also used it to help onboard people on a project fairly quickly. This is more tricky and much less comfortable to do, so I do my best to stay in tune with what they need from me, and tends to be me coding for a bit and them following along and asking questions. Eventually, they want to start writing some code, and a day or so of switching back and forth is as far as I've usually taken that. I think it's useful to break down barriers when working with (especially new) people, to make mistakes in front of them, and build good rapport.

I've not used it much beyond those situations, but I'd definitely use it in these ways again.

[–] thtroyer@programming.dev 2 points 1 year ago (1 children)

I've watched so much good code written professionally die because of the whims of leadership in the past.

[–] thtroyer@programming.dev 2 points 1 year ago (1 children)

I'd be happy to help with c/java

view more: ‹ prev next ›