Each language has its own unique features, such as peculiar syntax, unusual functions, or non-standard execution methods. Therefore, no matter whether you are a newbie or an experienced player, you will suddenly get drunk when looking at a certain feature. The article summarizes 10 "weird" features that are often mentioned.
1. Javascript: + is a connector
Problem description: In JS, the + sign is used between numbers and can be used as a regular addition; but if it encounters characters, it can also be used as a character connector. For example: the result of '1' + 1 is 11.
Cause analysis:
The fundamental reason is that JS is a weakly typed language. For example, Python also uses the + sign as the character connector, but because it is a strongly typed language, once it finds that a character is added to an integer, it will prompt that this is an error operation.
Opinions of netizens:
“The problem is that this is an unpredictable mandatory silent conversion, which is easy to ignore.” Anonymous
“JS should handle this situation by throwing exceptions.” crgwbr
“Use + to perform character concatenation is simply a nightmare. ”Matteo Riva
2. Perl: The module must return a TRUE value
Problem description: In most cases, the Perl module must end with a 1; statement, otherwise , if the return value of the last statement is not TRUE, the system will report an error.
Cause analysis:
The Perl module contains initial code and subroutines. When the module file is loaded, Perl will determine whether the code was successfully executed based on whether TRUE is returned. Even if there is no initial code, Perl still expects the last statement to return TRUE, otherwise an error will be reported.
ifier |
Problem description: For example, when the system sees ??!, it will automatically convert it to |, and when it sees ??(, it will convert it to [. This can easily cause unexpected results, and will greatly reduce the code Readability. Cause analysis: In the early days of programming, certain special characters, such as braces, could not be typed directly on the keyboard, so this indirect method was used. Opinions from netizens: “If you are as knowledgeable as Google, you must not understand what ??!??!” Isaac “Since the three-letter word was introduced in 1977, C has become obscure and difficult to understand.” Martin Beckett 4. PHP: Case sensitive processingProblem description: PHP’s case processing is confusing, distinguishing in some places and not in others. For example: variable names, constant names are distinguished; function names, method names, and class names are not distinguished. Analysis of the cause: It is probably an artifact that emerged during the development of PHP from a CGI script set to a mature programming language Netizens’ opinion: “This is why PHP programmers are accustomed to naming functions with underscores instead of underscores. The reason for adopting camel case naming. ”paperstreet7 In PHP, everything is possible! ”Grzechooo 5. Ruby: 0 as a true value Problem description: In Ruby, a 0 value is equivalent to a TRUE value. . This is a nightmare for programmers with C and Python background. Cause analysis: Only the boolean values FALSE and nil are equivalent to FALSE, and the rest are equivalent to TRUE. 2, 3, etc. will be treated the same. Opinions of netizens: “This is simply crazy, although the original intention is well-intentioned.” Chris Lutz “0==true! I am a C language brain. Almost collapsed! "Kenny 6. Python: Divide levels by number of spaces Problem description: Different from using keywords or punctuation, PY uses indentation levels to divide each line of code clearly The incorrect number of spaces (or the inconsistent number of spaces and transposition characters) may cause the program to report errors Cause analysis: The PY author’s intention is to make the code more readable and reduce unnecessary input. I hope that programmers themselves should take the responsibility of maintaining code clarity. Netizens’ opinions: “Sincerely, this is the fundamental reason why I stay away from PY.” wazoox “If we really need something like this. Enforcement mechanism, are we really too lazy! "Joris Meys 7. C: The working mode of array index is equivalent to that of pointer Problem description: In C, a[i] and i[a] are interchangeable, and both writing methods can produce the same result. The result. Cause analysis: In C, there is no difference between arrays and pointers for memory blocks, that is to say: a[i] = *(a + i) = *(i + a ) = i[a]. Netizens’ opinion: “This is worthless in the C language confusing code competition. "Confusion" "I think this reveals the core of the C language, pointers and more direct dealing with memory. ”Michael Neale 8. Perl’s: Predefined variables Problem description:Perl has a very long list of special variables, and the names in them are very complicated (although there are corresponding long English words). Therefore, unless you are a senior Perl developer, it is common to read the Perl documentation repeatedly.
Cause analysis:
These variables have different meanings, such as: process ID ($$), error message ($@), regular expression matching ($^R).
Netizens’ opinions:
“Very annoying!” MatrixFrog
“Maybe a boon for streamlined developers.” niXar
“The problem with these variables is: they cannot be found through Google!” malvim
9. JavaScript: Automatic semicolon insertion
Problem description:
JS uses semicolon as a sign of the end of a statement, and will insert it by itself, even if the code breaks. This often leads to errors.
Cause analysis:
The original intention of automation is to bring convenience, especially to novices.
Netizens’ opinions:
“If we always regard users as fools when designing language features, problems will arise.” Rob Van Dam
“Automatic semicolon insertion is the most troublesome thing about JS One of the places. ”fennec
10. Java: Autoboxing and Integer caching
Problem description:
Java will automatically convert basic type data into objects (autoboxing), such as converting int to An Integer object. At the same time, by default, the value of the cached Integer object is -128 to 127. In this case, there will be a problem when using == to compare two Integer objects with the same value (TRUE within -128 and 127, and the rest is FALSE)
Cause analysis:
The automatic boxing mechanism reduces the code Input volume, while Integer caching improves processing speed.
Opinions of netizens:
“Fortunately, I am just a C# programmer.” Will
“This is not a mistake, but it gives us a reason to use primitive types (such as: booleans) for number processing. ”RaviWallau
ACID vs BASE Database: Differences and when to use each.Mar 26, 2025 pm 04:19 PMThe article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and
PHP Secure File Uploads: Preventing file-related vulnerabilities.Mar 26, 2025 pm 04:18 PMThe article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.
PHP Input Validation: Best practices.Mar 26, 2025 pm 04:17 PMArticle discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.
PHP API Rate Limiting: Implementation strategies.Mar 26, 2025 pm 04:16 PMThe article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand
PHP Password Hashing: password_hash and password_verify.Mar 26, 2025 pm 04:15 PMThe article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur
OWASP Top 10 PHP: Describe and mitigate common vulnerabilities.Mar 26, 2025 pm 04:13 PMThe article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.
PHP XSS Prevention: How to protect against XSS.Mar 26, 2025 pm 04:12 PMThe article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.
PHP Interface vs Abstract Class: When to use each.Mar 26, 2025 pm 04:11 PMThe article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software






