Programming thread

Goddamnit, I hate that kind of unreadable C code that is littered with shittons of inappropriate macro expansions, single letter variable names, and has functions that are several screenfuls long.

It's code where the comments are actually actually essential to realistically understanding the program, and not merely a helpful clarification.

I don't really agree 100% with either the GNU C standards or the Linux kernel standards, but any standards are better than having to pick apart the meaning of int i, int j, and int m over the course of an unreadably long function.
 
Goddamnit, I hate that kind of unreadable C code that is littered with shittons of inappropriate macro expansions, single letter variable names, and has functions that are several screenfuls long.

It's code where the comments are actually actually essential to realistically understanding the program, and not merely a helpful clarification.

I don't really agree 100% with either the GNU C standards or the Linux kernel standards, but any standards are better than having to pick apart the meaning of int i, int j, and int m over the course of an unreadably long function.
If you write a big program in C you define all these strange things until you realize you're no longer writing C, it's a DSL built on top of C. nginx is a prime example of that.
 
I have a question that you guys can probably answer me best:

I work in a tech, but I am not a developer. Let's just say, I need to know and understand what they are doing on a technical level in order to do my job. So, I do have above-average knowledge about programming, application architecture, and whatever. In my free time, however, I program as a hobby; purely recreational, just like others are solving Sudoku or crossword puzzles, I enjoy trying to create little programs and algorithms to predict or solve everyday problems.

Back when I was still in grad school, I started to get interested in programming triggered by my academic work. One of the first problems I encountered when writing my first little projects was one for which there were already well-known algorithms. Instead of using them I thought that "there must be a better way to do it", and came up with my own algorithm. Over quite some time now, I have been working on a proof-of-concept. Due to my work, I started getting interested in all kinds of tech stuff and blew up my project more and more. So this is what I have created:
  • I now have a containerized back end application that runs the algorithm and does some other stuff.
  • Various API endpoints through which to communicate with the back end.
  • A web server that runs the front end and hosts my back end containers.
  • A SPA front end that uses the back end's API endpoints to ...
    • provide Swagger-based API documentation, so that others can use my algorithm.
    • visualizes the algorithm so that plebs can see what's happening.
    • includes a documentation on the how the algorithm works.
  • Automated testing
  • GitHub projects
  • Some other small shit ...
Anyhow, now to my problem: despite having tested the algorithm with literally hundreds of randomly-generated datasets , I have recently found a case which breaks my algorithm. :'(
Now I am faced with the reality that my algorithm is not a 100% of the time delivering the correct result, but may - under very specific circumstances - provide an erroneous result. Unfortunately, the algorithm works correctly and the issue is with my conceptual idea of it. Meaning that it can't be fixed with simply tweaking some code.

As the project grew, my plan of what to do with it also evolved from it being a simple hobby project into making this some kind of showcase of my skills. As I am anyhow considering switching jobs, I wanted this to be some kind of "portfolio", if that makes sense. I don't want to become a professional developer, but in my field I still need to show technical knowledge ...
Anyway, I am currently thinking of simply throwing everything into the trash and abandoning this project. But then again, I feel that I poured a lot of effort into this and, while the result may not be correct, learned a metric shit ton of new skills. Remember, I am completely self-taught.
So, I wanted to ask the people here who have more experience than me. Should I ...
  1. Abandon the project because the algorithm is faulty?
  2. Finish the project, publish the page, but highlight that the provided algorithm is faulty and kind of say "but hey, I made all this"?
  3. Finish the project, publish the page, but don't tell that there is an intrinsic issue with the algorithm?
I kind of feel like a retard who created something that is essentially worthless, but still I am kinda proud of it. :) So, what do you think? How would this be received and can it be a door opener for a development-adjacent position in a larger company? Or would I be laughed out the door because the essential premise is faulty and what I build around it does not matter for that reason?
 
So, I wanted to ask the people here who have more experience than me. Should I ...
  1. Abandon the project because the algorithm is faulty?
  2. Finish the project, publish the page, but highlight that the provided algorithm is faulty and kind of say "but hey, I made all this"?
  3. Finish the project, publish the page, but don't tell that there is an intrinsic issue with the algorithm?
