Programming thread

  • 🔎 If you see an alert for analytics.usips.org, this is a self-hosted system I am running as a test. It is GDPR compliant and collects no invasive information.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
In passing, this tree inverting problem always sounded like some crazy fourth-dimension flipping thing, like what, are you supposed to make the leaves the root somehow, invert the relations or something weird. But it's actually just a stupid tree traversal gotcha puzzle, like if you do it recursively then they ask you "but what if the tree has 1000 trillion nodes, what about then think of the stack retard" and if you don't do it recursively they ask if you can't handle recursion. Cool beans
I'd get the depth of the tree, allocate a buffer like 3x the size for it because that should be enough, and then use that buffer as a stack, so I can do the recuesive solution without actual recursion.

Assuming its a blaanced binary tree, otherwise I'd have to either resort to a linked list or reallocating the buffer.

It also heavily depends on what kinda reqs there are. Does it have to be fast? does it have to be conceptually simple? How is the tree actually stored? If, for example, it's stored as a continuous array of elements you can just loop through it once.

All in all, i'd say that just inverting it is the least important part, but its more important to look at how the person approaches it. Yet, I know that just writing down the solution quickly is valued over actually evaluating the needs.
You have it backwards, Bitcoin is the input and CP is the output.
Wouldnt the actual output of cp be the address of coins?
 
The problem with a lot of CRUD stuff is there are specific bespoke business requirements that have to be added in that often cannot just be done as a generic form or form builder. Often trying to make something generic with a bunch of rules often leads to something known as the "inner platform effect".
I'll link to something written very well that I find explains this nicely: Houyhnhnm Computing

In particular, this chapter contains the following excerpts. I've collected too many, and I recommend reading the entire little series, so I'll explain the core ideas beneath these quotations:
Houyhnhnm computing systems are based on the premise of small modular entities that each do one thing well; and these entities can be combined inside a common platform that does its best to reduce the discontinuity between using and programming. To Houyhnhnms, there is no difference between using and programming; if anything, the difference between a programmer and a user, is that the programmer knows there is no difference between using and programming.
In a Houyhnhnm computing system, programmers do not write standalone applications in non-autistic cases; instead, they write new modules that extend the capabilities of the platform.
Because of the high barrier to communication between applications in Human computer systems, these applications tend to grow into big hulking pieces of software that try to do everything — yet can’t. Indeed, even a picture editor will need to edit text to overlay on pictures, to email the pictures, to browse the filesystem looking for pictures to edit, to search pictures by date or by location, etc. It needs to be extensible to accept new file formats, new color schemes, new filters, new extraction tools, new analyses, new generation techniques, new scanning sources, new social networks on which to publish pictures, etc. Soon, it becomes a platform of its own, its own extension API, its own scripting language, its own plugin ecosystem, its own configuration system, its own sandboxing infrastructure. Every successful application grows this way, until it does many of the same things as all the other applications, all of them badly, except those within its own application core.

In a Houyhnhnm computing system, a picture editor will handle picture editing, and picture editing only — and do it well. It will delegate sending email, browsing the filesystem, searching for pictures, etc., to suitable other modules of the common platform. Instead of extensions being available for a single application, they will be available to all software. Thus, whereas Human computer systems feature one unwieldy file selector for each application, Houyhnhnm computing systems instead will have a single file selection service for the entire platform. All the improvements ever made to file selection will be available to all activities instead of only a single application: preview of contents, browsing history, restriction and search by type or by many criteria beside filename hierarchy, relevance to context, selection or tagging of multiple files instead of one at once, automatic refresh of search results, generation of content on demand, etc. Security will notably be improved by each component only having access to the capabilities it needs, containing any security breach by construction.
Part of this "Inner-platform effect" is because our modern systems are so shitty that this becomes the only option. I try to do just about everything in GNU Emacs, but there's just no other good way to do some of the things Emacs enables on our current systems. The very notion of an immutable yet opinionated kernel betrays the system as one in which things may be added, but not really modified in any meaningful way, unless the program is explicitly designed for it. This is one reason, I suppose, why sh programs are so popular: They're always distributed, and used, as their source code and have no protections whatsoever against any tweaks. Every program should be like this without a very good reason.

So, back to the CRUD stuff, the simple fact is most of these things would be a few hundred lines of code, a handful of definitions for functions and everything else, in any properly designed system, but we're not using a decent system, so everything gets reimplemented over and over and over again in shitty ways.

I don't know, look no further than the spreadsheet, or Microsoft Excel as a specific example, to see how people will gladly get over the desire for a specific appearance and behaviour so long as the fucking thing works well.
And you would be wrong. The incentives behind modern software are what create shit software.

i.e., "Show me the incentives, and I will show you the outcome."
I see a lot of this on Hacker News. They claim to capable of writing decent software, but I never see any examples of it. Their job doesn't let them write good software, but then they're too tired to write it in their spare time either, but they're definitely able to do it; they went to a bootcamp after all. They're lying to themselves because the only other choice is recognizing their pathetic nature. Plenty of programmers are like this.
Software engineering isn't a traditional engineering discipline. Maybe it should be called something else, and thus why people are often called/call themselves "developers", "programmers" and "hackers".
It's not engineering because there are no real standards. When I think of an engineer, I think of someone who loses his license and maybe goes to prison for fuckups. Software unintentionally kills people, but no programmer faces real consequences for that, at least not most of the time.

