Jump to content
xisto Community

kl223

Members
  • Content Count

    6
  • Joined

  • Last visited

Everything posted by kl223

  1. It IS true that you can learn a programming language after you know another one. However, there are significant differences beetween C++ and PHP. I would say, basically the only similarity is that both are able to access network. PHP is a script-language. Being it, it's interpreted instead of compiled. That means, you'll never see the binary from the php source you've written. It also has the usual improvements that a normal script-language does. For example: no need for explicit variable type declaration; runtime evaluation of a string into code; easily written self-modifier programs; etc. It's meant to be a server-side scripting language that uses databases/etc and generates HTML output for the user. Of course there are other ways of use PHP, too. There are for example bittorrent trackers written in PHP or there is a way to use php as a client-side script, just like bash, python, perl, etc. In the opposite, C++ is a precompiled-language. That means, you cannot do anything more with the source than to compile 'em. In C++, every variable has its own well-defined type, and it cannot be changed during the execution of the program. It is also capable of getting used as server-side CGI script, but it's not that popular. Not even that supported, either. C++ is alot faster in most cases and it is just like C or Java. It's not similar to a scripting language. So, I believe C++ cannot help too much more in PHP programming than any other programming language. (ps: even if it's not true the other way around. Since php is written in C/C++, you can look into the source of the php interpreter and copy-paste functions if you like. Some of them are really interesting. ) kl223
  2. Hi! At first, sorry for my english. I'm doing my best to show you some things. These two concepts are the decentralized and centralized network plans. I've implemented server/client applications with both concepts, and I can say the decentralized one is more difficult. On google you can find some text to read under the keyword: "graph theory". At first, with it, every client needs an opened port. Only then are other clients able to connect. Then, it's truly hard to develop the network so that every client gets every line of data. Think of it: there is basically a graph: the network of the connected clients. (The nodes are the clients themselves, of course and the lines are the connections beetween them.) How can you find a path for the information that arrives by every client AND avoids circuits. Of course it is not possible to connect every client to every other clients. It would mean too many connections. And also would mean lotsa slow clients. Besides, it eats up much more bandwith, because you (as a client) might need to forward someone else's data, too. (in case you don't connect to every other clients) Look at that graph: A -- + +-----D \ / C / \B -- + + -----E Here are there 5 clients. They connect through the C client. In other words, C is the gateway. All the data A, B, D and E are sending to each other is going through C. Would you like to be the C client? And there are more such problems you have to think of. It can more easliy be done with small networks. That's why I think the most powerful solution is like with Direct Connect or IRC. There are servers which can be connected to each other in a quite small network. (not 1000000 users connect to each other, just 10-15 servers) Summa summarum: such a network shouldn't be developed without the needed knowledge. The second plan sounds more valuable. I suggest you should use async sockets for the server, so you don't have to use many threads in the server. Basically, the socket sends a signal when it has incoming data, you don't have to check it explicitly. You can take a look at it in the java.nio package. kl223
  3. Hi! As usual, I want to show you all some links from my collection. These should be useful in the future. http://dev.mysql.com/doc/ => MySQL documentation with SQL syntax reference. http://www.sqlcourse.com/ and http://www.sqlcourse2.com/ => both are interactive, free SQL tutorial sites. I learned SQL there, there is an SQL interpreter on the site for practice, etc. http://php.net/manual/en/ => PHP searchable reference. All the functions are there, so it's a "must have" for php programmers. It is because the mysql_query function does not return the result of the query. http://forums.xisto.com/no_longer_exists/ Instead of the result it returns a special resultset which contains all the results. See the manual (mysql_fetch_array, etc). I suggest, you should build up an own environment. (Basically, a wrapper for the php library functions. It should be in OOP. For example you should develop a MySQLConn class, which manages a mysql connection and with the methods it can be controlled.) That way, you can reuse the code in later applications, too. You don't have to rewrite it. kl223
  4. electriic ink: You posted this topic a while ago, so you're a bit more in C++ by now, I think. But there is a little thing that's itching me to correct: Just in order to be more elegant, you should use instead of this: this: That way, you don't have to put that cout-line. It's the easiest way to interpret for if the standard definition looks like: for ( stat1; stat2; stat3 ) { ... } is equal to: stat1;while ( stat2 ) { ... stat3;} kl223
  5. Hi! I believe WindAndWater is basically true. I learned C++, Java and Python just by writing interesting software. I mean, I didn't even know, how to write a program in C++ but I tried to write a server application. And I succeed. And my second such server was great. It's not worth learning from books, I suppose. They're just for help (for reference). The same went on with Python. I wanted to write an IRC bot because I was interested in it. I did not write any Python programs before, but during the developing of this program, I learned it. There are some useful links to use when programming: https://www.google.de/?gfe_rd=cr&ei=BwkjVKfAD8uH8QfckIGgCQ&gws_rd=ssl http://code.openhub.net/ => this one is the most useful, I believe. It's a search engine, but it searches in the source code of opensource projects. http://www.cplusplus.com/ref/ => C++ reference http://www.sgi.com/tech/stl/ => STL reference http://forums.xisto.com/no_longer_exists/ => essential, I believe. Describes how to use private data members of an object from "outside". etc. You can use google to search for what you want. kl223
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.