I kind of feel like a retard who created something that is essentially worthless, but still I am kinda proud of it. :) So, what do you think? How would this be received and can it be a door opener for a development-adjacent position in a larger company? Or would I be laughed out the door because the essential premise is faulty and what I build around it does not matter for that reason?
The real world will always get in your way when you're implementing algorithms, which is why software has to be patched from time to time. If you want to write rigorous algorithms, then you'll have to do theoretical computer science research, which is mathematics. So there is no reason to be discouraged in what you wrote breaking.

As for answering your question, you don't have to publish it publicly if you don't want to, unless you wrote it with a license stating you must provide source on request (in theory). It is enough to put it on your resume, and when the interviewer asks about projects, you deliver a narrative about it: why you made it, what it does, problems you've encountered over its lifetime and how you've overcome them, and so on. If the software covers a topic that the interviewer has knowledge of, they'll probably drill down on it to see the limits of your knowledge, which can only help you in the long run.

Are you generally content working where you are? Try for an internal move if that's an option.
 
Web developers are not real programmers, and they wouldn’t be able to determine if a number was even or odd without a 25 library dependency chain.

The average web developer buys a $200 enclosure for s $35 raspberry pi, and then asks why some poorly supported operating system is not overclocking their super Nintendo emulator.
 
Last edited:
  • Feels
Reactions: 306h4Ge5eJUJ
Web developers are not real programmers, and they wouldn’t be able to determine if a number was even or odd without a 25 library dependency chain..
inb4 someone posts that woman who tried to use if/else statements to do it (that I can't find rn).

Edit: nvm I found it
1670016384400.png
 
Unfortunately, the algorithm works correctly and the issue is with my conceptual idea of it. Meaning that it can't be fixed with simply tweaking some code.
Are you able to figure out if there is a commonality with the failing cases? Having some logic in your backend that checks for the erroneous inputs and redirects to a different algorithm is still fine. And actually it'd help in a portfolio sense too, since it gives you a story to tell about how you dealt with issues that arose from the testing: "I discovered the algorithm doesn't quite work with these cases, so my code checks for those cases first and instead does <separate algorithm>".

Those sorts of issues arise all the time in actual development, by the way. The story of "I had a beautiful elegant pure-mathematical solution to this problem, but then the real world came in and buttfucked it, and now my code is a gargantuan monolith of spaghetti logic dealing with edge cases and everyone who looks at it scoffs and says it's 'way too complicated' and that 'they could do better'" is the story of pretty much every software developer ever.

Lol that's a dude. That's Yanderedev.
"Dude" is a bit too strong of a word to describe what YandereDev is, I think.
 
Now I am faced with the reality that my algorithm is not a 100% of the time delivering the correct result, but may - under very specific circumstances - provide an erroneous result. Unfortunately, the algorithm works correctly and the issue is with my conceptual idea of it. Meaning that it can't be fixed with simply tweaking some code.
So I'm guessing you've considered this, but can you detect these circumstances and flag them?

Programming is really more of an engineering pursuit than a purely mathematical one. Lots of problems in computer science are incredibly expensive to solve perfectly, but most of our modern lives are enabled by plenty and plenty of solutions that are 90% of the way there.

Hell, I mean the whole concept of a cache is pretty ugly if you're looking for an aesthetic mathematical solution to a problem, and yet the web is soaked with caches. (Well, which then go on to cause a bunch of security problems of their own if not very carefully managed, but that's a whole 'nother issue.)
So, I wanted to ask the people here who have more experience than me. Should I ...
  1. Abandon the project because the algorithm is faulty?
  2. Finish the project, publish the page, but highlight that the provided algorithm is faulty and kind of say "but hey, I made all this"?
  3. Finish the project, publish the page, but don't tell that there is an intrinsic issue with the algorithm?
I kind of feel like a retard who created something that is essentially worthless, but still I am kinda proud of it. :) So, what do you think? How would this be received and can it be a door opener for a development-adjacent position in a larger company? Or would I be laughed out the door because the essential premise is faulty and what I build around it does not matter for that reason?
So if you can't flag the unsupported situations, then publish it as some subdirectory on a domain you control and just don't publicize it. Show it off when you're applying for jobs.

It sounds like you learned a bunch about coding, but also infrastructure, deployment, all sorts of little odds and ends that people forget about when pursing a career in software, but are still entirely essential. Stuff that people often learn on the job, and you can demonstrate you're coming in far ahead of the typical douchebag right out of college / six week code camp. That's impressive in and of itself.

