Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
@Safir Yeah sadly closures are "easy" for people that deeply have studied and experimented a lot with programming.
Too bad that in a lot of jobs the soydev is good enough (probably this is also why we get web pages which take +10MB to render and all that shit).
I hope that the more specialized programming fields are not that pozzed with "good enough" soydevs. *sigh*
 
  • Feels
  • Like
Reactions: Safir and y a t s
Closures are fucking hard.
Are they though? They're basically nested functions that share the variable scope of the outer function that it was defined in. When writing support for it in a compiler, you take the function and encapsulate it along with the variables in the outer scope (hence the name "closure").

but I can't understand a single sentence in the wikipedia article on closures.
I just looked at the article and I agree it's a bit hard to follow. It's all over the place and a tad too wordy to make sense to most readers.
 
Last edited:
I've been writing stuff in C and I've come to the conclusion I don't understand the language well enough to really do anything without it being painful.

So I'm doing a more beginner tutorial in the form of a book. I'd do C programming by K&R but it is very old.

At this point I am convinced every language is dogshit.
Every language has trade-offs. Some languages are better at certain things, and a lot of any language is simply familiarity and experience using it.

That being said I am convinced that there is a niche that has not been filled by any language. A language that is reasonably simple, but has the ability to become abstract if the programmer so desires. Something that is in between something like Go or C, but does not allow nearly the amount of abstraction as Javascript or C++.

Performance does matter if whatever you work on needs to scale as you will be paying the server cost/cloud computing cost.

Language ease of use also matters because if a language is hard to debug then you need more skilled programmers in order to work within it.
>>$100K a year starting
GEE, I wonder if there is a bubble in the tech sector because of unfulfilled promises by large tech companies and now recently the hype of AI.

The automotive industry once had salaries like this because of a similar bubble and then it died a painful death.

There is an economic pattern that occurs where a new industry grows up earn a lot of profit grows massively and then stagnates or dies. That is very obviously happening in tech.
 
I'd do C programming by K&R but it is very old.
To be fair it's not like C has changed at all in the last 30+ years.

Sure, there's a ton more libraries and everyone now knows you always use the 'n' version of library calls, like strncmp

C is at its best in the low level stuff, so write a client server app doing sockets, grab a Pi Pico(RP2040), use Xlib to draw a smiley face, etc.
 
OOP is a spook and doesn't meaningfully exist beyond totally spooked codebases. No one sane uses inheritance, it was and is a bad idea. Reasonable people use composition. So what is OOP? Attaching methods to classes? Literally the same as passing structs to functions. Then, for no particular reason beyond spooked-OOP-brained beliefs, people create huge classes because it's "clean" and thereby destroying the memory locality of data transformations. There are no "OOP" jobs, just jobs and if some company is like "we only hire OOP programmers" it basically means they're retarded and have no idea what they're talking about. Typical bullshit you hear from tech recruiters who do not know anything about programming or what any of these words mean.

As previously linked, despookify your OOP brain with Data Oriented Design: https://www.youtube.com/watch?v=rX0ItVEVjHc
Personally, the worst code I’ve ever had to inherit was DOD
 
but does not allow nearly the amount of abstraction as Javascript or C++
Core language features like structs, functions and enums inherently allow developers to create as much abstraction as they want, your language would be gimped if you somehow figured out a way to stop people layering on abstractions over abstractions.
I am convinced that there is a niche that has not been filled by any language. A language that is reasonably simple, but has the ability to become abstract if the programmer so desires. Something that is in between something like Go or C
Dare I say that niche is already filled by rust?
 
How retarded is this code?

I'm only using super basic Python syntax to the point where it's comical, so if someone decides to answer, keep that in mind.
Python:
alphabet = "abcdefghijklmnopqrstuvwxyz"
numbers = "0123456789"
abc_len = len(alphabet)

def sort(list, pool):
  i = 0
  while i < len(pool):
    list.append(pool[i])
    i += 1
  return list

def delspace(list, pool):
  new_list = []
  list_len = len(list)
  i = 0
  while i < list_len:
    try:
      pool.index(list[i])
    except:
      pass
    else:
      new_list.append(list[i])
    i += 1
  return new_list

