• 2 Posts
  • 761 Comments
Joined 1 year ago
cake
Cake day: September 24th, 2023

help-circle

  • I would recommend trying coding, and see if you like it. There are a gazillion options out there to learn online. You don’t need to pay anyone. Here are some examples:

    • Do a micro-controller project using Arduino. This is actually C++ which is a pretty advanced language, but they only use very simple C++ features so it’s still beginner friendly.
    • Make a game of some kind. I’m not really a game developer so I don’t know what the good options are there, but maybe something like https://phaser.io/ ? Or Pygame if you hate yourself.
    • Make a web site. I’ve used all sorts of things for this and my favourite method at the moment is Fresh.

    Anyway, try and get a taste of it and you’ll probably know if you like it. If you do, definitely just work on a project in your free time. You don’t need any qualifications to get a programming job, just skill. (In fact I’d say they are a bit of a red flag.)

    Programming is a great career if you like it - very high pay for very little responsibility (outside game development anyway).


  • FizzyOrangetoLinuxGit 2.48 released
    link
    fedilink
    arrow-up
    3
    ·
    2 days ago

    The liquor store presumably? Just submitting patches is a simple 12 step process. I can’t imagine the development and review process is any easier.

    I have implemented a Git client from scratch which involved quite a bit of reading the Git source code. It’s not bad code but it’s definitely the sort of code that would break in all sorts of unexpected ways if you changed something. I wouldn’t volunteer my time their tbh.


  • Well, if you want to have Pip-installed tools available generally (e.g. until distros started screwing it up, pip was the best way to install CMake), the suggestion was to have a venv for the user that would be activated in your .bashrc or whatever.

    I think that would work, but then what happens if you want to use a project-level venv, which is really what they’re designed for? If you create and activate a venv when you already have one activated does it all work sensibly? My guess would be that it doesn’t.






  • FizzyOrangetoLinuxGit 2.48 released
    link
    fedilink
    arrow-up
    6
    ·
    3 days ago

    Git has four build systems?? Meson seems overkill if you already have CMake too. The only thing it really adds is that it’s nicer to write (CMake is somewhere between Bash and PHP in sanity), but if you have to write CMake anyway…


  • They definitely didn’t. Yes it is technically better to use their own new fancy system, but they’re a business. Backwards compatibility is killer, even if you don’t want it from a technical point of view.

    I guarantee they looked at the numbers, interviewed users and asked them why they weren’t using Deno, and the number one reason would have been “we’d love to but we need to be able to use the X node package”.

    They probably have to improve Node compatibility, but the Node API surface is actually not that big. They’ll get there.


  • FizzyOrangetoProgrammingCode Smells Catalog
    link
    fedilink
    arrow-up
    1
    ·
    3 days ago

    Yes, and then pass the context from the call sites of that function, and all the way up to main(). Oh look you’re refactored the entire app.

    That’s best cases too, you’d better hope your program isn’t actually a shared library running in a SystemVerilog simulator with state instantiated from separate modules via DPI, or whatever.

    30 years my ass

    lol when you have 30 years experience you will have actually tried to do this a few times and realised it isn’t usually as trivial as you hope it would be.






  • FizzyOrangetoProgrammingCode Smells Catalog
    link
    fedilink
    arrow-up
    2
    ·
    6 days ago

    that static variable is local to that function

    Yes I know how static storage durations work. It’s still global state, which is a code smell. Actually I’d go as far as to say global state is just bad practice, not just a smell. Occasionally it’s the only option, and it’s definitely the lazy option which I won’t claim to never take!




  • FizzyOrangetoProgrammingCode Smells Catalog
    link
    fedilink
    arrow-up
    1
    ·
    6 days ago

    I disagree. I’ve seen very complex boolean expressions and they were clearly code smell. Sometimes acceptable but definitely a fertile area for refactoring.

    Their example is crap to be fair - two comparisons is not complex.


  • FizzyOrangetoProgrammingCode Smells Catalog
    link
    fedilink
    arrow-up
    2
    ·
    6 days ago

    There are arguments to be made either way, but normally you’d scope your variables in a way that the ones specific to a particular bit of code are not accessible from elsewhere.

    Sounds like you agree with that one to me? I’m not sure I follow their arguments about regions there (I’ve never used regions), but the example of declaring a variable in a block way before it is every used is spot on. I’ve seen code written like that and 99% of the time it’s a bad idea. I think a lot of it comes from people who learnt C where you have to do that (or maybe Javascript which has weird rules for var).

    Suggest writing a custom class to do what most languages can solve with inheritance or even better: the ? syntax.

    Yeah I’ll give you that one. They even suggest using Optional as a solution, which is what their “smelly” code did in the first place!

    Yes, it can be annoying. No, clarity is more important than insisting on removing that extra underscore.

    Not sure what your point is here. Of course inconsistent naming is a code smell. Do you want inconsistent names?

    They’re advocating the use of a function to replace an expression. Sometimes this works, but the task of a boolean expression is not always easily expressed in a couple words. And so you can end up with misleading function names. Instead, just put a comment in the code.

    Erm, yeah that’s why this is a code smell. They aren’t saying never have complex boolean expressions - just that if you do you’d better have a good reason because probably you’d be better off splitting it up into named parts.

    callback hell - Not even a code smell. It’s an issue from back when languages like JavaScript didn’t support promises yet, but callbacks were popular.

    Indeed, so now it is a code smell.