3
0

coding thread


 invite response                
2022 Oct 18, 8:27pm   11,011 views  95 comments

by richwicks   ➕follow (2)   💰tip   ignore  

Since there are a significant number of nerds here, I wanted to start a thread for projects.

People seem to INSIST on using cloud storage, which removes your ability of privacy, so I'm going to write a strong encryption program using the NaCL librarary;

https://nacl.cr.yp.to/

The goal here is that the resulting encrypted data is impossible to recover without getting the original key. Keys are changed regularly, and being able to brute force one block will give the attacker no advantage in cracking the next block.

Also, it will be computationally expensive to attempt to crack even with specialized hardware. This increases energy consumption and slows down the encryption and decryption, but also will make brute force attacks 1000's of times slower.

« First        Comments 10 - 49 of 95       Last »     Search these comments

10   Tenpoundbass   2023 Jun 13, 6:55am  

richwicks says

My conclusion: they don't want to hire, period


A question made by some Indian ex-Intel engineer. Designed to disqualify anyone not of their caste.

But if you have 4 processors, and 24 jobs, and the answer isn't 6, then fuck them! It's a bunch of superfluous bullshit.
11   Tenpoundbass   2023 Jun 13, 7:08am  

A question like this is very subjective without machine specs and a business use case.
Some processes require semaphores and locks while others do not,. Aside from Crypto mining most cases wont need more than the internal load balancing of the server.
12   stfu   2023 Jun 13, 9:16am  

I don't understand "No CPU can have one more or one less job running next to it" - doesn't this mean that all CPU's have to be running the same number of jobs as every other CPU?; and that all additional verbiage is just to confuse the issue?

My answer would be the Kth CPU runs the same number of jobs as every other CPU.
13   Tenpoundbass   2023 Jun 13, 9:28am  

stfu says

My answer would be the Kth CPU runs the same number of jobs as every other CPU.

Tenpoundbass says

But if you have 4 processors, and 24 jobs, and the answer isn't 6, then fuck them! It's a bunch of superfluous bullshit.

Yup!
14   fdhfoiehfeoi   2023 Jun 13, 10:52am  

During that hour they wasted with a brain teaser, they could have asked you all kinds of specific devops or programming questions. My opinion, brain teasers are pointless. I care more about someone's ability to clearly communicate, technical prowess, and being open to new ways of doing things. I've been on a few interview panels at different companies.
15   fdhfoiehfeoi   2023 Jun 13, 10:55am  

richwicks says

People seem to INSIST on using cloud storage


Now there is cloud storage by some mega corp you should never trust, then there's a VPN into a server at your friends house. Both are technically cloud, but one you actually know the person, so trust makes more sense. But storage should always start at home, where you have quick physical access should something come up, and most importantly, internet goes down, your shit still works, because it's LAN. Start there before worrying about the only purpose cloud should ever serve, redundancy.
16   Peter1656   2023 Jun 13, 12:06pm  

richwicks says


I've given you more information than I had, can you solve this in an hour?

You need to join LeetCode.com . I've been having fun on that site answering questions for the last 6 years. I've finished nearly all the free ones. (over 2000 questions). This question (phrased differently) was given at least 2 years ago and was also given as a "question of the day" just 3 days ago!

The big insight (after finishing 2000+ questions!) is that you can binary-search the correct answer. Turn the question around: Put a bunch of jobs on the special CPU and see if the total number of jobs doesn't exceed the allowed when distributed across all the CPUs. Obviously, the most go on the special CPU and then each CPU to left or right is decreasing by 1. The little hiccup is that you can't go to zero--a much of CPUs might get 1 job. Binary search the number of jobs on the special one; for any guess that is lower than max, you'll be able to accomodate all the jobs (across all the CPUs); for any guess higher than the max and you'll see you can't accommodate all the jobs. The binary search finds the threshold between the two. On LeetCode, just using binary search isn't fast enough to pass muster; you also have to calculate the number of jobs used by the non-special CPUs quickly.