def retkey(string, pool):
  new_string = ""
  string_len = len(string)
  i = 0
  while i < string_len:
    try:
      pool.index(string[i])
    except:
      pass
    else:
      new_string = new_string + string[i]
    i += 1
  return new_string

invalid = "Invalid choice.\n"

enc_dec_m = "Do you want to encode or decode?\n1) Encode\n2) Decode\n"
enc_dec = input(enc_dec_m)
while (enc_dec != "1") and (enc_dec != "2"):
  print(invalid)
  enc_dec = input(enc_dec_m)

method_m = "What method do you want to use?\n1) Vigenère\n2) Beaufort\n3) Gronsfeld (Bronckhorst)\n"
method = input(method_m)
while (method != "1") and (method != "2") and (method != "3"):
  print(invalid)
  method = input(method_m)

if method == "1":
  if enc_dec == "1":
    print("You have chosen to encode plaintext to Vigenère ciphertext, (non A-z characters will be ignored).\n")

    vig_enc_plaintext = input("Enter the plaintext:\n").lower()
    vig_enc_plaintext_list = []
    vig_enc_plaintext_list = sort(vig_enc_plaintext_list, vig_enc_plaintext)
    vig_enc_plaintext_list = delspace(vig_enc_plaintext_list, alphabet)
    vig_enc_plaintext_list_len = len(vig_enc_plaintext_list)
    vig_enc_plaintext = retkey(vig_enc_plaintext, alphabet)

    vig_enc_key_list_len = 0
    while vig_enc_key_list_len == 0:
      vig_enc_key = input("\nEnter the desired key:\n").lower()
      vig_enc_key_list = []
      vig_enc_key_list = sort(vig_enc_key_list, vig_enc_key)
      vig_enc_key_list = delspace(vig_enc_key_list, alphabet)
      vig_enc_key_list_len = len(vig_enc_key_list)
      if vig_enc_key_list_len == 0:
        print("Invalid input.")
      vig_enc_key = retkey(vig_enc_key, alphabet)

    while vig_enc_plaintext_list_len > vig_enc_key_list_len:
      vig_enc_key_list.extend(vig_enc_key_list)
      vig_enc_key_list_len = len(vig_enc_key_list)

    vig_enc_ciphertext = []

    i = 0

    while i < vig_enc_plaintext_list_len:
      vig_enc_plaintext_list_letter = 0
      vig_enc_key_list_letter = 0
      check_letter = True

      try:
        alphabet.index(vig_enc_plaintext_list[i])
      except:
        check_letter = False
      else:
        vig_enc_plaintext_list_letter = alphabet.index(vig_enc_plaintext_list[i])

      try:
        alphabet.index(vig_enc_key_list[i])
      except:
        check_letter = False
      else:
        vig_enc_key_list_letter = alphabet.index(vig_enc_key_list[i])

      if check_letter == False:
        vig_enc_ciphertext.append("?")
      else:
        vig_enc_cipher_letter_index = vig_enc_plaintext_list_letter + vig_enc_key_list_letter

        if vig_enc_cipher_letter_index >= 26:
          vig_enc_cipher_letter_index -= 26

        vig_enc_ciphertext.append(alphabet[vig_enc_cipher_letter_index])

      i += 1

    i = 0
    print(f"\n[Vigenère encoding]\n\n>>> Plaintext:\n{vig_enc_plaintext}\n\n>>> Key:\n{vig_enc_key}\n\n>>> Output:")
    print(*vig_enc_ciphertext, sep="")

  else:
    print("You have chosen to decode Vigenère ciphertext to plaintext, (non A-z characters will be ignored).\n")

    vig_dec_ciphertext = input("Enter the Vigenère ciphertext:\n").lower()
    vig_dec_ciphertext_list = []
    vig_dec_ciphertext_list = sort(vig_dec_ciphertext_list, vig_dec_ciphertext)
    vig_dec_ciphertext_list = delspace(vig_dec_ciphertext_list, alphabet)
    vig_dec_ciphertext_list_len = len(vig_dec_ciphertext_list)
    vig_dec_ciphertext = retkey(vig_dec_ciphertext, alphabet)

    vig_dec_key_list_len = 0
    while vig_dec_key_list_len == 0:
      vig_dec_key = input("\nEnter the known key:\n").lower()
      vig_dec_key_list = []
      vig_dec_key_list = sort(vig_dec_key_list, vig_dec_key)
      vig_dec_key_list = delspace(vig_dec_key_list, alphabet)
      vig_dec_key_list_len = len(vig_dec_key_list)
      if vig_dec_key_list_len == 0:
        print("Invalid input.")
      vig_dec_key = retkey(vig_dec_key, alphabet)

    while vig_dec_ciphertext_list_len > vig_dec_key_list_len:
      vig_dec_key_list.extend(vig_dec_key_list)
      vig_dec_key_list_len = len(vig_dec_key_list)

    vig_dec_plaintext = []

    i = 0

    while i < vig_dec_ciphertext_list_len:
      vig_dec_ciphertext_list_letter = alphabet.index(vig_dec_ciphertext_list[i])
      vig_dec_key_list_letter = alphabet.index(vig_dec_key_list[i])

      vig_dec_plain_letter_index = vig_dec_ciphertext_list_letter - vig_dec_key_list_letter

      if vig_dec_plain_letter_index < 0:
        vig_dec_plain_letter_index += 26

      vig_dec_plaintext.append(alphabet[vig_dec_plain_letter_index])

      i += 1

    i = 0
    print(f"\n[Vigenère decoding]\n\n>>> Cipher:\n{vig_dec_ciphertext}\n\n>>> Key:\n{vig_dec_key}\n\n>>> Output:")
    print(*vig_dec_plaintext, sep="")

