Tagged articles
9 articles
Page 1 of 1
Liangxu Linux
Liangxu Linux
Sep 3, 2025 · Fundamentals

Can main() Recursively Call Itself? Limits, Risks, and Safer Alternatives

This article examines whether the C/C++ entry‑point function main can call itself recursively, outlines the relevant language standards, shows compiler support and example code, discusses practical limitations such as stack size and portability, and recommends safer programming patterns.

C++Recursionc++
0 likes · 8 min read
Can main() Recursively Call Itself? Limits, Risks, and Safer Alternatives
Python Programming Learning Circle
Python Programming Learning Circle
Nov 5, 2024 · Fundamentals

Why Python Does Not Need a Traditional Main Function

The article explains that unlike compiled languages, Python as an interpreted scripting language does not require a mandatory main function, clarifies the purpose of the __name__ == '__main__' guard, and advises using a simple entry script such as main.py for clean, idiomatic code.

Pythonbest-practicesmain function
0 likes · 6 min read
Why Python Does Not Need a Traditional Main Function
Python Programming Learning Circle
Python Programming Learning Circle
Apr 11, 2023 · Fundamentals

Why Python Does Not Require a main Function and How to Structure Scripts Properly

The article explains that unlike compiled languages which need a mandatory main entry point, Python as an interpreted scripting language has no required main function, clarifies common misconceptions about using if __name__ == '__main__', and recommends using a main.py entry script for clean, idiomatic code.

best practicesif __name__ == '__main__'main function
0 likes · 6 min read
Why Python Does Not Require a main Function and How to Structure Scripts Properly
Liangxu Linux
Liangxu Linux
Mar 29, 2023 · Fundamentals

What Happens When main() Returns on a Bare‑Metal Microcontroller?

In bare‑metal embedded systems without an RTOS, the fate of a program after the C main() function returns varies by compiler, and understanding the startup code and post‑main behavior explains why LEDs may flicker or why an infinite loop is often required.

C ProgrammingMicrocontrollerembedded systems
0 likes · 6 min read
What Happens When main() Returns on a Bare‑Metal Microcontroller?
Python Programming Learning Circle
Python Programming Learning Circle
Mar 29, 2022 · Fundamentals

Why Python Does Not Have a Main Function

This article explains why Python, as an interpreted scripting language, does not require a mandatory main function like compiled languages, clarifies common misconceptions about the __name__ == '__main__' guard, and recommends using a simple main.py entry file for clean, idiomatic code.

Pythonbest practicescoding style
0 likes · 7 min read
Why Python Does Not Have a Main Function
Liangxu Linux
Liangxu Linux
Oct 23, 2021 · Fundamentals

What Actually Calls main()? Unveiling the Windows C++ Startup Chain

This article explains how a Windows PE executable is launched, detailing the creation of the process and main thread, the role of the OEP, and how the runtime startup functions like _tmainCRTStartup ultimately invoke the user-defined main/wmain function.

CRT startupPEWindows
0 likes · 7 min read
What Actually Calls main()? Unveiling the Windows C++ Startup Chain