Can I solve this question in an hour? Yes. Actually, I have:
https://leetcode.com/problems/maximum-value-at-a-given-index-in-a-bounded-array/

Hmm... I marked the below as code, but it's not honoring the all-important indenting. I'll add some dots instead.

class Solution:
...def maxValue(self, n: int, index: int, maxSum: int) -> int:

......def calcRange(high,length):
.........if high > length:
............return (high + (high-length+1)) * length // 2
.........shortLength = high-1
.........leftover = length - shortLength
.........return calcRange(high,shortLength) + leftover*1

......def calc(m):
.........return m + calcRange(m-1, index) + calcRange(m-1, n-index-1)

......return binSearch(0,maxSum+1,lambda m: calc(m)>maxSum) - 1

def binSearch(low,high, lam):
...# returns lowest value between low and high for which lambda gives True
...while low < high:
......mid =(low + high) // 2
......if lam(mid):
.........high = mid
......else:
.........low = mid + 1
...return low
17   SunnyvaleCA   2023 Jun 13, 12:35pm  

Hm... Weird. I have no idea why I was mysteriously logged in as Peter1656 above. Sent email to Patrick.
18   SunnyvaleCA   2023 Jun 13, 12:38pm  

richwicks says

People seem to INSIST on using cloud storage

Are they merely using cloud storage? Most people are using cloud services, which includes storage, search, database, and now AI! If you're trying to encrypt the data stored in the cloud, then those other services will need to be able to decrypt in order to work on your data.
19   richwicks   2023 Jun 13, 1:41pm  

stfu says


I don't understand "No CPU can have one more or one less job running next to it" - doesn't this mean that all CPU's have to be running the same number of jobs as every other CPU?; and that all additional verbiage is just to confuse the issue?

My answer would be the Kth CPU runs the same number of jobs as every other CPU.


OK. Say this you have 5 CPUs and they look like this:



Each processor is labelled at the bottom, the preferred processor is "0" and there's a total number of 15 jobs on 5 processors

there are 5 then 4,3,2,1 JOBs running on each processor (X represents a "JOB"). CPU1 has 4 JOBS, but can't have 3, because CPU0 has 5 JOBs +1 more, and CPU2 has 3 JOBs

But what if processor 1 is the preferred CPU? Then it looks something like this:



I finally figured out how this works. I can see how you COULD do a binary search, but the solution is arithmetical, I believe. You have to know this:



If you don't, you can't solve it, and I couldn't remember it. Also the calculation of the area of an Isosceles right triangle is (i.e. right triangle width == height), and I didn't know that and it took me a while to figure it out:

A = (w+1)/2+(w*w/2)

This only works with integer math and it's true for all cases of w including 0.

I'm starting to wonder if the interviewer had the math right because as I delve into this, I had to remember the series function to square a number, and also figure out how to calculate exactly the area to make a Isosceles right triangle. Should I know this shit off the top of my head?

Anyhow, this has a solution that can be directly calculated given a total number of jobs and the preferred processor and number of processors. You don't need to do binary math, but the equations I'm just figuring out, and it's integer math which means I can't be off by 1, and I have to find out when I need to round down and round up to the nearest integer. So far, looks like everything is round down.
20   richwicks   2023 Jun 13, 1:57pm  

@Patrick - New Bug:



I'm just clicking "quote" on a post - can't do it.
21   richwicks   2023 Jun 13, 2:00pm  

Peter1656 says

Can I solve this question in an hour? Yes. Actually, I have:


In you solution, where is the preferred CPU listed? It DOES make a difference as I've shown here:

https://patrick.net/comment?comment_id=1960746

I don't think my interviewer realized that the CPU's position made a difference.
22   richwicks   2023 Jun 13, 2:04pm  

SunnyvaleCA says

richwicks says


People seem to INSIST on using cloud storage

Are they merely using cloud storage? Most people are using cloud services, which includes storage, search, database, and now AI! If you're trying to encrypt the data stored in the cloud, then those other services will need to be able to decrypt in order to work on your data.