elif method == "2":
  if enc_dec == "1":
    print("You have chosen to encode plaintext to Beaufort ciphertext, (non A-z characters will be ignored).\n")

    bea_enc_plaintext = input("Enter the plaintext:\n").lower()
    bea_enc_plaintext_list = []
    bea_enc_plaintext_list = sort(bea_enc_plaintext_list, bea_enc_plaintext)
    bea_enc_plaintext_list = delspace(bea_enc_plaintext_list, alphabet)
    bea_enc_plaintext_list_len = len(bea_enc_plaintext_list)
    bea_enc_plaintext = retkey(bea_enc_plaintext, alphabet)

    bea_enc_key_list_len = 0
    while bea_enc_key_list_len == 0:
      bea_enc_key = input("\nEnter the desired key:\n").lower()
      bea_enc_key_list = []
      bea_enc_key_list = sort(bea_enc_key_list, bea_enc_key)
      bea_enc_key_list = delspace(bea_enc_key_list, alphabet)
      bea_enc_key_list_len = len(bea_enc_key_list)
      if bea_enc_key_list_len == 0:
        print("Invalid input.")
      bea_enc_key = retkey(bea_enc_key, alphabet)

    while bea_enc_plaintext_list_len > bea_enc_key_list_len:
      bea_enc_key_list.extend(bea_enc_key_list)
      bea_enc_key_list_len = len(bea_enc_key_list)

    bea_enc_ciphertext = []

    i = 0

    while i < bea_enc_plaintext_list_len:
      bea_enc_plaintext_list_letter = alphabet.index(bea_enc_plaintext_list[i])
      bea_enc_key_list_letter = alphabet.index(bea_enc_key_list[i])

      bea_enc_cipher_letter_index = bea_enc_key_list_letter - bea_enc_plaintext_list_letter

      if bea_enc_cipher_letter_index < 0:
        bea_enc_cipher_letter_index += 26

      bea_enc_ciphertext.append(alphabet[bea_enc_cipher_letter_index])

      i += 1

    i = 0
    print(f"\n[Beaufort encoding]\n\n>>> Plaintext:\n{bea_enc_plaintext}\n\n>>> Key:\n{bea_enc_key}\n\n>>> Output:")
    print(*bea_enc_ciphertext, sep="")

  else:
    print("You have chosen to decode Beaufort ciphertext to plaintext, (non A-z characters will be ignored).\n")

    bea_dec_ciphertext = input("Enter the Beaufort ciphertext:\n").lower()
    bea_dec_ciphertext_list = []
    bea_dec_ciphertext_list = sort(bea_dec_ciphertext_list, bea_dec_ciphertext)
    bea_dec_ciphertext_list = delspace(bea_dec_ciphertext_list, alphabet)
    bea_dec_ciphertext_list_len = len(bea_dec_ciphertext_list)
    bea_dec_ciphertext = retkey(bea_dec_ciphertext, alphabet)

    bea_dec_key_list_len = 0
    while bea_dec_key_list_len == 0:
      bea_dec_key = input("\nEnter the known key:\n").lower()
      bea_dec_key_list = []
      bea_dec_key_list = sort(bea_dec_key_list, bea_dec_key)
      bea_dec_key_list = delspace(bea_dec_key_list, alphabet)
      bea_dec_key_list_len = len(bea_dec_key_list)
      if bea_dec_key_list_len == 0:
        print("Invalid input.")
      bea_dec_key = retkey(bea_dec_key, alphabet)

    while bea_dec_ciphertext_list_len > bea_dec_key_list_len:
      bea_dec_key_list.extend(bea_dec_key_list)
      bea_dec_key_list_len = len(bea_dec_key_list)

    bea_dec_plaintext = []

    i = 0

    while i < bea_dec_ciphertext_list_len:
      bea_dec_ciphertext_list_letter = alphabet.index(bea_dec_ciphertext_list[i])
      bea_dec_key_list_letter = alphabet.index(bea_dec_key_list[i])

      bea_dec_plain_letter_index = bea_dec_key_list_letter - bea_dec_ciphertext_list_letter

      if bea_dec_plain_letter_index < 0:
        bea_dec_plain_letter_index += 26

      bea_dec_plaintext.append(alphabet[bea_dec_plain_letter_index])

      i += 1

    i = 0
    print(f"\n[Beaufort decoding]\n\n>>> Cipher:\n{bea_dec_ciphertext}\n\n>>> Key:\n{bea_dec_key}\n\n>>> Output:")
    print(*bea_dec_plaintext, sep="")

