Comments by "p11" (@porky1118) on "Modern Software Engineering" channel.

  1. 12
  2. 9
  3. 6
  4. 5
  5. 4
  6. 4
  7. 3
  8. 3
  9. 3
  10. 3
  11. 2
  12. 2
  13. I think, there is still potetntial for a general purpose programming language having more influences from natural language, but not how the old approaches worked. The old programming language, which tried to make programming languages more like natural languages, did it, by translating function calls and macros to a limited set of common phrases, often making it less flexible and clear. I think, SQL is a good example, even if not a general purpose language. I would rather try to add features of natural language into programming languages. The most important feature of natural languages, which has not been implemented in any programming language, is a way to nest complex phrases without the need of explicit brackets (might be words, which act like brackets). In natural language, every word has some implicit relation. An adjective (A) always relates to the next object, which might consist of multiple words. In some languages a verb (V) at the end of a sentence or subsentence ends it. And relative pronouns (R) start a new subsentence. And Nouns (N) represent simple objects. So lets assume, we have a sentence of this structure: N1 A1 N2 R1 A2 A3 N3 N4 V1 V2 By strictly applying the rules (the description would have to be more accurate, but you should get the point), the nesting (restructured, so the verbs are written like function calls) would be something like this: V2(N1, A1(N2), V2(R1, A2(A3(N3)), N4) Even if it's not english grammer, I can try to insert some english words: English: I like the blue boat, which swims from the great island fast. Structure: I blue boat which from great island fast swim like. Nesting: Like(I, blue(boat), swim(which, from(great(island)), fast) (I know, "fast" is not a noun, and "from" is not an adjective, but it's difficult to have complex sentences, which use a structure like this and make sense.) So how would I use this in a programming languare? I'd add about three kinds of words, one which opens a bracket (like R), one which closes a bracket (like V) and one, which does none of it or both (like N or A). Maybe more. And everything you define will belong to one of these word kind.
    2
  14. 2
  15. 2
  16. 2
  17. What I dislike about most OO languges: # No way to define simple functions There might be static methods, but they still have to belong to a specific class, which often does not make sense. In such cases, I "misuse" classes as modules, but it's often a lot of boiler plate code in this case (`public static`). # To which object does a method belong? Or I know, it should be a method, but don't know, of which of the objects. There are many posibilities, but none of them seems preferable. As long as I don't need dispatch, functions are often the way to go. Else it's pretty clear unless I need multiple dispatch, which also doesn't exist in most OO langugaes. # Being able to overwrite any method I think, methods should never be able to be overwritten in general. There's one exception: Default methods. Some method of an abstract class, which is explicitly meant to be overwritten. (any virtual method in an abstract class) And there could be empty method definitions, which can be defined in a child class (empty virtual methods). And they can only be overwritten once by an inheriting class. If you need to overwrite something twice, something is wrong with your code. Instead of overwriting methods, I like the idea of methods, which extend the behavior of the parent but without changing it (see method combinations), but most of the time, this is too complicated. In cases, you want to extend behavior multiple times, it's probably the best to add a new virtual methods in child objects. This way it's not allowed to accidently forget to call the parent method, which often seems like boilerplate anyway.
    2
  18. 2
  19. 1
  20. 1
  21. 1
  22. 1
  23. 1
  24. 1
  25. 1
  26. 1
  27. 1
  28. 1
  29. 1
  30. 1
  31. How can this be applied to gamedev? Most things can't be independently deployable. Especially things, you would put into a library, like a physics or render engine, or more important your math stuff. But you could put the rendering and the physics of a specific game into different microservices for example. Not sure, if that counts. But both could be independantly deployable. You could test the game rendering by sending the game state to it, where which object moves and how they change, which objects get destroyed or created, if a new scene is loaded, etc. You could even use it for different games, which use different physics or no physics at all, as long as the rendered objects stay the same. Or you could test the game physics by using a very minimalistic renderer, or just outputting the expected positions. You could run the game with many different renderers, maybe some minimalistic 2D one or some realistic 3D one, or some surreal style. That's basically how I tried to make some game I made less coupled. But I'm not really happy with it. They use the same base code, some shared structs which are used by both services. But both services include most of the same structs, only cleaned up. For example balls in the renderer don't contain the speed, and balls in the physics don't contain the color. So it's kind of code duplication. I created a library for both "services", so I still have to add some code to really make it run. I basically just have to define how the communication works. I can use both libraries and just move data around inside the application to create a standalone. Or I use only one of these libraries to write to and read from a tcp stream and create a client and server this way. I like the basic design, but I'm not happy with the specifics. What I also can think of is packing menus and the real game or each different part of the game into a single application, and then add a meta application, which just selects the next application.
    1
  32. 1
  33. 1
  34. 1
  35. 1
  36. 1
  37. 1
  38. 1
  39. 1
  40. 1
  41. 1
  42. 1
  43. 1
  44. 1
  45. 1
  46. 1
  47. 1
  48. 1
  49. 1
  50. 1