Databases are your friends. :wink:I also hate these new rash of programmers who want to use database servers for everything!
Databases are your friends. :wink:I also hate these new rash of programmers who want to use database servers for everything!
I like working with databases and database servers, but I don't think every application needs one, as much as the PHP/MySQL-trained crowd would like to think.Originally Posted by Quicklet
Why *wouldn't* you use a database to store persistent data? That's like, what they're made for. It's even in their name: database. It's like a BASE for DATA.
I'm in too much of a hurry to quote everyone but..
The win32 api is a lot easier to learn than MFC and your applications will be 10x smaller and 10x faster as a result, though your source code may be 10x larger![]()
I just find MFC frustrating and a pain in the ass and if I need a more advanced library I just use QT. With QT you can easilly recompile your app to run on OS X, Linux, FreeBSD, Windows, etc. http://www.trolltech.com/developer/downloads
--------------------------------------------------------------------
Self teaching is fine I suppose, but there is a lot to be said for a traditional computer science education. When you really understand the fundamentals you have a lot more options and can do stuff like become proficient in java in a week, python in a day, php in an hour, etc. Besides, you don't wanna look stupid if someone asks you the difference between a r-tree and a b-tree or a qsort and a bubblesort or a local variable and a static variable, etc.
Whatever you do don't just learn one language because you never want to be locked into one frame of though or one platform. Play on other platforms too with different GUIs or no GUI at all. Everything you learn in one language will help you in others and when a simple task comes up the time you invested in diversity will pay off when you can use the right tool for the job.
----------------------------------------------------------------
On databases eh.. You only need a database SERVER if multiple clients are accessing the data and you need ACID (Atomicity, Consistency, Isolation, Durability). Basically if there is not a "BEGIN" and a "COMMIT" anywhere in your sql code, you did yourself a disfavor by using a database server.
For example lets say in your business and you write a check to pay for the phone bill. You have to insert a new row for the actual check, and you have to do debits and credits on your cash account and expense account. What happens if something goes wrong and the program crashes halfway? You general ledger may not balance and it could halt your entire business for days while someone puts their nose in their manually to figure out what didn't balance up.
Transactional databases guarantee that a series of sql statements made in the context of BEGIN and COMMIT will either all go through or none at all.
Usually when you need one you are doing something kind of important.. I could go on for days about why mysql is a bad choice for something important but I will just give you one example and you can google for 99999999999 more if you like.
Mysql violates Consistency. Example: Lets say a column in your scheme is just a 16 bit integer. If you insert the value 100,000 into it, what will happen?
If you use postgresql, oracle, or any other real database you will get an error and it won't work.
In mysql.. it depends on the version of mysqlIt will insert something but it won't be 100,000.
This causes the worst bugs in the world because it may take awhile to figure out what caused your entire database to become dirty with data that makes no sense.
Sure it is your fault for trying to put a number too big in the field, but it is the databases's job to store data for you. Sometimes the person who makes the scheme is different than the person who wrote the code which is different than the person who uses it. If I ask it to store the number 100,000 and it says "OK, I did!" it shouldn't fucking store 0, or 1, or 65535, or 32767. This is the type of shit that can cause you to loose your job, taint your reputation, and cost the company you work for millions.
One of the common arguments mysql users have used in the past is that it is "so fast!" when doing simple selects. First of all, simple selects are retarded. Most of these people don't know the difference between an outer join or a left join or don't know what a join is at all. Tables in SQL are supposed to have M:N relationships and to properly query them you gotta have some joins going on for input to make sense. Databases that are designed for that type of real workload are faster than mysql
If you are just doing key->value lookups check out http://www.php.net/manual/en/ref.dba.php and you can blow mysql's simple selects out of the water.
If you still plan on using mysql.. learn sql at least. I can't tell you how many times i've seen this. Website will query a list of people who meet a certain criteria from another table like the people who made a purchase in the last month. Of course just printing out their customer IDs won't do any good you need to print the name out in the table too right? Lol.. mysql users will go ahead and start printing the table, than when it reaches each invidual customer ID it will do another separate query to get their name/address/etc. If 200 customers are displayed in the table, thats 201 separate queries to the database! Thats "so fast!"
There is a difference between a DATABASE and a DATABASE SERVEROriginally Posted by aurik
![]()
Qt is GPL. Anything linking to a GPL product needs to be GPL itself. If you don't mind distributing your source code to whomever uses your product, then you're in the clear. If you do mind, you need to buy a license. This makes it inappropriate for some people to use; use of the MFC doesn't enforce any similar license/distribution restrictions.Originally Posted by Devek
Poor wording and a lack of thought on my part. I meant only database servers. Most people's first thought for small data storage shouldn't be, "I need a SQL driven DB server" when designing their new weblog.Originally Posted by aurik
It doesn't matter if you are not selling your application..Originally Posted by netz
If you're selling commercial software and you can't afford QT.. lol. It pays for itself in how well it works. If your program is even halfway popular it will pay for itself even more by being able to sell it to people who don't use windows..Originally Posted by netz
While Windows onry isn't a similar restriction, it is kind of a significant oneOriginally Posted by netz
![]()
Like making the variable global? Which you can access them anywhere during your coding.Originally Posted by Chreman
Originally Posted by Wtfiku
![]()
Fixed.Originally Posted by Fhqwghads
No... if you distribute binaries of a GPL application, the source must go along with it, or must be made available on request. Cost has nothing to do with it.Originally Posted by Devek
The other major competing toolkit, GTK, is LGPL, and can be linked against by closed source applications without the viral clauses of the GPL taking effect.
If you're not selling the application why would distributing the source matter? If you can't afford QT what the fuck do you have thats valuable and worth protecting?Originally Posted by netz
It isn't a problem. I distribute source with just about everything I do, simply because people paranoid about spyware and viri can simply recompile it themselves. In fact I would say anyone afraid to show their source are gigantic faggots for the most part
GTK on the other hand sucks balls, especially on Windows![]()
I'm pretty much completely in agreement with you, right up until the gigantic faggot part... but the way Qt is licensed does present a difficulty for anyone who wishes to distribute (free or sold) binaries and withhold the source code. It mostly concerns people still tied to Windows; how many freely available Windows-only applications came with the source code? I understand this is a non-issue for you, but I don't think it's unreasonable to say that not every developer holds the same views you do, and wish to keep their source code proprietary.Originally Posted by Devek
I don't even really know why I decided to nitpick on this technicality >.>
I don't like revealing my source because of my naming conventions. Like:Originally Posted by Devek
BOOL bFuckOff
int nCountVarBitch
float fFuckDecimals
DWORD dwWORDTOYOMOMMA
char szItsATempVarWhoTheFuckCaresGoddamnit[256]
And my comments aren't the best either:
Job security ftw. If they don't know wtf your code is doing, they can't get rid of you.Code:// Class class SuperComplexClass : cSomeOtherBullshit { private: int nSuperImportantInt; // Constructor. SuperComplexClass(int nGuessWhatThisIsFor) { // Do all kindsa funky wonky weird shit that nobody knows wtf it's there for. // Make sure at least 1 constructor is private just to keep people wondering. } public: // Constructor SuperComplexClass(){nSuperImportantInt = 0x3357; // Magic numbers are fun!} /* Add insane number of methods whose names have nothing to do with what the methods accomplish. Example follows. /* void SitAndSpin(int a, int b, int* ret){*ret = a+b;} }
Hungarian code ftl!
Error. Correction */ 8)Code:// Class class SuperComplexClass : cSomeOtherBullshit { private: int nSuperImportantInt; // Constructor. SuperComplexClass(int nGuessWhatThisIsFor) { // Do all kindsa funky wonky weird shit that nobody knows wtf it's there for. // Make sure at least 1 constructor is private just to keep people wondering. } public: // Constructor SuperComplexClass(){nSuperImportantInt = 0x3357; // Magic numbers are fun!} /* Add insane number of methods whose names have nothing to do with what the methods accomplish. Example follows. Error oh no lawl /* void SitAndSpin(int a, int b, int* ret){*ret = a+b;} }
Good catch! :D Your compiling skill increases 0.3 points.