elif method == "3":
  if enc_dec == "1":
    print("You have chosen to encode plaintext to Gronsfeld ciphertext, (non A-z characters will be ignored for plaintext).\n")

    gro_enc_plaintext = input("Enter the plaintext:\n").lower()
    gro_enc_plaintext_list = []
    gro_enc_plaintext_list = sort(gro_enc_plaintext_list, gro_enc_plaintext)
    gro_enc_plaintext_list = delspace(gro_enc_plaintext_list, alphabet)
    gro_enc_plaintext_list_len = len(gro_enc_plaintext_list)
    gro_enc_plaintext = retkey(gro_enc_plaintext, alphabet)

    while True:
      try:
        gro_enc_key = input("Enter the Gronsfeld key (digits):\n")
        gro_enc_key_len = len(gro_enc_key)
        i = 0
        while i < gro_enc_key_len:
          numbers.index(gro_enc_key[i])
          i += 1
        i = 0
      except:
        print("You have not entered digits, try again.\n")
      else:
        break

    gro_enc_key_list = []
    gro_enc_key_list = sort(gro_enc_key_list, gro_enc_key)
    gro_enc_key_list = delspace(gro_enc_key_list, numbers)
    gro_enc_key_list_len = len(gro_enc_key_list)

    while gro_enc_plaintext_list_len > gro_enc_key_list_len:
      gro_enc_key_list.extend(gro_enc_key_list)
      gro_enc_key_list_len = len(gro_enc_key_list)

    gro_enc_ciphertext = []

    i = 0

    while i < gro_enc_plaintext_list_len:
      gro_enc_plaintext_list_letter = alphabet.index(gro_enc_plaintext_list[i])
      gro_enc_key_list_letter = int(gro_enc_key_list[i])

      gro_enc_cipher_letter_index = gro_enc_plaintext_list_letter + gro_enc_key_list_letter

      if gro_enc_cipher_letter_index >= 26:
        gro_enc_cipher_letter_index -= 26

      gro_enc_ciphertext.append(alphabet[gro_enc_cipher_letter_index])

      i += 1

    i = 0
    print(f"\n[Gronsfeld encoding]\n\n>>> Plaintext:\n{gro_enc_plaintext}\n\n>>> Key:\n{gro_enc_key}\n\n>>> Output:")
    print(*gro_enc_ciphertext, sep="")

  else:
    print("You have chosen to decode Gronsfeld ciphertext to plaintext, (non A-z characters will be ignored for ciphertext).\n")

    gro_dec_ciphertext = input("Enter the Gronsfeld ciphertext:\n").lower()
    gro_dec_ciphertext_list = []
    gro_dec_ciphertext_list = sort(gro_dec_ciphertext_list, gro_dec_ciphertext)
    gro_dec_ciphertext_list = delspace(gro_dec_ciphertext_list, alphabet)
    gro_dec_ciphertext_list_len = len(gro_dec_ciphertext_list)
    gro_dec_ciphertext = retkey(gro_dec_ciphertext, alphabet)

    while True:
      try:
        gro_dec_key = input("Enter the Gronsfeld key (digits):\n")
        gro_dec_key_len = len(gro_dec_key)
        i = 0
        while i < gro_dec_key_len:
          numbers.index(gro_dec_key[i])
          i += 1
        i = 0
      except:
        print("You have not entered digits, try again.\n")
      else:
        break

    gro_dec_key_list = []
    gro_dec_key_list = sort(gro_dec_key_list, gro_dec_key)
    gro_dec_key_list = delspace(gro_dec_key_list, numbers)
    gro_dec_key_list_len = len(gro_dec_key_list)

    while gro_dec_ciphertext_list_len > gro_dec_key_list_len:
      gro_dec_key_list.extend(gro_dec_key_list)
      gro_dec_key_list_len = len(gro_dec_key_list)

    gro_dec_plaintext = []

    i = 0

    while i < gro_dec_ciphertext_list_len:
      gro_dec_ciphertext_list_letter = alphabet.index(gro_dec_ciphertext_list[i])
      gro_dec_key_list_letter = int(gro_dec_key_list[i])

      gro_dec_plain_letter_index = gro_dec_ciphertext_list_letter - gro_dec_key_list_letter

      if gro_dec_plain_letter_index < 0:
        gro_dec_plain_letter_index += 26

      gro_dec_plaintext.append(alphabet[gro_dec_plain_letter_index])

      i += 1

    i = 0
    print(f"\n[Gronsfeld decoding]\n\n>>> Cipher:\n{gro_dec_ciphertext}\n\n>>> Key:\n{gro_dec_key}\n\n>>> Output:")
    print(*gro_dec_plaintext, sep="")