Though I have to say, I know your pain. I know what it feels like to be painted into a corner and have to choose between tearing everything down and starting anew (if that's even an option), or just giving up.
Say what you will, at least she didn’t use a long dependency chain.
I mean, the main problem with long dependency chains is with languages, specifically Javascript, that can't distribute binaries. (Or don't have a standardized binary format.)

I don't care about a bunch of C or Java dependencies.
You should decompile Terraria if you want to see the longest fucking nested if/else statement in existence.

e: oh it's up on github

gaze into the abyss of right brackets and despair
Is that from the decompiled binary or the original source? Because decompilers often have to guess at what the original source code was. That could've been generated from some sort of macro system or something.

Or maybe the dev did just copy and paste like a moron lol.
I was confusing him with a woman who posted a comparison of men vs. women coding, and the "man" code is Fast Inverse Sqrt while the "woman" code is just a bunch of comments.
Oh god, yeah. I just spent like twenty minutes racking my brain, trying to remember who that was. She became a laughingstock.

I was thinking, like coding with Kalie? Something like that?

Turns out, Karlie Kloss:
a5f5b89ba86efc2146fda7bfaff18858.jpg

I think there's some other hilarious stuff she's done.
Can you learn AWS on your own (without online courses) or what are some good AWS courses?
I really never know what job listings are asking for when they ask if you "know AWS".

Like, I've made use of several different AWS APIs, like textract, S3, EC2, and others. I've used them together, separately, from APIs, from the CLI, etc.

None of these projects were that impressive, btw. You read the docs for the API you want to use, they're usually very good. Hook things up and it'll work.

I guess what confuses me is that there isn't really any common "AWS" to learn. Like at most, there's a common user/access/permission system, so a big organization can give out user IDs and keys for smaller departments to access the above APIs without accessing each other's data. Beyond that, most AWS services seem to be pretty independent to me.

Idk, just start a hobby project that uses like, EC2 and a couple other AWS APIs and make it work. That's about the level of effort I put into feeling justified putting "AWS" on my resume.
 
Anyhow, now to my problem: despite having tested the algorithm with literally hundreds of randomly-generated datasets , I have recently found a case which breaks my algorithm. :'(
Now I am faced with the reality that my algorithm is not a 100% of the time delivering the correct result, but may - under very specific circumstances - provide an erroneous result. Unfortunately, the algorithm works correctly and the issue is with my conceptual idea of it. Meaning that it can't be fixed with simply tweaking some code.
So does the algorithm work correctly or not? Any sufficiently good algorithm should have a very clearly defined input domain that it functions correctly within.

From what you're saying, it sounds like you're finding data that isn't actually in-scope for what your algorithm does. Which is fine! Just as long as you can semi-rigorously define what kind of inputs your algorithm works for and also provide some kind of error when an input isn't valid.

This is pretty common tbh and a large amount of software engineering is being able to define your problem and solution precisely (while also fitting business requirements).
 
Anyway, I am currently thinking of simply throwing everything into the trash and abandoning this project. But then again, I feel that I poured a lot of effort into this and, while the result may not be correct, learned a metric shit ton of new skills. Remember, I am completely self-taught.
Regardless of your final decision I definitely wouldn't throw what you've done away, even/especially if it doesn't work. For one you have been able to identify the limitations of your algorithm and why certain inputs break. I have run into a lot of programmers who aren't even capable of testing their own code properly so being able to show debugging/testing skills to an employer is a big plus.

Additionally even if you don't end up publishing/sharing your code you can still use what you've learnt in an interview. If an interviewer gives you a question you're not really sure how to answer or they ask to give an example of a skill or challenge you have faced you can pretty much always refer back to a project you've done as an example of your knowledge.

Personally I list all of my projects whether or not they are complete on my resume if I feel they are substantial enough in either novelty or skill and I definitely think this has helped me in landing interviews.
 
Both of those examples would get you fired or demoted, from the places where I work, for lack of proper documentation.
The left one is the infamous Quake 3 Arena code for the inverse square root. Even with the comments it's not much better, and stands as a great example of why doing clever things might be 'cool' and efficient but should always be documented properly.
Screenshot 2022-12-02 at 21-37-53 Fast inverse square root - Wikipedia.png
 
Back