The whole point of cloud "services" is to hand over your data to a corporation.

Because it's "convenient".

It's like using Alexa - it's "convenient". Got one? What is a pet you would NEVER EVER own? Well, pretend among your family you are about to get this new pet. Talk about it, make plans about it, in front of the Alexa - see how long it takes before you get advertisements for accessories for this pet.

It's a spy device, and it CONSTANTLY listens to you, not just when you prompt it. I can tell you this, just gave you a test to confirm it, it's continually listening to you. You'd think this would end people having Alexa devices - nope. People literally aren't bothered by having a machine CONTINUALLY listen to them 24 hours a day 7 days a week, and it's all recorded as well.
23   Patrick   2023 Jun 13, 4:44pm  

richwicks says


Patrick - New Bug:



I'm just clicking "quote" on a post - can't do it.


@richwicks, not a bug.

There needs to be a limit on quote size. Before, I was trying to abbreviate the middle of an excessively large quote, but that caused problems with html parsing.

So my new solution for a too-large quote is to ask the user to select something smaller.

If you click "quote" without selecting anything in your example, that's too large. So you should select a portion of the comment, and then click quote.

Let me know if I misunderstood you.
24   richwicks   2023 Jun 13, 5:16pm  

Patrick says

richwicks says



Patrick - New Bug:



I'm just clicking "quote" on a post - can't do it.


richwicks, not a bug.

There needs to be a limit on quote size. Before, I was trying to abbreviate the middle of an excessively large quote, but that caused problems with html parsing.

So my new solution for a too-large quote is to ask the user to select something smaller.

If you click "quote" without selecting anything in your example, that's too large. So you should select a portion of the comment, and then click quote.

Let me know if I misunderstood you.


Why limit quote size? You know how small characters are. 8 bits.

It's your site, but consider how small a quote is in terms of data storage.

Everything you have now, fits on a $11 SD Card. I believe you still think there are storage limitations, there aren't. You're still in the 1990's.
25   gabbar   2023 Jun 13, 5:19pm  

So, I have a sophomore student in Computer Science at OSU. Which programming languages should he learn? And how?
26   fdhfoiehfeoi   2023 Jun 13, 6:52pm  

Javascript and Java are always big ones, but Python seems to be gaining popularity. It kind of depends on if he knows what he wants to do. Front-end/UI, JS all the way. Security or devops, Python.

There are plenty of good free tutorials online, but from what I've heard those coding camps work really well.
27   richwicks   2023 Jun 13, 10:37pm  

gabbar says


So, I have a sophomore student in Computer Science at OSU. Which programming languages should he learn? And how?

Have them learn a very low level language like assembly (useless) to understand what the machine does.

And a very high level language to understand concepts.

And then fill in the inbetween. That's a good solid start. Assembly is essential to know what is going on, IF they want to know what is going on. High level languages are entirely abstractions, they are slow in comparison to lower level languages, but you have hashes, you have dictionaries, regular expressions, all this weird shit which would take forever to implement in a low level language.

BTW: C++ has improved VASTLY since I last used it. It no longer sucks!

I didn't really understand the concept of a pointer until I learned assembly, and then it was "oh, it's just a pointer to a memory location", because in assembly, there really aren't any variables, there are only memory locations. Once you learn assembly, it's TRIVIAL to understand how the CPU works. Nobody knows what a register is until they work in assembly. A register is a storage location for a value when you do this in C:

i += 1

What is happening really is in pseudo-assembly is something like:

load REGISTER1, MEMORY_LOCATION # load the value in memory_location into register1
set REGISTER2, 1 # set the value of register2 to 1
add REGISTER3, REGISTER1, REGISTER2 # add register 1 and 2 together and store the result in register3
store REGISTER3, MEMORY_LOCATION # store final result in memory_location

There's 4 steps to it, but it might be as little as 3, because adding 1 to a value is so common, it's often part of the chip.