input()
 
How retarded is this code?
I'd say it looks fine but I'm not entirely sure what I'm looking at. I gather it is some kind of encryption thing.

Although I don't think your sort function sorts anything. (I almost never used the actual stuff in Python I used Numpy for basically everything since it was better for nearly all cases.) Is it supposed to?
 
I'm only using super basic Python syntax to the point where it's comical, so if someone decides to answer, keep that in mind.
Seeing as you managed to implement a for loop with while loops... I give it about an 8 on the 0 to 10 retarded scale.
Naming something "sort" that does no sorting is also a nice touch, as was mentioned.
 
  • Agree
Reactions: Shalalallah Akbar
Sorry for double post I forgot to reply to everything.

To be fair it's not like C has changed at all in the last 30+ years.
It is a couple things actually. It's enough that I don't want to confuse myself and my specific problem is mostly about not being familiar with the Syntax. I learned it decently did a project to 95% completion and had other stuff come up, and then didn't touch it for like 2 months.

I realized I couldn't figure out how to move an element from an array into a new array without looking it up and I realized I lost all the knowledge I had basically.



Personally, the worst code I’ve ever had to inherit was DOD
Have you done anything with ADA? I've heard about it and the massive pain that it is to deal with.
Core language features like structs, functions and enums inherently allow developers to create as much abstraction as they want, your language would be gimped if you somehow figured out a way to stop people layering on abstractions over abstractions.
Sort of. It is about the ease of that abstraction.
Dare I say that niche is already filled by rust?
Rust wants to fill that niche but it doesn't manage to do so. C++ and Rust occupy basically the same Niche. I do think most websites should probably code their backends in C++ or Go. Go actually is pretty close to the niche but it has problems in that it is more C like than like C++. I still quite like the design philosophy of Go.

