Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> a cute trick allow me to disagree about the cuteness of that. there are ways to distinguish a module from an executable file. For example, 'main' could be a special function (like in C).

> you just list it as a parameter yes, that's what I wanted to say. the fact is, in other languages I don't have to list it as a parameter and I don't have to get used to it. Personally, I find it annoying (but I could live with it, like everyone else).

> how does wrapping C functions with C names help me forgive my forward reference, but I will argue that "you're not the target audience" for this language. I found that PHP works best if you're coming from a C background and you treat it as a C-based scripting language (and this is kind of what PHP claims to be). I've always suspected that people coming from other backgrounds are the ones who will dislike PHP the most (and it doesn't surprise me), but I also don't know why they seem so vocal about it. I, for one, don't post negative comments about Ruby/Python (unless I'm comparing PHP with them) because I acknowledge that other people with, say, LISP backgrounds will find those more intuitive and will make efficient use of the them.

Anyways, cheers.



Strictly speaking, `main` isn't even a special function in C. It's only special to your C library and linker and something something I forget the details. Anyway it doesn't matter at all; you could leave off the `if` in Flask's example and never notice any difference. Just emerged as common practice to bracket off stuff like that /in case/ you ever decide to import your script as a module.

Part of my problem with PHP is that it doesn't seem to know what it is; there are the C parts, and the C++/Java parts, and both sides are sort of glued together with Perl influence, yet don't very well interoperate otherwise.

I have a pretty patchwork background and I could get work done in just about any language you'd pay me to use. I'd even happily write a web app in C. Doesn't make PHP any more attractive.


In implementation terms the main function isn't special, but its prototype is part of the C specification: http://groups.google.com/group/comp.std.c++/browse_thread/th...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: