Thread: Web developing languages

  1. #16
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    So wait, what's so bad about PHP? Ignoring the coder being bad, what's wrong the language as a whole?
    O_o

    I have maintained my own earlier code, and I did do some debugging work on some "Drupal" components, but I haven't worked seriously with PHP since PHP4 was a thing. Even then, I don't recall any one thing that turns me off of the PHP language. For me, the problem with PHP was the unfortunate ammount of "hoop jumpery" in coding through the languages layers of quirk. I felt like my time was spent having to argue with the language just to cleanly express my ideas.

    *shrug*

    I want my tools to work for me; I don't want to fight my tools.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  2. #17
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Quote Originally Posted by phantomotap View Post
    O_o

    I have maintained my own earlier code, and I did do some debugging work on some "Drupal" components, but I haven't worked seriously with PHP since PHP4 was a thing. Even then, I don't recall any one thing that turns me off of the PHP language. For me, the problem with PHP was the unfortunate ammount of "hoop jumpery" in coding through the languages layers of quirk. I felt like my time was spent having to argue with the language just to cleanly express my ideas.

    *shrug*

    I want my tools to work for me; I don't want to fight my tools.

    Soma
    That's fair, I suppose.

    I've been using PHP 5.6 and so far it's been handling like a dream. Or rather, it's been good to me so far so I don't have any personal qualms.

    It embeds into HTML when I need it to and it connects to the Java server I have running as I need it to.

    The only thing PHP has ever given me trouble about is sending a PDF to the browser. But that's because it requires header() semantics and it forced the redesign of this web app I was making (I had to create a download link instead of just forcing the download) but I'm assuming header() stuff isn't specific to just PHP, is it?

  3. #18
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    It embeds into HTML when I need it to and it connects to the Java server I have running as I need it to.
    o_O

    You are running a Java HTTP server? In the foul name of Yog Sothoth, why?

    But that's because it requires header() semantics [...] just PHP, is it?
    O_o

    I'm glad you asked.

    Anyone seriously considering developing web applications, without using an existing framework, living on a sever should at least skim the RFC for HTTP and MIME stuff.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  4. #19
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Actually, it's not a HTTP-based Java server. I use Apache for that. I do need Java, however, because the app calls on a jar file (not created by me) so instead of creating the JVM for each user request, it's easier to have Java listen to any PHP socket requests and then open the connection by passing a thread to a fixed thread pool which opens the socket and then calls the jar file from there.

    This way I avoid the overhead of creating the JVM and it allows me to process multiple requests for the jar file.

    I will take a gander at the MIME and RFC stuff but we both know you'd be like 50x sexier if you directly answered my question

    I'm not sure if I should use a HTTP Java server but I like Apache and getting it up and running. Linode lets me choose a Linux distro and Arch is one of them and it's what I'm using now. I love being able to type systemctl start httpd.service and have everything up and running so I doubt I'd ever migrate to a pure Java-based HTTP server. As of now, just having a JVM sitting there waiting to make PDFs is good enough.

  5. #20
    Registered User
    Join Date
    Dec 2014
    Posts
    18
    So... i'm assuming that PHP is a no-no?

  6. #21
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by phantomotap View Post
    o_O

    Once upon a thread, Elysia offered that he doesn't care about relying on undefined behavior if the code looks better.

    Soma
    Quote Originally Posted by phantomotap View Post
    O_o
    I'm too lazy to find the thread I'm referencing so you'll have to do with a brief.
    I'm not! The thread in question is found here. I wish phantomotap was making it up.

  7. #22
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    I will take a gander at the MIME and RFC stuff but we both know you'd be like 50x sexier if you directly answered my question
    O_o

    Okay. I'll give you a simple answer just this once.

    Wait.

    50x sexier
    Code:
    50 * 0 == 0
    Nevermind...

    Soma ;_;
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  8. #23
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by whiteflags View Post
    I'm not! The thread in question is found here. I wish phantomotap was making it up.
    Well, there you go. Going back to a previous discussion, that just goes to show how lazy programmers aren't exclusive to PHP.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #24
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by ItzBlue View Post
    So... i'm assuming that PHP is a no-no?
    No. It's a good language to start. My only annoyance with it is that PHP is strictly a web development language. After you get into PHP, make a point of learning a few alternatives, like Python with Django, C# with ASP.Net and Ruby on Rails. All alternatives sit on top of general purposes languages (python, c# and ruby) that will allow you to code web apps, business applications and games, all on the same programming language.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  10. #25
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    So... i'm assuming that PHP is a no-no?
    O_o

    (I didn't see the comment earlier.)

    Look. We can give you advice. We can throw our opinions at you.

    At the end of the day, you'll be better served if you just look around at the common web languages.

    Your reflexive opinion is strangely important; if you think you could have a good feel for a language, you are probably correct.

    You should really only force a language on yourself if you know you are going to be using the language for another reason.

    You should definitely just stick with PHP if, for example, you know of an application written in PHP you'd like to use as you learn. If you know you'll be taking classes with Python, you should just start with the Python language.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  11. #26
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Quote Originally Posted by whiteflags View Post
    I'm not! The thread in question is found here. I wish phantomotap was making it up.
    Heheh. Well your diligence bought phantomotap 2 more likes

  12. #27
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by phantomotap View Post
    OOnce upon a thread, Elysia offered that he doesn't care about relying on undefined behavior if the code looks better.
    Don't bring me into this! I am not a mindless drone! >_<

    Quote Originally Posted by phantomotap View Post
    Elysia posted code using multiple reserved identifiers. (The code specifically used a leading underscore followed by an uppercase letter.) The fact that using reserved identifiers in the scope where the identifier is reserved is undefined behavior was pointed out to Elysia by a couple of people. The response from Elysia was essentially "I don't care. I like the look of the code more than I would by using an allowed identifier.".
    This was not production code, so yeah, I think I am entitled to do what I want in my toy projects.
    And it's not laziness. It's called code style.
    Now let's stop using me as a pig to lay all blame on.

    Now, to get to the topic at hand.
    There are essentially two ways of doing web development (that I know of):

    Client + REST calls to server
    Client + server-side scripting

    Mind you, I've had very little experience with web development, but this is what I feel or think works.

    For client + rest, the client tries to just display an interface and sends requests to the server to the processing. The client would obviously be HTML + javascript (though I'd try my hands on Microsoft's typescript which is a type-safe javascript which compiles to javascript). I'd probably do the server in C++ since I know a good framework for handling rest calls. In this model, javascript and html pages dominate and the pages sends requests to the server usually dynamically via javascript. It can also be done using posts/get and forms.

    For client + server-side scripting, the client is done in HTML + javascript as before. The server is done in a server-side scripting language such as asp.net. I like asp.net over PHP because I know asp.net leverages C# which is type safe, good support for OOP and RAII-style cleanup. Maybe PHP has evolved with the years, but back when I did it, php didn't have much of this. I may be wrong here, so check your facts! In this model, every action leads to a call to the server which generates html and sends it back to the client. There is probably less javascript involved here.

    That's all I know. Now go wild out there and try things out. That's the best way to find something that works for you.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #28
    Lurker
    Join Date
    Dec 2004
    Posts
    296
    Quote Originally Posted by Mario F. View Post
    This is a problem with any language, really. I don't do PHP for a long while. At least 2 years. But I don't seem to recall anything in the language that promotes bad coding practices. Any language I know of suffers from caveats that are addressed in any decent tutorial or book. I don't think PHP programmers are any more prone to bad practices than python, asp.net, or ruby on rails programmers.
    I'm not going to say that you are wrong. There is more than a little truth to what you say.

    I have seen a lot of broken and exploitable PHP code in my years in IT security though, more so than I have seen actually really broken C code. We are talking out in the field here.

    The reason for that might be due to the fact that PHP is not that mature yet and also due to the fact that it is easier to get up and running and it is easier to get something going enough to get it online?

    I would still argue that if you compare people that write PHP code and C code professionally, then the PHP coders usually have less knowledge about security, the problems you have to be aware about and also awareness about their language than the average C programmer. I mean, this is a personal opinion and highly subjective and there sure is exceptions to this.

    I think I will end here, because I have a tendency to go on long rants... :-)

  14. #29
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Elysia View Post
    Mind you, I've had very little experience with web development
    It's for this reasons that it would have been better if you didn't reply. It is full of incongruences.

    1) You are not a mindless drone if people speak your name.
    2) You are not a pig if people blame you of something.
    3) Code style does not trump undefined behavior.
    4) REST is an architectural style. Not a development technology.
    5) REST isn't an alternative to server-side scripting. REST is applied to the development of web services. Not Web applications.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  15. #30
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Mario F. View Post
    It's for this reasons that it would have been better if you didn't reply. It is full of incongruences.
    It's better if you did not reply because everything that comes out of your mouth is an insult, so I will ignore you.

    Also, someone new to a specific forum is not putting him/herself in good shoes when alienating some people of a community.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Developing GUI app with C
    By elf1984 in forum C Programming
    Replies: 2
    Last Post: 10-23-2008, 09:58 AM
  2. Need help developing an application
    By Afrinux in forum Windows Programming
    Replies: 24
    Last Post: 03-16-2006, 08:44 PM
  3. what languages are fading ? what languages remain ?
    By dot_rain in forum Tech Board
    Replies: 32
    Last Post: 03-04-2004, 09:25 AM
  4. Further developing C for the web
    By bjdea1 in forum C Programming
    Replies: 24
    Last Post: 12-25-2002, 01:49 PM
  5. Developing for platform..
    By civix in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 08-22-2002, 01:45 PM