I'm a hacker, personally.
An understanding of computer science is often not required at all to build good software. Knowing algorithms well enough to whiteboard them isn't a requirement to be able to build good software.
Not only did he not know the basic things, but he also did not see anything bad about his lack of knowledge. These fucking people have no standards.
I'll segue to another point I've made in this thread previously. I'm sure we're familiar with bell curves, and we can imagine people with no computing experience whatsoever on the left end, and the best hackers on the right end. Technology, like HyperCard and Emacs, gets made by people on the right end, but then enables those on the left end to write useful software. The video game Myst was originally a HyperCard stack. There are countless stories of men who had never used a computer going out, buying a Macintosh, and just creating in it until they made seriously impressive work they could share or even sell. There's the story about secretaries using Emacs and automating their work through keyboard macros or whatever, not understanding they were programming. These people never could've made the systems they used, but how many of us could build a nuclear reactor before they existed?

So, who does that leave in the middle of this curve, but the weenies? These are the people who love the complexity, the arcane nature, the footguns, and everything else utterly worthless. The simple fact, I believe, is most of what we call computing is utterly fucking worthless anti-knowledge. A hacker will eventually, if he's good, move on to something like abstract mathematics and start discarding or disregarding knowledge that really isn't worth much. The novice knows little to nothing, which means he can at least judge whether one choice is better than another when given a good and a bad option; what normal person would build an interface in something like HyperCard, or Decker, and then let some fucking nerd convince him that actually he needs HTML, CSS, and here's the latest JavaScript transpiler with five hundred dependencies before he can place a button that plays a sound when it's pressed? So, in the middle, we've got the fuckwits who start worshipping this useless knowledge, like the Suckless cult, who have forgotten that computers exist to do something useful in the first place.

So, I guess I'll conclude this rant with the following: Yes, people don't need a knowledge of mathematics, lambda calculus, Turing machines, or any of that to write useful software; in fact, they need next to nothing when given a good environment, as almost all of the "software engineering" knowledge is in fact unnecessary.
 
I see a lot of this on Hacker News. They claim to capable of writing decent software, but I never see any examples of it. Their job doesn't let them write good software, but then they're too tired to write it in their spare time either, but they're definitely able to do it; they went to a bootcamp after all. They're lying to themselves because the only other choice is recognizing their pathetic nature. Plenty of programmers are like this.
This is the only point I am going to reply to because tbh, I feel like the rest of this conversation I had years ago.

I am going to comment on "Their job doesn't let them write good software."

I am very good at building software simply. I often build stuff in very straightforward ways. It is often fast because I bother optimising things like payloads, round trips, etc.

The application I'm writing could have been a .NET/Flask app/Go service (or anything similar) with a SQLite database and using a decent test framework for e2e tests, running on a single Linux box and maybe something like redis for dealing with push notifications, etc.

While the application had many features. I could have finished this application in about 6 months if I used a tech stack I am familiar with.

My current position is an "AWS-certified partner". What does that mean? Well, that means everything must be done using AWS and their platform.
AWS/Amazon literally gives them loads of shit for free as a result. I also think it sends them clients. So everything revolves around AWS.

This means everything must be built using their tooling. Every webservice is built using lambdas, which require Docker images per lambda, which require a CDK script to deploy said Docker images and set up routes. My machine grinds away all day compiling JavaScript to turn into YAML and pushes this up to the cloud somewhere where it makes the changes. The whole thing really requires TDD; however, I can barely get my co-workers to write tests.

When I started said job, I didn't know any AWS; I told them I didn't know it. They said, "Don't worry; we have loads of experts on the platform." This was a fucking lie.

To make matters worse. I work with two morons. One I believe cannot code; I barely understand what he says. I report this to my manager; he does nothing about it.
So what happens is I spend most of my time fixing their fuck-ups or talking them through how to do an interactive rebase.

I can't write a simple application because I am mandated by the company to use particular technology.
I can't rely on the two guys to do anything and can't have them replaced.
I can't improve my situation because I hit a brick wall in management.

That is what is meant by "Their job doesn't let them write good software".
 
Last edited:
In passing, this tree inverting problem always sounded like some crazy fourth-dimension flipping thing, like what, are you supposed to make the leaves the root somehow, invert the relations or something weird. But it's actually just a stupid tree traversal gotcha puzzle, like if you do it recursively then they ask you "but what if the tree has 1000 trillion nodes, what about then think of the stack retard" and if you don't do it recursively they ask if you can't handle recursion. Cool beans
I think this gets to the core of why Google uses those types of interview questions. There are no objectively right answers, which means that all American applicants can get it "wrong", which can then be presented to the Department of State as proof that there are no qualified applicants and more H-1B visas are needed.
 
What's a good mid level programming type job for someone who already has a science degree but little programming experience?

Is it web development, databases, cloud shit? I know little about this stuff but I'm looking to change careers soon.

Whenever I ask questions like this all the programmers say I shouldn't bother or that this or that language won't exist soon. Very unhelpful
 
I think this gets to the core of why Google uses those types of interview questions. There are no objectively right answers, which means that all American applicants can get it "wrong", which can then be presented to the Department of State as proof that there are no qualified applicants and more H-1B visas are needed.
Now, I am not an American, so I am not fully aware of all the problems that you guys are facing there, but I highly doubt that these interview questions are intended to bring more Indians in your country.

What's a good mid level programming type job for someone who already has a science degree but little programming experience?

Is it web development, databases, cloud shit? I know little about this stuff but I'm looking to change careers soon.

Whenever I ask questions like this all the programmers say I shouldn't bother or that this or that language won't exist soon. Very unhelpful
Try python. It is an easy language to start with, and it is used almost everywhere.
If you will find the job fun - there is no problem in switching the stack. Some guys learn new languages just for fun.
 
The problem is you're competing against no-lifers who have done nothing but programming since before puberty. You're better off going into operations and fixing people's broken systems.
On the other hand, I'm on year 15 of my software engineering career, working at 5 different companies and so far I'm the only person who fits your "no-lifer who coded since before puberty" description out of all the people I've worked with. Nowadays most devs are normies or normy-adjacents who write their first line of code at university, or later.

Maybe it's different if you build compilers for a living or work in game dev.
 
On the other hand, I'm on year 15 of my software engineering career, working at 5 different companies and so far I'm the only person who fits your "no-lifer who coded since before puberty" description out of all the people I've worked with. Nowadays most devs are normies or normy-adjacents who write their first line of code at university, or later.

Maybe it's different if you build compilers for a living or work in game dev.
Most devs are mortgage devs and don't give a shit outside of work.
 
Now, I am not an American, so I am not fully aware of all the problems that you guys are facing there, but I highly doubt that these interview questions are intended to bring more Indians in your country.
I don't know where you are from but these question are only meant to disqualify American applicants so that they can then turn around and hire fellow jeets. They don't have to give different applicants the same interview or compare results from the interviews. Its all closed and proprietary but people figure out the scam, nevertheless. Nowadays, they simply say that Americans are a 'poor cultural fit' for jobs in American companies and that's that.
 
I have a question for the guys who have learned or used Lisp.
What is the appeal of the language?
Forgive me for brevity this time. Common Lisp is a language where I can look at design decisions, and although some are odd, none are wrong. There are no glaring flaws with the language as one finds in others, nothing it makes impossible in a standard function just because no one noticed at the time, as an example. It's very pleasant to use a language with such a design. It's also got a very interesting history. Common Lisp's UNWIND-PROTECT dates back to TECO, as an example. It's an excellent starting point for further learning because of this.

People think of Python as a dynamic language, and Common Lisp is simultaneously more dynamic in the ways that matter, and only slightly less dynamic in the ways that make certain kinds of optimizations impossible. The tags of TAGBODY and GO must be static in a way that matters very little, but enables them to be optimized away, as an example.

The metaprogramming is nice, but even things like the numeric tower (Research this term sometime.) are leagues above most other languages.
Does the stuff written in the book transcend the language itself?
Yes, most certainly. It'll induct anyone who truly learns it into the school of The Right Thing and influence his future designs in ways unlike most other languages.
 
The good news is that operations is not needed in the cloud and we're all expendable.

Oh, wait, you mean you need user management for access to your cloud accounts, routing, log management and analysis, load balancers, DNS, SSL/TLS, backup/disaster recovery, automation for new regions and applications, financial oversight of how much those stupid fucking lambdas are costing, security oversight, someone who can actually troubleshoot performance issues. Etc.

DevOps was sold with the premise that developers can operate their own stuff. As we all know many developers aren't really very good at making stuff production ready and they really don't want to support it as they want to go back to coding instead of getting called at 3AM. That's where we, the few, the proud, the stop fucking filling up the disk with 3000 node.js dependencies, come in.
 
What's a good mid level programming type job for someone who already has a science degree but little programming experience?
If you have no experience, you will need to go in on the junior level. I read relatively often that companies aren't hiring many juniors. I don't know whether this is true because it is dependent on location.

Some places (typically big consultancies and big corpos) will run academies. I have no experience of how these work. However, I've met guys that come up through academies at large consultancies; in this role they normally hire someone more experienced to lead the project.
Is it web development, databases, cloud shit? I know little about this stuff but I'm looking to change careers soon.
Most jobs will require you to know something about all three. Unless it is some massive megacorp.

The three major cloud services are AWS, GCP and Azure.
Whenever I ask questions like this all the programmers say I shouldn't bother or that this or that language won't exist soon. Very unhelpful
There will always be a need even with AI. However there are many roles in the field that aren't programming but are related, e.g., quality assurance, Security (Blue team / Red Team), Operations, site reliability, etc.
 
Back
Top Bottom