5 votes

Fortnightly Programming Q&A Thread

General Programming Q&A thread! Ask any questions about programming, answer the questions of other users, or post suggestions for future threads.

Don't forget to format your code using the triple backticks or tildes:

Here is my schema:

```sql
CREATE TABLE article_to_warehouse (
  article_id   INTEGER
, warehouse_id INTEGER
)
;
```

How do I add a `UNIQUE` constraint?

8 comments

  1. [2]
    javathunderman
    Link
    Is anyone familiar with using the Subsonic music API? I found this music player called MooSync that has an extension API, and I've been thinking about writing an extension to use the Subsonic API...

    Is anyone familiar with using the Subsonic music API? I found this music player called MooSync that has an extension API, and I've been thinking about writing an extension to use the Subsonic API to stream music from my Nextcloud install.

    2 votes
    1. FluffyKittens
      Link Parent
      I do not have hands on experience with the client API, but I have used subsonic and its various forks for many years. First thing to know is that Subsonic itself is basically abandonware at this...

      I do not have hands on experience with the client API, but I have used subsonic and its various forks for many years.

      First thing to know is that Subsonic itself is basically abandonware at this point, though its API is alive and well. Airsonic-advanced is currently the most active successor to the Subsonic project and probably the target you’ll want to develop and test against.

      I will also add that I’ve yet to find a decent iOS subsonic client, despite trying quite a few options. Not so much from a lack of effort from the client devs, but from the difficulty of mapping an iPod-like UI frontend onto an old-school REST API. My naive impression is that all the necessary primitives to make a good client technically exist on the backend, but don’t fit together cohesively unless you’re looking making a clone of the web UI.

      That being said, it looks like a fun project. Best of luck to you!

      1 vote
  2. [6]
    FrankGrimes
    Link
    So, I've been a hobbyist programmer for quite a few years - I can write your typical CRUD apps in PHP, and I've been diving further into Javascript lately by making a few basic applications. My...

    So, I've been a hobbyist programmer for quite a few years - I can write your typical CRUD apps in PHP, and I've been diving further into Javascript lately by making a few basic applications. My questions is, how to do I get to that next level of being able to do it professionally? I often see people talking about interviews for even entry level jobs that involve more complex math than I know, optimizations, more advanced API's - and they're supposed to build something on the spot without Google (where I spend about 65% of my programming time googling an issue, copying stackoverflow code, then making some minor changes to make it work).

    I also tend to get lost a bit in JS when I start seeing functions stacked on top of each other with a bunch of different "this" calls.

    I guess I often wonder: first, am I smart enough to actually get paid to do this, and second, where can I find a self paced, but well structured place to learn the more advanced (to me) concepts?

    2 votes
    1. [2]
      eledrave
      Link Parent
      Despite what you see posted, there are far more jobs doing those CRUD (Create/Read/Update/Delete for anyone unfamiliar) apps than there are doing Artificial Intelligence (AI) and similar fancy...

      Despite what you see posted, there are far more jobs doing those CRUD (Create/Read/Update/Delete for anyone unfamiliar) apps than there are doing Artificial Intelligence (AI) and similar fancy stuff. There are millions of boring CRUD jobs at large and small companies. But they're boring so you don't read about them. Most of these jobs will have minimal need for advanced algorithms or math. There are libraries for that.

      When people hear about Software Developers making $250k a year, they don't realize that there are far more jobs making $60k a year doing CRUD work for internal clients. They're often hard to find. For instance, a place I worked wouldn't post on sites like Indeed so it was only posted on the company website. We'd see 15 resumes trickle in over a few months. We'd hire based on stated skills, enthusiasm, and the ability to answer basic questions during an interview. We knew it was a stepping stone for many, though some people would stay for the good work environment.

      Regarding interviews, I've only participated in one interview where you actually had to build something and they could use any resources available. And only one other where I had to do anything on a whiteboard. All the others I've been in are just conversations.

      I guess my point is that you shouldn't think that what you read is truly representative. Maybe at the big names, but not everywhere.

      Follow the typical advice. Build something you can show off. Have a website you can point to. Be honest about what you can do. Show interest and enthusiasm. There are places willing to take a risk on someone without the deep skills.

      If you aren't in a rush, use each interview as an opportunity to learn and then build stuff between interviews. If they ask you about sorting algorithms during interview 1, add a page to your website that shows the relative speed of a few different sorting algorithms in JavaScript. During interview 2 they ask you about your experience with MySQL database, so add a page where you do a bunch of database stuff. After 10 interviews, you'll have 10 or more new pages with examples of things you've done and you'll have learned a lot. When those questions come up in future interviews, now you can say you've worked with that thing; maybe not in a professional setting, but it's a start.

      5 votes
      1. FrankGrimes
        Link Parent
        Thanks for the insightful reply!

        Thanks for the insightful reply!

        1 vote
    2. [3]
      FluffyKittens
      Link Parent
      Two questions for yourself: Are you roughly college age? Are you a solid interviewer (basic social skills, decently presentable, somewhat articulate)? If the answer to both of those is yes, you’ll...

      Two questions for yourself:

      • Are you roughly college age?
      • Are you a solid interviewer (basic social skills, decently presentable, somewhat articulate)?

      If the answer to both of those is yes, you’ll do fine. Otherwise, still totally doable but you’ll need something to set yourself apart, like a strong portfolio or prior work experience.

      General thoughts: pick a specialty of your choice (frontend/backend/db), focus your self-study on that, and target your resume + job hunt around it. If you chose backend, go all-in on Laravel or ditch the PHP.

      Also, the idea of a “well-structured” learning path is something I wanted too at your stage - but it’s bait, I promise. Programming is an art form, not a science. Learn by writing a bunch of code to do whatever makes you happy, then read other people’s code to get ideas for improvement.

      Don’t let the leetcode bullshit and jargon fool you; half the industry can’t program their way out of a paper bag. If you can put together a half-working CRUD app, you’re ahead of the curve.

      1 vote
      1. [2]
        FrankGrimes
        Link Parent
        Not even close - I'm in my mid/late 30's. These are things I can do - most of my career has involved a lot of working as a team - I can definitely communicate well with others. Hah - I'm going to...

        Are you roughly college age?

        Not even close - I'm in my mid/late 30's.

        Are you a solid interviewer (basic social skills, decently presentable, somewhat articulate)?

        These are things I can do - most of my career has involved a lot of working as a team - I can definitely communicate well with others.

        If you can put together a half-working CRUD app, you’re ahead of the curve.

        Hah - I'm going to put myself a bit behind the curve at this point, I think...I appreciate the advice!

        2 votes
        1. FluffyKittens
          Link Parent
          You shouldn’t be too far behind then. You should expect to be discriminated against at some places (burnout mills that you probably don’t want to work at anyway), but there’s absolutely a place...

          most of my career has involved a lot of working as a team

          You shouldn’t be too far behind then. You should expect to be discriminated against at some places (burnout mills that you probably don’t want to work at anyway), but there’s absolutely a place out there for you. The soft skills and interview chops are where a lot of people flounder. I work on a data team with some older folks who taught themselves SQL because they wanted a career pivot - no one bats an eye, and they’re my favorite people to work with.

          1 vote