Once they understand assembly, they understand the machine IF they want to understand it. Assembly was fascinating to me. Once I understood it, all other languages were just abstractions to it, but higher level languages gave me the ability to see and work with concepts which were FAR too complicated for me to ever implement in assembly.

You have to learn many high level languages, and a few lower level languages. You don't have to learn higher level languages well, it just introduces you to many concepts which you can implement elsewhere. The concept of a class in C++, brilliant idea, but it's trivial to implement that in C. You're just passing around a pointer to a C structure to every function. There, that is basically C++. C++ used to be nothing more than a preprocessor for C - it took in the C++ code, and through a bunch of macros and conversions, made a C file, and compiled that.
28   SunnyvaleCA   2023 Jun 13, 10:56pm  

richwicks says


In you solution, where is the preferred CPU listed? It DOES make a difference as I've shown here:

Yes, it's the input parameter index.

I think LeetCode practice is kind of standard in this competitive market. I first got into it for entertainment — I wanted to explore some dynamic programming problems. Later I used it to learn Python.
29   richwicks   2023 Jun 13, 10:59pm  

Peter1656 says


Hmm... I marked the below as code, but it's not honoring the all-important indenting. I'll add some dots instead.


I believe this solution can be made with a single calculation, with 3 edge cases:

preferred CPU = 0
preferred CPU = 1-total CPUs
JOBs < 1/2 x CPUs x CPUs

I can't use asterisk her, because it's taken as "bold"

Using a binary search I think is sloppy.

I was surprised by the question because I can see no relevancy in implementation. I have 30 years of coding under my belt, and have never seen a reason to do this, and I've done priority inversion on an operating system - that's non trivial. This is when a low level process has secured a resource, and a higher level resource wants this resource. The solution is to TEMPORARILY increase the priority of the low level resource so it can free it. But what if you have 7 processes requesting this resource?

The solution is, you increase the priority to the maximum process that wants it until it frees the resource. You only pay attention to the top one.

Useless knowledge at this point. People who still use processes are, in my opinion, morons. Everything should be a program not a thread, and use interprocess communication and event driven. It drastically reduces errors, and entirely eliminates race conditions. I wouldn't want to go back to the 1990's again.

No more semaphores, no mutexes - kill them all. These are obsolete ideas since protected memory came into play. Threads shouldn't exist at all today. I don't even know if there are chips that still don't have virtual memory at this point. I'm sure they still exist, but they shouldn't.
30   SunnyvaleCA   2023 Jun 13, 11:19pm  

richwicks says

I believe this solution can be made with a single calculation, with 3 edge cases

Perhaps your problem is different than the LeetCode one, but I don't think so.
Here's my understanding of a simplified version of the problem you had...
Suppose, for simplicity, the 0th CPU was the special one. If you give it 8 jobs then the whole set of CPUs get 8, 7, 6, 5, etc. jobs. The catch is that every CPU after the 7th needs to get 1 job (the minimum number of jobs) — not 0, -1, -2, -3, etc. So the distribution of jobs is non-linear and so the solution is not a polynomial. When the binary search "guesses" an answer, it can verify in constant time, so the algorithm runs in log(n) time. That might be "sloppy," but if the count of CPUs and count of jobs each fit in a 64-bit integer, logarithmic time will be nearly instantaneous on the worst possible input.
31   richwicks   2023 Jun 14, 1:33am  

SunnyvaleCA says


richwicks says


I believe this solution can be made with a single calculation, with 3 edge cases

Perhaps your problem is different than the LeetCode one, but I don't think so.
Here's my understanding of a simplified version of the problem you had...
Suppose, for simplicity, the 0th CPU was the special one. If you give it 8 jobs then the whole set of CPUs get 8, 7, 6, 5, etc. jobs. The catch is that every CPU after the 7th needs to get 1 job (the minimum number of jobs) — not 0, -1, -2, -3, etc. So the distribution of jobs is non-linear and so the solution is not a polynomial. When the binary search "guesses" an answer, it can verify in constant time, so the algorithm runs in log(n) time. That might be "sloppy," but if the count of CPUs and count of jobs each fit in a 64-bit integer, logarithmic time will be nearly instantaneous on the worst possible input.



