Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks.
On August 25 2016 14:10 tofucake wrote: if you think PHP is for simpler non-ecommerce sites you are horrendously mistaken
As I said, from my "limited" knowledge. I just can't make up my mind and I need some help.
First of all there's plenty more going on now than just JEE and PHP (although those would be the most prominent). There are some new kids on the block that are getting some traction: - Ruby on Rails: it's developed with web in mind, really cool, very hip, development times are crazy good but maintenance can be a bitch - Python (Django): Python is nice. Django is nice. It's like PHP but better. Not as popular though. - Node: JavaScript went up in popularity immensely lately (it's on the decline now) but still I'm of the opinion that backend is not where JS should be.
Now, to help you out with your decisions a bit, let me tell you about some of the pros and cons of JEE vs PHP:
JEE: + Java ecosystem: this is the biggest thing, since you're doing Java you get access to a lot of things (it's also easier on integration since 99% of the ESB solutions are written in Java - Zato is written in Python and I've found it better than other solutions but it's relatively new) + Good pay: Java developer's salary is usually 2-3 times higher than PHP dev's + Versatility: after learning Java you can go and do other things than web dev
- Corpo: Java is mostly used in corporate environments, for some this might be a pro but I think it's a con most of the time - Java: from my (limited) experience with JEE it's horrible to work with. In the web dev you don't really need enterprise solutions all the time and developing anything in JEE takes much longer than any other stuff I mentioned earlier. I also find it tedious, too verbose and not flexible enough. Scala looks very nice but it's pretty niche still. - Declining: Java is declining in popularity. Especially in web development. People discovered that you can have practically the same thing for half the cost in half the time with other solutions. It's still going strong only because of how much of the corporate market has been saturated with it before
PHP: + Popularity: about 80% of the web runs on it so it's not like PHP is going away anytime soon, especially that with the advent of PHP 7 the language started to get its shit together. This of course translates directly to plenty of job opportunities (I've worked in 5 different places over the past 2-3 years and I still have options to choose despite living in a non-tech city - capital of the most rural region in Poland) + Simplicity: it's easy to learn, just need to get familiar with many pitfalls you can get into early on so you can avoid them + Many frameworks: there are plenty of frameworks to choose from in the PHP world that let you develop really good apps with best practices (Symfony and Laravel being king right now in the full-stack world, Silex and Lumen leading the way in microframework world)
- Little pay: PHP dev's salary is pretty much at the bottom of the pack, that's because there's plenty of work and plenty of people doing it - PHP: even though it's getting better and better its still a pretty shitty language - Web only: with PHP you're pretty much tied to the web
So, if you want to work in a big company, earn plenty and participate in the rat chase then you should go with JEE. If you'd rather work for less but in a smaller and friendlier environment then choose PHP.
PHP is pretty good to start with since there's plenty of opportunities to land a job. You can always switch to something else later on since your experience with PHP will make learning other languages and frameworks easier.
Also, no matter what you choose you'll also have to learn JavaScript, CSS and basics of Linux server administration. Just so you know.
I have a web app comprised of java+mysql+tomcat+some static files. Do I need different containers for each of them or can I define all of them with a single dockerfile and call it my-webapp-image ?
- Corpo: Java is mostly used in corporate environments, for some this might be a pro but I think it's a con most of the time
I'm not sure if I'm understanding this. Could you elaborate please?
Due to costs associated with hiring enough Java programmers, maintenance and other stuff (IDE licenses, Oracle dbs etc.) its usually big companies and corporations that use Java. Most startups and smaller firms are using different technology stacks.
By the way, could you also explain this comment regarding Node?
- Node: JavaScript went up in popularity immensely lately (it's on the decline now) but still I'm of the opinion that backend is not where JS should be.
Why would it be on decline. Also from what I understand when I tried to study it, there is something special in the way it serves client requests. Also, wouldn't Node be a dream job for those who want to be full stack developers? backend and frontend the same language.
On August 26 2016 00:24 tofucake wrote: afaik you can do it in a single docker image. I found docker-compose works nice too
You can. It's just not how docker is meant to be used, and compromises some of the advantages of using Docker in the first place. I would for sure split into separate mysql and Java containers.
- Node: JavaScript went up in popularity immensely lately (it's on the decline now) but still I'm of the opinion that backend is not where JS should be.
Why would it be on decline. Also from what I understand when I tried to study it, there is something special in the way it serves client requests. Also, wouldn't Node be a dream job for those who want to be full stack developers? backend and frontend the same language.
I have no idea why it's on the decline (that's what statistics for job offers/job seekers for certain programming languages are showing). Perhaps after everyone and their mother jumped on the hip bandwagon of JS everywhere and for everything the market got over-saturated with JS devs while some startups tried it out and switched to something else (most startups tend to start with RoR and then move on to other technologies, even PHP, because developing in it is super fast and pleasurable but long-term maintenance is a bitch).
When it comes to programming language popularity the top 5 are Java, Python, PHP, C# and JavaScript (in that order). I'm quite surprised that Python is by far the fastest growing in popularity but it's an awesome language. Source: http://pypl.github.io/PYPL.html
Anyway, ultimately you should simply choose what you like working with. I'm not a big fan of Java and JavaScript so I never really jumped on the bandwagon (I tried a couple of times but it never worked out). I simply don't like working with those technologies as it brings me no joy at all and I've found out that as soon as you're not enjoying what you're doing it's time to bail out. I quite enjoy working with PHP (despite its many flaws) but I'm doing some Python on the side right now (especially that I've discovered that you can make Android apps/games with it without much hassle and it's 10x more pleasurable than working with Android Studio).
You can make android apps in python? Holy crap, that is awesome! From this moment, I am officially done with Java Android forever! Please tell me the UI is fairly easy. Please please please tell me that. I have never done any UI programming in Python (I wouldn't even know where to start, if not using a web frontend), let alone Python for Android.
On August 26 2016 07:28 Acrofales wrote: You can make android apps in python? Holy crap, that is awesome! From this moment, I am officially done with Java Android forever! Please tell me the UI is fairly easy. Please please please tell me that. I have never done any UI programming in Python (I wouldn't even know where to start, if not using a web frontend), let alone Python for Android.
You can use the pygame library for that.
What you have to do is: 1. Make a game/app with python + pygame library 2. Use this: http://pygame.renpy.org 3. Map computer keys to android gestures:
if android: android.map_key(android.KEYCODE_BACK, pygame.K_ESCAPE)
4. Use the library from #2 to package your game into .apk
You could also use kivy but most people tend to be of an opinion that pygame is more intuitive than that.
Just note that you won't get access to native Android interfaces and will have to rely on custom solutions available in pygame.
I'm just starting with that so you have to take everything with a grain of salt. I'll probably post here if I manage to achieve anything meaningful but it might take a while since doing python stuff is pretty much a side-project for me for now.
Here's a video from 5 years ago that showcases this:
My question was why it is a huge issue not why it is a single threaded
It can be an issue but it doesn't have to be.
From the linked SO question:
If you have an intensive I/O scenario (like a proxy), the event base model will rule, whereas a CPU intensive scenario with a low number of concurrent processes will work best with the thread-based model.
My question was why it is a huge issue not why it is a single threaded
In theory it means that, if one process takes very long, all other processes have to wait for it, which can - again, theoretically - result in poor page loading speed for the end user. In practice, that can indeed occur if a single function does a lot of calculations, but it's a very rare case.
However, firstly there are process managers like StrongLoop for Node.js that essentially run many instances of a node application in parallel and spread the requests between them, similar to the worker threads that the apache uses. Secondly, most of the processing time of a website these days is pure I/O, database requests, file I/O and such. As an example, PHP applications wait for the database request to finish before they continue with the next line of code, Node.js doesn't. Essentially, once the database query is sent to the server, it starts to work on the next web request and comes back to the first request once the results from the database come back. That reduces the downtime in processes that traditional solutions have. Lastly, it allows for much easier sharing of data between processes. Taking PHP as an example again, if you want to cache some data that is used in every request, you either have to use some shared memory solution or redis, memcache and the like and serialize/unserialize data on every request. In Node.js your application is persistent, so you can simply store the data that is used in every request without having to read it again every time a new request comes in. That also works for database and file handles. Of course if you are using a process manager, each process will still have it's own shared data.
That is not to say that Node.js does everything right. Node.js does have a tendency to lead into "callback hell" where all the APIs require a callback in which another API call might be made that requires another callback - and so on until you are 30 callbacks deep and forgot how you got there. If you don't pay careful attention to your project structure, it can make applications very messy. There are decent solutions to it, but it's something you have to consciously think about when writing Node.js applications.
Personally, I like Node.js. It's not perfect, but once you wrap your head around JavaScript, it's not as bad as it's made out to be. I'm not sure whether I would use it for massive projects with multiple developers, but it served me well in my private projects.
My question was why it is a huge issue not why it is a single threaded
*snip*
I like how you briefly state a "theoretical", as you call it, downside of single threading and then continue to write a lengthy post where you cherry-pick examples as to why single threading is superior, thereby marginalizing the 'huge issue' that it really is.
My question was why it is a huge issue not why it is a single threaded
If you're looking to do some standard website, node is a crap choice. Something like TL would go down in flames if it were made in node, nevermind any big site. Nobody will create the next Facebook/Google/Etsy/Ebay/PayPal/Expedia/Whatever until node gets multithreading.