The problem C++ and Rust both have is that they are not simple enough. They allow for too much complexity too easily.
 
C is at its best in the low level stuff, so write a client server app doing sockets, grab a Pi Pico(RP2040), use Xlib to draw a smiley face, etc.
C code is also incredibly simple to call into from other languages. You can construct a call into a C function at runtime, from just seeing its signature, represented as string (like luajit ffi or python's cffi). With C++ (or other languages) this is not feasible... to make a call like someCppObject->someMethod(otherObject), you'd have to consider downcasting of the pointers, overload resolution, the vtable, templates, etc... mostly this is delegated to clang and compiled for exactly the call you need to make. But then anyone who needs to modify your code, also needs clang.
 
The user can't tell the difference between 0.005 seconds and 0.5, but the server can. Wouldn't the cloud costs be 100x the price? If you optimized it you would be able to serve a hundred times the traffic with the same money. I can't see that being completely useless, especially if the business was primarily online and had lots of traffic.
Also your example isn't "several hundred thousand orders of magnitude", that's 4 orders.

I think this is an misunderstanding a lot of people here who don't actually work with systems at scale for a living misunderstand.
Unless you are doing something retarded from a design point of view, you can't really fuck up costs or performance to the point where it would significantly make or break your app.
For example, lets say you have some unnecessary O(n^2) logic in your in your controller action. If you showed that in an interview, you'd fail. However in a real world situation, that mistake is inconsequential to ever matter. You would never be processing that much data in a single action for that difference to matter. If you decided to pick a language that was 10% slower, it wouldn't cost the company 10% more in hosting. Even if it did, there could be a lot of reasons a company would want to just pay the difference rather than rework a solution for minimal gain.

Some of the things I've had to fix that actually made a difference include:
Migrating massive tables in Postgres to more size efficient schemas. This saved the company 5 digits a month.
Caching queries and reducing multi join queries that were bottlenecks in many critical paths.
Extracting controller logic to jobs
Moving key value lookups out of Postgres into DynamoDb

This is why it doesn't really matter what language you use for the most part. You can spend multiple times the resources your competitors spend on building your services with the lowest level C code and still end up with a piece of shit that doesn't scale. Any "shitty" JS framework will work if you design your system correctly. This is why llllIllIllIIIIllI has the right idea about a lot.
 
I can't really argue with your logic here. There are a lot of places where bottlenecks happen, and they tend to be high-level networking and logical design issues a lot of the time. For a specific function or something to cause a horrible bottleneck, it would have to be taking absolutely unholy amounts of CPU time, and in most cases it would be better to eliminate an unnecessary RPC call or something instead. I guess it comes down to most of the CPU bottlenecks already being solved by the people behind things like Postgres and most of the remaining shit behind an HTTP service being really minor. I think it also depends on what exact conditions the final product will face. An intranet service that will handle about 60 concurrent connections at worst will be perfectly fine in JS and rewriting it in <INSERT SYSTEMS LANGUAGE HERE> would be absolutely retarded. On the other hand, I don't think writing something like KiwiFlare in Node would be the best idea.

Something something premature optimization.
 
I need help bros, I need to escape wagie retail and want a gay faggot tech job that pays well.

  • I have a decent grasp of the fundamentals I feel, but I don't have a deep knowledge on any particular language, I've put together some 2000+ long line python scripts and i've dabbled a bit in other languages (lua for gmod stuff, extremely trivial amounts of rust to modify a small function in an open source project, a tiny bit of C#, etc.), but that's about it.

  • No formal education, don't live anywhere with a lot of tech jobs but I'm willing to move. I have no family or anything keeping me chained to one place

  • No Java

  • I have an interest in distributed systems and parallel computing, but this is an extremely specialized and difficult field to get into, what are some good places to even get started with this? Shill me any language/library and I'll look into it. (yes I've seen Bend, unconvential design patterns like folds/bends are above my pay grade right now + it has no libraries)

  • Should I go back to college for linear algebra/mathematics or is college a scam even for math-related degrees? I'm 25. Yes "you don't need to be good at math to be a programmer" it still helps, especially for more advanced projects
