Programming Q's. Recommendations for a web based app developing. - by DiMarzio
DiMarzio on 1/6/2015 at 16:52
Hi!
This might not be the most fruitful place to ask this question, but I think a few programming professionals an enthusiasts roam around. So if you don't know the answer, you can as well try to guide me to the best place to ask this. I know Stack Overflow and it's great, but they don't take questions of opinions or recommendations.
Here are some specs of me:
- I generally live from hand to mouth. I know skills which I need, not the background philosophy. I'd like continue going by this principle. I want to use the skills I have as much as possible.
- I'm a first year IT student, I have taken two base level programming classes, one in Python, one in Java. I know basic programming and OOP. Nothing more really, but I'm a newb, not a noob.
- Of those two, I'd prefer Java, but if it's impossible with it, I can use Python also. I have used NetBeans.
- I know the basics and have some experience of SQL (MySQL).
- I know basics of HTML
The coding isn't the hardest part, I can code, but I don't really know a thing about developing basics. Which tools to use to do this and that and internet is a whole matter of faith to me.
Onto the actual program:
- It is eventually for commercial use, all tools/libraries etc. have to be okay with that.
- In principle, it is a game. Without digging too deep into the specifics, the player logs in and tries to solve a problem. Some information on the database are presented by the program to the player and the player can use different means to gain access to more information. Finally the users leaves some input to the database as well (his/her answer and actions).
So:
- a log in system
- It is to be run on web browser, just like this site. Write the address on address bar and there you go.
- It is going to have a database. Not too big, a thousand lines max. Database has to be two-way, the player reads and inputs some info.
- Obviously information security is a matter to be taken care of. I know nothing about it.
- I want to use test driven development. I know there are quite a few unit test frameworks for Java and NetBeans comes bundled with TestNG. Is it any good? Any other recommendations.
So do you have any recommendations or answers how to implement any of these? Or any place to ask, any keywords to google for?
Kolya on 1/6/2015 at 18:14
I assume the problem these "players" try to solve is how to buy drugs online.
Anyway I'd go with PHP which is easy to learn, forgiving and provides excellent feedback in case of errors.
Java as webdevelopment language is only used by large corporations who need to scale for thousands or more users.
My experience with it is minimal so far, although that is currently changing, but my impression is that it's slow development, that Java is not as focused on webdevelopment as PHP, because it's a general purpose language and that it's hard to learn in this context, because it doesn't provide much feedback on the Web Frontend, although I'm sure it can be made to do so.
But that's the point, PHP is perfect for the job and does what you need out of the box.
Of course you will also need good knowledge of HTML and CSS and then Javascript for client side programming. But thats the same whether you go with Java or PHP.
Good luck and don't quit your day job yet if you have one.
Pyrian on 1/6/2015 at 18:19
Hmm. You know some Java and some Python and want to work with what you know, rather than learn something new? "Not learning something new" is basically impossible with web development, but I'm going to have to advise you to stick with Python for starters (at least over Java); you will probably get up and running a lot faster that way. Web applications are annoyingly complicated compared to virtually any other type of application, so go with a framework that'll do most of the lifting for you. Here's the list of Python web frameworks; maybe check out some tutorials for each of the top three.
(
https://wiki.python.org/moin/WebFrameworks)
EDIT: I use PhP myself, but you basically have to also know JavaScript and CSS to do anything with it (and SQL and HTML and probably something else I'm forgetting), so it is in no way a quickstart.
If you want a really quickstart experience, try something like this (
http://www.outsystems.com/) (use the free cloud version) which does everything you ask and basically obviates the entire setup process, but would involve learning something new (though you say you've done JavaBeans so that's at least tangentially related).
bjack on 1/6/2015 at 21:25
As a DBA, I've scoped database systems for things like what you are thinking about, but since you are being coy about details (no worries :cheeky: ), it is a bit hard to give anything but general advice.
First - 1000 lines max? Do you mean you will have a single table with only 1000 rows or data? If so, a SQL database may not be the best thing. If it will be more complex and truly relational (not just a persistence mechanism for objects), then MySQL would be fine. If you are going to use an RDBMS (actually no RDBMS really exist, but SQL databases do - DB2, MSSQL Server, Oracle, etc.), I suggest looking up Codd and the topic of Normalization and Relational Algebra. Study at least the first through forth normal forms. I've seen terrible databases that were simply tables based upon each screen shot. SQL databases don't work well in that capacity. Consider alternatives if necessary. I'm sure some of your professors at school can give you tips.
If going with a SQL database, then I suggest using one that supports stored procedures, which the newer versions of MySQL do, at least simple SPs. Allowing users or the middle tier to directly run SQL with select/update/insert/delete (suid) invites things like SQL injection (very,very,very bad). Giving users and applications direct ability to run SQL will increase the risk of a-holes doing bad things. An SP limits users to what you want them to do and only what you want them to do.
Also, will the users have free form inputs and will these be limited? Using things like LOB columns (large objects) can eat up disk space. Allowing people to paste in word documents and/or lots of pictures may fill up your filesystems in no time. Be careful.
Best of luck.
DiMarzio on 2/6/2015 at 12:21
Thank you people for your answers! I'm sorry, I was a bit pissed off at the time of writing OP, so it was a bit of a mess. I couldn't find any good info on the internet on this matter and I was really tired of all those crappy tutorials.
I think I should tell a bit more about the project. The game is a simulation for geology education in a university. The students need to come up with an optimal strategy to mine a certain area. They already have access to some data, but they have to order analyses to get more. Analyses cost money though, so they have to figure out an optimal mining route with a minimal amount of analyses. I'm no expert in geology, and my client is not drowning me with too much info (as we are trying to stay agile), so that's it in a nutshell. So not too complicated "algorithm-wise", a prototype program already exists and I've seen it. But the web aspect is a problem.
Quote Posted by Kolya
Anyway I'd go with PHP which is easy to learn, forgiving and provides excellent feedback in case of errors.
Java as webdevelopment language is only used by large corporations who need to scale for thousands or more users.
My experience with it is minimal so far, although that is currently changing, but my impression is that it's slow development, that Java is not as focused on webdevelopment as PHP, because it's a general purpose language and that it's hard to learn in this context, because it doesn't provide much feedback on the Web Frontend, although I'm sure it can be made to do so.
But that's the point, PHP is perfect for the job and does what you need out of the box.
Okay. I read a bit about the topic and yes, seems that Java isn't really good for web application. But Python was also mentioned as a good option for web programming so I think I'll go with that.
And there's actually the root of my problem. Now that someone mentioned PHP, I knew something to google for: "web application programming languages". And now I know I can do it in Python, but I also have to learn Javascript. The world seems to be a bit brighter place once more. But if my knowledge is close to zero, it's really hard to know where to look for the answers. You can't ask, what a car is, if you never heard about one.
And I googled about PHP, and people said it's a crappy mess, but that's of course their opinion. But I'll stick with Python, because I know it already.
Quote:
Of course you will also need good knowledge of HTML and CSS and then Javascript for client side programming. But thats the same whether you go with Java or PHP.
Good luck and don't quit your day job yet if you have one.
Yes, HTML and CSS are somewhat familiar to me, but Javascript I have to learn.
Quote Posted by Pyrian
want to work with what you know, rather than learn something new? "Not learning something new" is basically impossible with web development,
That came out wrong. Of course I have to learn to something new, that's why I took this project. But what I meant was that I'd want to spend the most of my time working, not drowning in a hell of tutorials. Of course, if something is a whole lot easier with another technology, say PHP, then I guess the time invested in learning it pays off in the end. But if I can use, what I already have, then fine.
Gotta check out those.
Quote Posted by bjack
As a DBA, I've scoped database systems for things like what you are thinking about, but since you are being coy about details (no worries :cheeky: ), it is a bit hard to give anything but general advice.
First - 1000 lines max? Do you mean you will have a single table with only 1000 rows or data? If so, a SQL database may not be the best thing. If it will be more complex and truly relational (not just a persistence mechanism for objects), then MySQL would be fine. If you are going to use an RDBMS (actually no RDBMS really exist, but SQL databases do - DB2, MSSQL Server, Oracle, etc.), I suggest looking up Codd and the topic of Normalization and Relational Algebra. Study at least the first through forth normal forms. I've seen terrible databases that were simply tables based upon each screen shot. SQL databases don't work well in that capacity. Consider alternatives if necessary. I'm sure some of your professors at school can give you tips.
That's how the table lies now. But I've studied the basics of relational algebra so I'm familiar with the concepts of relational databases and normalization. Obviously, I have to normalize the data to meet SQL standards, if I decide to use it.
Quote:
If going with a SQL database, then I suggest using one that supports stored procedures, which the newer versions of MySQL do, at least simple SPs. Allowing users or the middle tier to directly run SQL with select/update/insert/delete (suid) invites things like SQL injection (very,very,very bad). Giving users and applications direct ability to run SQL will increase the risk of a-holes doing bad things. An SP limits users to what you want them to do and only what you want them to do.
Noted.
Quote:
Also, will the users have free form inputs and will these be limited? Using things like LOB columns (large objects) can eat up disk space. Allowing people to paste in word documents and/or lots of pictures may fill up your filesystems in no time. Be careful.
Best of luck.
The users have free form input and they have no need to be long, so I have to limit them somehow. Did that answer your question? I'm not sure I understood it.
WingedKagouti on 2/6/2015 at 12:36
Javascript, jQuery, CSS and HTML5 sounds like they should be your starting points for the web UI itself (and Javascript is basically unavoidable), bjack has the right idea for the database side of things. PHP, Python, Java, C#/.Net and a lot of other things will be able to handle the web UI/database communication and there are a lot of different ways to do so.
Also, if your overall plan is to end up as an IT professional then you might as well start getting into the "I have to learn something new or I'm obsolete in a year"-mindset now. While polishing up your knowledge of a language or two is worthwhile, especially when starting out, you should also try looking at other (possibly related) languages, even if all you ever manage to do with them is fill the screen with multiple "Hello World!".
DiMarzio on 2/6/2015 at 17:31
Quote Posted by WingedKagouti
Also, if your overall plan is to end up as an IT professional then you might as well start getting into the "I have to learn something new or I'm obsolete in a year"-mindset now. While polishing up your knowledge of a language or two is worthwhile, especially when starting out, you should also try looking at other (possibly related) languages, even if all you ever manage to do with them is fill the screen with multiple "Hello World!".
Yes, a good piece of advice I've heard also from professionals. But now I'm on a deadline and the only thing that matters is a finished product, so :)
heywood on 2/6/2015 at 19:35
Quote Posted by DiMarzio
Yes, a good piece of advice I've heard also from professionals. But now I'm on a deadline and the only thing that matters is a finished product, so :)
That will always be true. :)
Anyway, given your relatively limited requirements and deadline concerns, I suggest you go with a full-stack framework. If security matters, choose one that's widely deployed. For Python, check out Django first. I haven't used it personally, but it's pretty popular here. Its feature set is overkill for what you're doing, but it doesn't require oodles of configuration to get going.
WingedKagouti on 2/6/2015 at 19:44
Quote Posted by DiMarzio
Yes, a good piece of advice I've heard also from professionals. But now I'm on a deadline and the only thing that matters is a finished product, so :)
If you're getting paid for that project, then you should certainly keep your focus on making it work within the deadline. But you should never forget that you may be required to go back to it and fix something. Learning how to structure your code so that you can fix an issue half a year after you've delivered it is probably one of the most important skills you can pick up early.
Documentation, even if it's just comments scattered around the code, is immensely helpful when you're trying to track down an obstinate bug. You don't have to do JavaDoc style stuff for everything you do, but it can be quite useful if it's some helper library you expect to use for multiple projects.
Meaningful names for methods, variables, classes, namespaces and so forth are another big help. Give the input parameters for a method fitting names so you know what goes where when you come back to it later. i, j, x, y, z and so forth are mostly only useful names as either loop variables when there's nothing especially important about the variable, or (for x, y, and z) as names for coordinates.
icemann on 3/6/2015 at 09:39
I'd have done it as a fictional browser the player users to do a search on the internet of a fictional world.
Do it that way, and the world is your oyster, programming languages wise. Even flash would have been fine under that model.
Best programming advice I can give: Always think outside the box