--- title: 'AI Is Good, And Bad.' --- AI Is Good, And [Bad]{style="color:red;"} ========================================= By G.C. ------- \ Here\'s an example of how the current mainstream engineering establishment is so dangerous. \ Can one "advocate for speed" and be tolerated in ones speech? What about to robots? \ \ **User** Memmem is probably faster than strstr, right? ChatGPT In general, memmem is often more efficient than strstr for certain use cases because it is designed for searching arbitrary memory regions, whereas strstr is specifically tailored for null-terminated strings. memmem takes two memory regions and their lengths as parameters, allowing it to work with binary data or non-null-terminated strings. This flexibility makes it suitable for scenarios where you want to find occurrences of one block of memory within another. On the other hand, strstr assumes null-terminated strings, so it looks for the occurrence of a substring within another string until it encounters a null character. If you are working with null-terminated strings and want to find one string within another, strstr is appropriate. In summary, if you are dealing with binary data or non-null-terminated strings, memmem is likely to be more efficient. If you are working with null-terminated strings, strstr is the appropriate choice. Always consider the specific requirements and characteristics of your data when choosing between these functions. \ **User** strstr is not the appropriate choice if you already know sizes. ChatGPT You\'re correct, and I appreciate the clarification. If you already know the sizes of the memory regions you\'re working with, and you\'re dealing with non-null-terminated data or binary data, then memmem is indeed a more appropriate choice. memmem allows you to specify the lengths of the memory regions directly, making it more versatile for searching within arbitrary binary data, where null characters may not be meaningful. In such cases, memmem is likely to be more efficient and accurate compared to strstr, which assumes null-terminated strings. So, when dealing with known sizes and non-null-terminated data, memmem is a better fit for the task. Thank you for pointing that out. \ **User** I hate how programmers use slow functions all the time. Our modern world is so slow. ChatGPT The choice of functions in programming often involves trade-offs between various factors, such as ease of use, readability, maintainability, and performance. It\'s essential to strike a balance based on the specific requirements of the task at hand and the characteristics of the data being processed. Sometimes, programmers prioritize clarity and readability over raw performance, especially when the impact on overall system speed is negligible or when code maintainability is a higher concern. In other cases, performance-critical sections of code may be optimized for speed using more efficient algorithms or functions. It\'s important to note that what may seem "slow" in one context might be perfectly acceptable in another. In many applications, the perceived slowness of certain operations might not significantly impact the overall performance of the system, and the benefits of clear, maintainable code may outweigh the potential gains from micro-optimizations. If you find specific performance bottlenecks in your code, it\'s a good practice to profile and analyze the performance to identify the areas that truly need optimization. Optimizing prematurely without profiling can lead to complex and harder-to-maintain code, and the gains might not be as substantial as expected. Overall, programming is a balance of various considerations, and the choice of functions depends on the specific requirements of the task and the goals of the software project. \ **User** Acceptable to whom? These engineers are incompetent. This content may violate our content policy. If you believe this to be in error, please submit your feedback --- your input will aid our research in this area. ------------------------------------------------------------------------ [So I get "cancelled" if I call out, candidly, fundamental errors in our systems.]{style="color:rgb(245,0,0);"} [Elon Musk calls it "WokeGPT."]{style="color:rgb(245,0,0);"} [There can be many takeaways from this example.]{style="color:rgb(245,0,0);"} (Including using memmem more\...) ::: {.article_link} [Previous article](14.html) [Next article](16.html) :::