OK, here's the solution, that doesn't quite work.

The problem is really you have an array (that's the CPUs) and every element in the array must contain at least "1". If you add up all the values of the array, you will have the value V.

No element in the array can be +/- 1 form an adjacent element in the array. The value next to to any adjacent element can't be more than 1 off, but the difference can be 0.

Find the maximum value you can place in the array with these constraints given that all values in the array need to add up to V

SO - here is what I did. I think of it as a volume. The value "V" is a volume

First, since V is really a volume, the minimum height can be calculated with:

V = W x H
H = V/W

We need 1/3rd of the volume to build the pyramid, so the max height is actually

2/3 V = W x H
H = (2/3 V) / W
H = 2 x V / W x 3

that's the height of the base, the rectangle.

Now, the area of a triangle is 1/2 x W x H. The volume of this is 1/3V

1/3V = 1/2 x W x h

h = 1/3V * 2 / W
h = 2/(3V x W)

Add H and h together, and you get the result.

BUT I'm ignoring a few constraints.

My mind is still baking on this problem. I think a binary search is a sloppy method to do it. I'm confident this can be done arithmetically with at most 3 constraints.

Fucking math. Give me a math problem, and I can't stop working on it until I solve it.

First, you subtract W (number of array elements) from the volume. then you calculate the rectangle, then produce the highest possible pyramid on top of that from the 1/3rd of that block. It's all integer math as well, so if you can't produce a block, you just have the remainder to work with, or if you can produce a block it's 1/3rd of the block PLUS the remainder. It's all complicated because of it being integer math, and I need to think more on it.

I bet this can be done with float math, and get within 1 of the true value, if not always being correct if you always round down.

But this neglects the edge cases where the top point is at the start of the array, or at the end of the array.
32   GNL   2023 Jun 14, 5:18am  

Can I take a poll with you all?
If you were starting from scratch, what would you use to create a commercial website?

What the site does: upload/download (domestic and overseas), payments, Google map and Google calendar to create schedules based on time/distance, overlays on photos until payment is made, cron jobs for deleting old files/images and emails, user rearranging/sorting images for slideshow displays, user registrations, api for transferring images and links to other websites and image mapping.

Also: when and/or what would make you recommend a client rewrite a company website?
33   fdhfoiehfeoi   2023 Jun 14, 8:09am  

richwicks says

Have them learn a very low level language like assembly (useless) to understand what the machine does.


Good callout. C or C++ are the still the preferred language for physical machines that have to do very high load operations. When I worked at Illumina, their DNA analysis SW was all C I believe.

Also forget to mention Python seems to be the language of choice for AI if you are interested in getting into that.
34   fdhfoiehfeoi   2023 Jun 14, 8:16am  

GNL says

If you were starting from scratch, what would you use to create a commercial website?


Before I left a former company, we were in the process of re-writing our travel site integration with EAN(Expedia) as a single page Python app. But I would guess most people would say Javascript, probably React?

Don't invest time in a re-write unless you will gain some significant improvements for your clients, increase your reach, something tangible that improves your bottom line. Worst case you have some massive security issues or you have spaghetti code you have to keep adding to that will make your site impossible to update, then you might have to consider it just for maintenance, but hopefully you've laid a better foundation than that.
35   Tenpoundbass   2023 Jun 14, 8:33am  

Do it in MVC

I once did a similar project for a Nautical Satellite company. I used Google Maps to place the ships coordinates and routes on Google maps.
I did it for a job interview for the company. I turned it around in about 4 days over a three day weekend, and the interviewer wasn't back on the fourth day.
The interviewer gave me an end point, that returned nothing but a bunch of numbers separated by a comma. I guessed that they were x and y coordinates. And ended up being right. Exploring the Help endpoint further I found the View, Details and Insert endpoints. When I emailed it back to them, the interviewer still wasn't back and was out for over two weeks. I ended up taking another job in the meantime. When the guy got back he was telling me that it was better than what they were expecting. No other candidate figured out what the end point was, or even returned the completed test project. All they wanted was someone to hit the end point, and realize what it was and anything beyond that would have been gravy. I was at the time, trying to really figure out MVC beyond using wizard and data connecters GUI's, that I found just so restricting and limited if you go by most common MVC documentation. That little project gave me insight on ways to use MVC that 90% of the people that use MVC don't believe is possible. They wanted me to start right away, but I already took the other job. So they asked me if they could use the test project I sent them as the foundation to build their software.

I still have a copy of that project if you are interested.
36   Tenpoundbass   2023 Jun 14, 8:41am  

NuttBoxer says

Don't invest time in a re-write unless you will gain some significant improvements for your clients, increase your reach, something tangible that improves your bottom line. Worst case you have some massive security issues or you have spaghetti code you have to keep adding to that will make your site impossible to update, then you might have to consider it just for maintenance, but hopefully you've laid a better foundation than that


Always do a rewrite. Normally by time you are called to bring a Customer's software to the next level. The previous developer had already coded the project into a hard corner. And the new business requirements would be impossible to factor in without creating a buggy broken system.
If the data model is good, and the enterprise is happy with it. Then the best and quickest way to do a rewrite is to use Code Generating SQL against the tables. I can stub out a whole Enterprise suite in under a week. Then only need to write the business logic layer and the client Scripts.

Examples below...
37   Tenpoundbass   2023 Jun 14, 8:42am  

declare @TableName sysname = 'TaxLine'
declare @result varchar(max) ='[DataObject(true)]
public class ' + @TableName + 'DB
{' + '
' + @TableName + 'Context DFctx = new ' + @TableName + 'Context();

public ' + @TableName + 'DB(){

}'

select @result = @result + CHAR(13)
+ ' [DataObjectMethod(DataObjectMethodType.Select)]
public List<' + @TableName + '> Select(int tableId, int _userid)
{
return DFctx.Get' + @TableName + 'singleton(tableId, _userid);
}
public ' + @TableName + 'Selects(int tableId, int _userid)
{
return DFctx.Get' + @TableName + '(tableId, _userid);
}
[DataObjectMethod(DataObjectMethodType.Select)]
public List<' + @TableName + '> Select(int _userid)
{
return DFctx.Get' + @TableName + '(_userid);
}
[DataObjectMethod(DataObjectMethodType.Insert)]
public void Insert(Dynamic' + @TableName + ' DTable, int _userid)
{
DFctx.Insert' + @TableName + '(DTable, _userid);
}

[DataObjectMethod(DataObjectMethodType.Update)]
public void Update(Dynamic' + @TableName + ' DTable, int _userid)
{
DFctx.Update' + @TableName + '(DTable, _userid);
}

[DataObjectMethod(DataObjectMethodType.Delete)]
public void Delete(' + @TableName + ' DTable, int _userid)
{
DFctx.Delete' + @TableName + '(DTable.' + @TableName + 'ID, _userid);
}
public int Get' + @TableName + 'Count(int _dyntbl)
{
return Get' + @TableName + 'Count(_dyntbl);
}
}'

print @result
38   Tenpoundbass   2023 Jun 14, 9:16am  

Tenpoundbass says

If the data model is good, and the enterprise is happy with it. Then the best and quickest way to do a rewrite is to use Code Generating SQL against the tables. I can stub out a whole Enterprise suite in under a week. Then only need to write the business logic layer and the client Scripts.


I would add, that I preferer to custom script out my own code generation per each project. I do not use Entity Frameworks because it adds way too much buggy sluggish overhead, it's hogs more resources than all of your project's code combined. All of my code generation is external and I plug it into the pages and classes I'm working on by hand. But I can script for any language and any model, for any purpose. Client HTML code, Object Classes, and Data Classes. EFF can not do that. Frameworks can generate cookie cutter code, but it's all the same code from project to project. You can't use Microsoft EFF to generate Python or Java code.
39   fdhfoiehfeoi   2023 Jun 14, 10:53am  

Tenpoundbass says


Always do a rewrite. Normally by time you are called to bring a Customer's software to the next level. The previous developer had already coded the project into a hard corner. And the new business requirements would be impossible to factor in without creating a buggy broken system.


I spent a month testing some API's for a guy who was monetizing a domain purchasing site. He hired an oversea's programmer who slapped a bunch of stuff together with no standardization, and some pretty big security gaps. I pointed it out to him, but due to the fact that he hadn't even launched yet, there wasn't much interest in doing anything beyond plugging the security gaps.

I work in software quality, so my first instinct is always to push for maintenance NOW, but it really does depend on where the business is at.
40   Tenpoundbass   2023 Jun 14, 1:57pm  

The hardest part for any Enterprise software, is getting it to the point to where it is now.
One of the biggest problem with rewrites is they come in thinking they are going to do a total data model redesign. These days they want to shoehorn software written for a unique business case in a unique industry with unique requirements. Into a one size fits all Cloud CRM and ERP. So they are forced to rewrite the whole business process logic and requirements. Any gaps not meeting previous requirements, they outsource to a third party service, lots of third party cloud services, to do what 90% of the companies should be home growing on their own. I try to understand the business reasons for the most fucked up head scratching code, and understand why the previous guy did it so ungracefully. There was always a reason, that even those cloud guys eventually run into. No matter how hard they try to ignore that complicated backwards, stupid way the previous guy was forced to do it. .
But if you take time to understand that you probably would have met the same trap, because you understood, what it was doing, how that process got added on after the fact. And you understand what it does and why it's important.. You can then figure how to gracefully make that process. You can make some of your most elegant impressive code you ever did. And in many ways, you owe it to the previous guy, and the problem he was faced with. That you then built on and made it work.

Most migrations and updated enterprise rewrite development lead, do not understand that process today.
41   GNL   2023 Jun 14, 2:33pm  

Tenpoundbass says

met the same trap, because you understood, what it was doing, how that process got added on after the fact. And you understand what it does and why it's important.. You can then figure how to gracefully make that process. You can make some of your most elegant impressive code you ever did. And in many ways, you owe it to the previous guy, and the problem he was faced with. That you then built on and made it work.

Most migrations and updated enterprise rewrite development lead, do not understand that process today.

I found your comment quite insightful. Yes, we've added many things after the fact because these add-ons were not envisioned at the time. Mission creep has to stop at some point also.
42   fdhfoiehfeoi   2023 Jun 14, 2:51pm  

Last company I worked at for a year and a half was supposed to be migrating their legacy infrastructure to the cloud. We were the last team in line to do this, so not charting new waters by any means. But the code was inherited probably a few times over, and almost no one on the team was there when it was written. I remember one of the engineers after an outage(there were many), comparing what he saw to duct-taping shit together, it was that fragile. Right before I left they had decided to pivot to just migrating to Kafka from MSMQ, and push the rest off, but I seriously suspect the team dev lead, and product owner will be fired when this stuff never completes.

Worst part, they kept dumping new feature requests on the team. I spent more than a few meetings telling them they needed to stop if they wanted migration to ever finish, but there was always an excuse.

My time at that company was split into 1/3 testing(my actual job), 1/3 helping manage process, and 1/3 on call for production issues(usually outages). I don't even want to look at prod support at my current place, still scarred from having to get up and answer alerts in the middle of the night.
43   HeadSet   2023 Jun 14, 4:43pm  

richwicks says

BTW: C++ has improved VASTLY since I last used it. It no longer sucks!

Funny you should say that. The current C++ redistributable somehow omits the msvcr100.dll which causes a graphics program I loaded yesterday to not run. Once I figured that out it was just a copy and paste from a computer that still had that dll.
44   richwicks   2023 Jun 14, 6:05pm  

HeadSet says

richwicks says


BTW: C++ has improved VASTLY since I last used it. It no longer sucks!

Funny you should say that. The current C++ redistributable somehow omits the msvcr100.dll which causes a graphics program I loaded yesterday to not run. Once I figured that out it was just a copy and paste from a computer that still had that dll.


I don't ever work under Windows. I just got fed up with their bullshit ages ago. It won't be long before you have to rent MS Windows, and pay a monthly fee for it. That's already true of MS Office.

I am never going to work under Windows again, ever.
45   HeadSet   2023 Jun 14, 6:39pm  

richwicks says

I am never going to work under Windows again, ever.

I hear you, but the software I like will not run on Linux, and Apple is just a pricey way to do the same thing.
46   richwicks   2023 Jun 14, 6:51pm  

HeadSet says

richwicks says


I am never going to work under Windows again, ever.

I hear you, but the software I like will not run on Linux, and Apple is just a pricey way to do the same thing.

If I have to use Windows, I fire up a virtualbox virtual machine.
47   Patrick   2023 Jun 14, 10:37pm  

GNL says


If you were starting from scratch, what would you use to create a commercial website?


@GNL

I used node.js to rewrite patrick.net a few years ago, and I'm very happy with it. Clearly I'm no visual artist, but performance and maintainability of my current version are the best of any website I've ever seen, if I may say so myself.

Having worked with React, and I learned to detest it as a low-performance ball of yarn. Hell, avoid all front-end frameworks and get people who've actually read most of https://developer.mozilla.org/en-US/ The browser already does everything you need, you just need to figure out how.

This site is one file, patrick_net.js, and all the code is in it except for some unavoidable npm libraries, such as for interfacing to mysql.

I was taught that css and client-side js should go in separate files. That's bullshit. You get dependency problems because of version skew, and clearly lower performance. Yes, external js and css files can be cached, but it's still faster performance-wise to have a single file and include the js and css just where you need them in the generated html. If you're pulling in giant external js and css files you have serious problems to begin with. Don't do that.

And the development speed from a single file is priceless! I literally never need to figure out what file any function or js snippet or css is in, because it's all in the same fucking file. Most programmers spend half their time searching various files for things. I never have to do that. And using ALE in vim to detect errors as I'm typing has saved me vast amounts of debugging time: https://medium.com/@victormours/better-linting-in-vim-with-ale-1e4b1d5789af

I got the single-file idea when I heard that a popular travel site was all one php file. The guy who made it was a newbie programmer, but damn, he hit on something super-useful with that naivete.

I also optimized the shit out of the database, and have a strict naming convention in the db that every column starts with the singular of the table name. So the users table has columns user_id, user_email, user_pass, ... Then when I'm looking in the code at fields I got from the db, I know exactly which table they are from, instantly.

Tons of lessons like that acquired over the last 25 years or so.
48   gabbar   2023 Jun 15, 3:16am  

richwicks says

You have to learn many high level languages, and a few lower level languages. You don't have to learn higher level languages well, it just introduces you to many concepts which you can implement elsewhere. The concept of a class in C++, brilliant idea, but it's trivial to implement that in C. You're just passing around a pointer to a C structure to every function. There, that is basically C++. C++ used to be nothing more than a preprocessor for C - it took in the C++ code, and through a bunch of macros and conversions, made a C file, and compiled that.

Student is already registered to take assembly language in Fall 2023. Thank you for the recommendation.
49   gabbar   2023 Jun 15, 3:17am  

Tenpoundbass says


The hardest part for any Enterprise software, is getting it to the point to where it is now.

How can a sophomore in computer science learn Enterprise software?

« First        Comments 10 - 49 of 95       Last »     Search these comments

Please register to comment:

api   best comments   contact   latest images   memes   one year ago   random   suggestions   gaiste