I'm ready to go full autistic retard on something but I don't know what, the newer distributed compile tools for Unreal engine and the idea of synchronizing a network of hundreds of cpu/gpu cores together for a single task is really fascinating and borderline magic to me and I want to learn more. I will accept any language/library suggestion but preferably something more "mainstream" (I'm not wasting my time learning Haskell sorry), I'm also not learning Java unless it's MAYBE Java 21/the new shit with unnamed classes where I can just ignore the decades of awful OOP nightmare.
 
  • Like
Reactions: y a t s
To be fair it's not like C has changed at all in the last 30+ years.
The only change I've seen in absolutely ancient code is that they have this weird thing going on with function parameters. Something like:

Code:
int main(argc, argv)
    int argc;
    char** argv;
{
    ...
}

This is why it doesn't really matter what language you use for the most part.
That's such a FAANG mindset. Just because Big Tech only cares about scaling doesn't mean that raw speed isn't important for the rest of us.
 
I'd say it looks fine but I'm not entirely sure what I'm looking at. I gather it is some kind of encryption thing.

Although I don't think your sort function sorts anything. (I almost never used the actual stuff in Python I used Numpy for basically everything since it was better for nearly all cases.) Is it supposed to?
It's supposed to be a simple encoder/decoder for basic ciphertexts (Vigenère, Beaufort, and Gronsfeld).

Let's see, sort is putting the characters of the string into a list. So I guess that it's a foolish way of doing what the unpacking operartor can do, or what's shown here:
https://www.geeksforgeeks.org/python-split-string-into-list-of-characters/

Although I don't think I need to use lists here, but that's how I started doing it as for experimenting.
Seeing as you managed to implement a for loop with while loops... I give it about an 8 on the 0 to 10 retarded scale.
Naming something "sort" that does no sorting is also a nice touch, as was mentioned.
Then what if I used "for" loops?
What's the point in returning list in any of your functions? Lists/Dicts/Tuples are pass by reference in Python. You change them even if you don't return them.
I see what you mean.

But in the case of the "delspace", is taking each character of the list, checking if it's in the alphabet, and if so, appending it to another list in order to be returned.
I guess it would be better to do the opposite? So if the character isn't in the alphabet, then you simply take it out of the original list? With something like pop()?
 
Then what if I used "for" loops?
Programming language constructs exist to provide a shorthand method of representing some common task that programmers do a lot.

Here's some code printing numbers from 1 to 10 in C. It uses a for loop:
C:
for(int i = 1; i <= 10; i++){
    printf("%i\n", i);
}
This is a very short piece of code that uses one line to say, "Do this several times, with the value of i increasing from 1 to 10."

You could also do it with a while loop. The while loop can do some things better than for loops, but in this case you will be reinventing half of the shit that the for loop does:
C:
int i = 1; // we declare the counter here
while(i <= 10){ // then the condition is checked here
    printf("%i\n", i);
    i++; // then we increment it all the way over here
}
Do you see how less readable it is? Notice how I had to write out all the shit the for loop did, in the same order, except puked out everywhere instead of neatly fit into a pair of parentheses. It's not that bad here, but imagine if you were writing a complicated loop that took up half a screen of vertical space. It would be really easy to forget things like that i++ statement and cause an infinite loop to happen.

To see just how bad it can get when you add needless circumlocution instead of using a nice fitting construct, see this:
C:
int i = 1;
loop:
if (!(i <= 10)) goto end;
printf("%i\n", i);
i++;
goto loop;
end:
// I Can't Believe It's Not Assembler!
Of course python has range-based for loops (which are different) but I just used C for the sake of easy demonstration because it's a very average programming language. You should learn how to use your specific language's constructs when applicable or your code will look not unlike the third example I showed here. Maybe not with goto in your case as python has omitted those from the language, but it will still give off the same stench.
 
Back