What some programmers not allowed to do? // Random Topic 338
Skills:
AI-Assisted Legal Research70%
Key Takeaways
Exploring restrictions on programmers in ediscovery and other industries
Full Transcript
Welcome to another episode of poorly explained video series where I talk about a topic that I don't understand really well myself, but I try to break it down into the simplest terms just so you could sound smarter when you having drinks with your buddies at a bar. What we're going to talk about today is programming. Now, I actually do know a lot about programming, but what I want to talk about is special type of programming. What if you writing applications for a space program or for a military application? What are some of the restrictions you would have? Could you just write like a Python script and it's going to be good enough or not? That is what we're talking about today. I know this is kind of a technical topic, but if you've been eDiscovery for long enough, I'm sure you wrote batch files, you wrote scripts, maybe you've done Python, maybe even a little bit of C# here and there. So, this may be relevant to you. Uh what I want to talk about is what if you in the military or in space or any kind of specialized industries, what kind of restrictions would you have in your code? Are there things you wouldn't be able to do that you can do normally right now if you just write an app and run on your computer? So, I got three interesting limitations that you would have to deal with for this video. Uh so, let's start with the first one and it is dynamic memory allocation. If you write an application for like um military application, you can never allocate memory dynamically. What does that mean? So, let's say you have a text file and you want to read it into memory and you're going to read line number one, put it in the memory, line number two, put that in the memory. Well, what you're going to have is some kind of array or a list that is stored in the memory that grows as you add more and more data. Well, in military application, that is not allowed. You cannot have dynamic arrays or lists or anything like that. You have to uh create a fixed-size arrays ahead of time and you have to load data into those. You cannot just take more and more memory. Now, I believe the reason for that is memory is a finite resource and they just don't want you to uh grabbing more and more memory in the case that you will well, eventually run out. There may not be same system for swapping data on disk as you have on the computer or things like that. So, basically, you just not allowed to do that because you can run out of memory and cause issues. Now, another interesting limitation comes from I believe NASA, right? For the space application. And whenever you have loops, you must include a maximum number of times that loop is going to run. So, let's say in the previous example, we loaded data into memory and now we have a list of lines in a text file. It's pretty easy for us to say, "Okay, let's just do a loop for each and we're going to run through each line in the file and do something." Well, if you're working for NASA, you have to include a variable that's going to define maximum number of times that loop is going to run. So, you do your condition, whatever it is for the loop, you know, do while or uh for next or something like that. But then you also say, "If and then you have a counter and if that counter reached a certain maximum number, you must exit the loop." So, I believe the reason why this is done is so we don't have loops that run infinitely, right? We never want to be stuck on infinite loop. So, that's why we always have a condition. So, we need to think about what is the maximum number of times this loop could run, uh keep a counter and always check to make sure we didn't exceed that counter and if we did, exit the loop no matter if the work wasn't even finished. To me, that seems pretty inconvenient. Now, another interesting restriction you may have is on your functions and your function may have maximum allowed complexity. So, there is like a point system which defines how complex a function is. So, when you call it, uh there might be things like if then and then you do whatever things you're going to do. So, let's say you have an if then in your function, that's going to be one point. You do something else, that's another point. You do another if then, that's another point. And there is like a point system where your function cannot exceed I I forget what the actual number is. It's like more like 10 points or 12 points or something like that. Um that is just designed to limit complexity of your functions. You cannot put too much stuff into them. Once you have too many if thens or switch or whatever conditions you have, you have to start a new function. You have to break it up somehow and this point system forces you to do that. And this is also going to make your debugging easier and easier to understand what's going on. Uh again, seems pretty inconvenient. I have like gazillion if thens and all kinds of stuff going on in my code. Uh but if you're doing a programming for military application, that's something you have to consider. And finally, let's end on the most obvious part, of course, if you're a programmer, is recursion. You are not allowed to use recursion. Kind of obvious if you're a programmer, but if you're not, let me explain. So, let's say you have a program that reads uh content of a PST and we have a function that reads a uh content of a folder. So, our function is going to go message by message uh one at a time and it's going to go through the entire folder and when it gets to the end, it's going to say, "Are there more folders?" And if there are more folders, it's going to call itself again and it's going to run again and if it finds more folders, it's going to call itself. So, it's a function that calls itself over and over and over uh to accommodate a nested structure of folders. We can do a sort of like a nested function and then once the last function ends, it's going to return control to the previous one to the previous to the previous one and sort of the tree is going to collapse back. Um this also does this dynamic memory allocation and all kinds of stuff where um you can have a function that starts taking up more and more memory and you just don't know how far it's going to go. There is no limit, right? Just like we don't know how many folders we're going to have. We don't know how many copies the function is going to replicate itself in order to handle all the folders. And so, that's also a major violation of a programming guidelines for space and military application. Now, I know this wasn't necessarily useful to you to help you get your job done, but I hope it was a little bit entertaining and maybe satisfy your curiosity as to what other people have to do when they develop code. If you have anything else you want to add to this, put it in the comment section below. Don't forget to follow on LinkedIn, subscribe on YouTube and I will see you on another video.
Original Description
If you have been working in ediscovery long enough chances are you have written some code. It may have been a batch file, CPL, Python script or even small app. Have you ever wondered if developers in other industries have access to same tools and allowed to write same code? Let’s talk about it.
#ediscovery #legaltech #legaltechnology #litigationsupport #legaloperations #legalservices #litigation #legalsupport
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
More on: AI-Assisted Legal Research
View skill →Related Reads
📰
📰
📰
📰
The Legal Void: Why OHADA Has No Answer for Algorithmic Trading
Medium · Machine Learning
Swatch wants $170m from Samsung over copied watch faces
The Next Web AI
Sarah Wynn-Williams sues Meta over efforts to keep her quiet
The Next Web AI
Change in Registered Office: Why Companies Must Update Their Official Address Properly
Medium · Startup
🎓
Tutor Explanation
DeepCamp AI