20 ms·
Vanilla php + html5up + sqlite3. Everyone else here is trying to be stylish and fancy. Your customers don't care what language it's in or whether the code is
by kristopolous 8y ago
Vanilla php + html5up + sqlite3.
Everyone else here is trying to be stylish and fancy.
Your customers don't care what language it's in or whether the code is beautiful.
No cutting edge incomplete frameworks, convoluted tooling, piles of inaccurate documentation to read, inexplicable cryptic error messages with a bunch of incorrect solutions on stack overflow, or other incompetently over engineered bullshit.
Just go as vanilla, basic, and standard as possible.
True speed comes when you don't have to deal with other people's bugs and poorly designed mistakes.
Don't rely on code written by flocks of people you'd never hire in a million years.
- crag 8y agoSince you listed PHP - take a lot at Laravel (https://laravel.com/ https://laravel.com/) Like Rails, you can get a a site/app up in minutes. .
- noir_lord 8y agoSymfony 4 can be spun up as fast as Laravel 5 and (this is my opinion) Symfony has all the benefits of Laravel with a better ORM (if you want it) and they have never broken backwards compatability in my experience. Throw in the utterly fantastic documentation (that is both more detailed, thorough and better organised) and I'm not sure why Laravel took off the way it did. I used Laravel for 3 years at a previous job (from 3 to 4 to 5) and I still think Symfony is the better basis for anything that isn't a relatively small application. Also Symfony components are genuinely de-coupled, documented on how to use them stand alone and useful for that (I gradually brought them in on an inherited project with few issues).
- no1youknowz 8y agoI have a huge complex behemoth of an application which is written in CodeIgniter 3 with a whole bunch of changes that I have made over the years to the core. To call it CI 3 is a bit of an understatement. I hadn't upgraded sooner because it had worked, but then due to issues with my stack. I decided recently to start from scratch and upgrade my toolset as well. So I was deciding to either go symfony or laravel. Laravel won by a huge margin. From the perspective of a newbie. Even though I have 10+ years developing in PHP, I like to debase myself and approach with no baggage. Laravel has so many more tutorials than Symfony 4 on Youtube. I wanted to learn and very very fast. So going through videos in 2x speed and getting the gist of how things worked was great. Continuing on, there were many tutorials which had actually built apps using Laravel 5.5/5.6. So I was able to quickly get up to speed using Validation, Eloquent, Passport, Middlewares, Query Builder, etc. On the documentation side. It's very easy to use and describes simply how to get things done. Next was that Laravel had VueJS integration. So out of the box, I could have an SPA and use Laravel effectively as an API. Of course, right now I am one developer so 1 codebase is fine. But later on, if I need to split and have two codebases (VueJS front-end, Laravel API), then I can do that. With Laravel I've gone from writing straight SQL to using the ORM. Which surprisingly for me, reduced my codebase by a significant margin and surface area for bugs. I have found that there are a lot of Laravel composer packages compared to what I was using before and again makes my life so much easier. Finally, there is a bit of synergy between Vue and Laravel. For example, I'm able to post a form with Vue using Vee-Validate for the validation. Then get laravel to post back any errors for Vee-Validate to consume. In jQuery and using my old codebase. I had to jump through hoops to get it done and much more code. I will also say, that I had actually decided to go with Symfony in the beginning. The main reason was that Symfony was more pure and I have developer friends who recommended it as the way forward. > and I'm not sure why Laravel took off the way it did. It took off because with Symfony, try as I might. I just couldnt get on with it. It wasn't as pleasant experience with Laravel and honestly. Even if I persisted. The time that I took to go from zero, to duplicating my own stack was a few weeks. I don't think I could have done that with Symfony. Yes, I could probably achieve the same result with Symfony. But not in the same amount of time. As still a new laravel developer. I want to be able to deploy new features very fast. I can do this now.
- noir_lord 8y agoFair enough, it founds like you found a good fit for your use case (and that's a good thing). In a year or two when you have a bit of time it might be worth going back and having a look at Symfony anyway, you'll likely find that going from Laravel to Symfony will make more sense than CI to Symfony (underneath Laravel uses a fair few symfony things).
- aembleton 8y agoThank you. I've never come across html5up [1] before, but the templates there are just what I'm after at the moment. 1. https://html5up.net/ https://html5up.net/
- zo1 8y agoI don't get it. They all look practically the same, just with different color schemes and splash backgrounds?
- companycalls 8y agoAgreed, this is a great resource. Is there anything else like this out there?
- buvanshak 8y agoOk. But that does not mean that you have to use the worst thing that is out there. Why not Python?
- ramy_d 8y agoit's worse to you, not the client. client actuality doesn't care and PHP is legacy I guess?
- eagsalazar2 8y agoActually they do if they have to maintain it or want hire really good developers to maintain it. Not saying PHP doesn't meet those criteria, it might in a given region or situation, but just saying your dismissal of this consideration is way off base. Good luck hiring anyone passionate about good software development or recently graduating from decent CS department to work on your PHP apps. I'm sure you are a great developer with a real passion for your craft but you do realize that plus PHP makes you a very uncommon find, right?
- crag 8y ago"plus PHP makes you a very uncommon find, right" What? Half the programmers I know in NYC write PHP. The other half write a combo of Java/C#/Python. These aren't programmers working for startups - they are working for companies and the government. PHP is used everywhere. Except maybe in SFO (and surrounding area). I mean look at the job listings for NYC, DC, Miami, Baltimore, Louisville, etc, etc. Look I know this board is focused on Silicon Valley, but it's a big world out there.
- eagsalazar2 8y agoCalling out the regional dimension to the popularity of PHP is totally valid. I think the thing I'm really reacting to is people repeatedly saying "the client doesn't care" which I vehemently disagree with.
- 8y ago
- hangtwenty 8y agos/php/python and flask or django, depending on the project/ and i agree with the whole comment!
- meiraleal 8y agoAnd it makes more sense as OP mentioned Django, not PHP.
- Grue3 8y ago>Your customers don't care what language it's in or whether the code is beautiful. Yes, but the person who has to code it cares. No reason to choose the worst of widely used programming languages and the worst possible database for asynchronous read/write patterns inherent to web apps, except as an exercise in masochism.
- na85 8y ago>the worst of widely used programming languages Oh, you mean javascript?
- BlakePetersen 8y ago:eyeroll:
- eagsalazar2 8y agoIn many areas of the US (the entire west coast for example), PHP is dead - plain and simple. Independent of whether it is good or not, selecting dead or obscure technologies for your clients is completely irresponsible and leaves them with a maintenance catastrophe just because you like php. Yes there is a lot of hipster-ism out there in platform choice but there are plenty of mature, fast, and popular options out there. PHP is not one of them.
- crag 8y agoThis is just bs. PHP is thriving everywhere expect Silicon Valley.
- lignux 8y agoPHP is not mature or fast or popular? And PHP is very far from dead no matter where you are. In fact is getting a lot more interest now since PHP 7. If you don't like PHP that's one thing but what you said is just wrong.
- deleted 8y ago[deleted]
- avip 8y agoYou seem to know a lot about what everyone else's motives are :) There's nothing less "vanilla" or "standard" with python/go/RoR/whatever vs. PHP. It just so happens that you know PHP well, so, by all means, YOU should use that.
- gkya 8y agoOne can put together a set of (Fast)CGI scripts in almost any language, given environment variables and some IPC is supported (IDK what IPC FastCGI uses exactly, bug CGI is envvars). Same goes with exposing a custom socket server. I guess people associate languages with frameworks and that's why they think these things are not possible in them. Or they like the <?php ?> style intermingling of 4 programming languages, which is a pathetic bad practice that turns the program into a pseudo-quine immediately. Just read the source of a WordPress plugin (keep a nylon bag handy because it's gonna give you nausea, to say the least).
- Mikushi 8y agoExcept OP made no mention of Wordpress, its notoriously bad and any decent developer who also happens to use PHP knows not to touch it with a ten foot pole.
- 52-6F-62 8y agoAs someone in a position who's primary job has [had] little to do with WordPress plugin work, but is at the same time increasingly exposed to that due to sales department directives... you've understated it. And while I'm not a huge fan of working in PHP, it has its place— my remark is unrelated to that.
- JepZ 8y agoPlease correct me if I am wrong, but as far as I remember the combination of PHP and sqlite fails fairly quickly when if comes to concurrent users? Don't get me wrong, I am very fond of sqlite, but to use it efficiently you have to manage the connections to the database and from what I have heard, that doesn't work particularly well with PHP. This doesn't mean that the above recommendation is wrong (in fact, I used similar approaches in the past), I just thought that it should be mentioned and if someone wants to build something that has a lot of concurrent users by design, he knows which part will be the first bottle neck.
- edthrowaway 8y agoSqlite's limitations have nothing to do with PHP. But you're correct that it's not intended for use as a multi user database. The limitation is in concurrent writes. If your app is read-oriented, then there is not a problem. However, I'd personally always use postgres in this case, myself.
- megablast 8y agoAnd plus, it works on cheap shared websites that can cost $10 a year + domain name.
- cutler 8y agoIsn't the "PHP works on cheap hosting" schtick a bit dated now you can get a dual-cpu VPS with 8GB RAM at hetzner.com for 8.90 Euros per month? Commodity hosting now makes JVM apps feasible at the lowest price points.
- hellofunk 8y agoThis comment is highly presumptuous about the actual development experience of more modern languages and tools. > True speed comes when you don't have to deal with other people's bugs and poorly designed mistakes. PHP is often, in practice, a language where bugs are more likely compared to these "stylish" other languages you mention. [0] [0] http://delivery.acm.org/10.1145/3130000/3126905/p91-ray.pdf?ip=145.101.26.2&id=3126905&acc=OPEN&key=4D4702B0C3E38B35%2E4D4702B0C3E38B35%2E4D4702B0C3E38B35%2E6D218144511F3437&__acm__=1528037845_92f2ee56011a02c692b945e24d849abb http://delivery.acm.org/10.1145/3130000/3126905/p91-ray.pdf?... " For [languages] with positive coefficients we can expect that the language is associated with a greater number of defect fixes. These languages include C, C++, Objective-C, Php, and Python. The languages Clojure, Haskell, Ruby, and Scala, all have negative coefficients implying that these languages are less likely than average to result in defect fixing commits."
- vonseel 8y agoI wonder why Ruby ended up in the negative coefficient group instead of exhibiting similar characteristics to Python, for example.
- hellofunk 8y agoIt's quite an interesting study to read, and not long. I recommend giving it a few minutes to answer that question.
- vonseel 8y agoThanks, assumed it would be too academic or technical to understand and didn’t look at it. Will check now.. Actually, the link is not working on mobile. Maybe it will work on my desktop.
- Volt 8y agoTry this permalink instead: http://dx.doi.org/10.1145/3126905 http://dx.doi.org/10.1145/3126905
- superasn 8y agoPHP is like the Javascript of backend. Hate it all you want but there is nothing better to get shit done esp if you're a small team or working solo. Also it is super flexible too (much like JavaScript and babel) as in you can write strict OOP code or you can write plain php code inside Html in static files.
- biztos 8y agoIsn't NodeJS the Javascript of backend?
- murukesh_s 8y ago+1 for NodeJS, seriously no offence to PHP folks, but Nodejs or Python is not much different from PHP in terms of developer productivity.
- partycoder 8y agoThe reference implementation of PHP, Zend, is objectively not good (blocking I/O) and encourages server side templating, which is basically something you can perfectly do in the client and serve on a CDN at much lower cost (orders of magnitude lower, for processing, memory and transfer). That being said, doing server side templating in node.js is even worse since it usually wrecks the entire event loop with long lived CPU-bound operations flushing your server performance doing the toilet.
- gkya 8y agoThe first paragraph is plain wrong. JS is the JS of frontend because there are no replacements. Use a language compiled to it, but still you'll have to know and use JS. PHP on the other hand is a caricature of a language that you can avoid. The second paragraph is correct, but it's just equally correct for Python, Ruby, Perl, Lisp, Shell languages etc., as they all support multiline strings and string interpolation too. The only difference is that you'll have to wrap strings in delimiting markers, instead of code with <? ?>.
- 8y ago
- kbenson 8y agoWhat exactly is the benefit of using sqlite over mysql in this case? Is the 10-15 minutes you might save looking up a quick setup tutorial for the system provided packages really worth the later problems? Postgres is slightly more complex (but pays for itself with additional capabilities), so I can see avoiding that unless your are already familiar with it. As for PHP, at this point it's not really any easier or harder to get up initially then Python, Ruby or Perl, so it really comes down to personal experience. Whichever one you know best, use it. Whichever framework you know best that has some solutions for what you want to do, use it. That will be quickest.
- mercer 8y agoI usually go for Postgres, but I suppose one advantage is that backing up involves the filesystem rather than figuring out how to do a db dump. Not entirely sure if it's that simple though.
- dezzeus 8y ago> What exactly is the benefit of using sqlite over mysql in this case? I'll just let you read this: https://www.sqlite.org/whentouse.html https://www.sqlite.org/whentouse.html
- mcovey 8y agoI don't run a MySQL server on my personal computer. I don't want to run one. If I want to start writing code right away to flesh out an idea, SQLite is the tool I can use, it enables me to develop locally with no SSH/FTP overhead or setting up a VM. It lets me start writing code instantly. And it's performant enough for most any MVP, and the SQL dialect is pretty standard so you can upgrade to Postgres or SQLAnywhere or whatever you please when the time comes.
- kbenson 8y agoWhat I hear you saying is: 1. You don't necessarily want to develop in the same environment you deploy to. 2. You don't want to install some things on your development machine. Together, those are dictating some development directions for you. That's fine. Those are perfectly valid choices. But I think it's easily summed up in your case as "You use sqlite because it fits well with your current development pipeline." On the flip side, I do development on remote servers using vim. For me, sqlite provides little-to-no additional benefits, since MySQL or Postgres are a package install away (if not already installed), and that's a small price to pay for their additional benefits (for example, a much richer set of data types). At the same time, this type of development pipeline makes certain types of development harder (there's lots of tools for vim/emacs, but some things graphical IDEs provide are harder to achieve). There is a middle ground, which is emulating the target environment through a VM on the development machine. It should provide the best of both worlds, for a cost of a little most complexity. I've never really gone for that, as I'm happy with the remote dev setup I have, and it's easier not to have to devote local resources to that for me. It's a popular choice as I understand it though.
- lol768 8y ago>No cutting edge incomplete frameworks So what, you rewrite a templating engine every time you want to make an application that outputs user data? Or are you reliant on making damn sure you always call htmlentities every time you echo something to prevent XSS? Are you sure you've not slipped up anywhere? What about CSRF? Do you write your own filtering mechanism every time you make a web app to check for the existence of a CSRF token in all state-altering (e.g. POST) requests? There are reasons people use frameworks. Security is one of them - I _love_ assessing apps which are written in plain PHP because they're almost always a trainwreck. You don't tend to see SQLi from devs who tend to use ORMs, nor do normally you see stuff like LFI if they're using a well-known templating engine. Can you write secure code in PHP? Absolutely. But it's more effort and easier to get wrong. Your client may not care about the technical details, but when the security assessment report says your PHP app has a stored XSS and an equivalent ASP.NET MVC app is safe..
- deleted 8y ago[deleted]
- pacifika 8y agoThe other side of the coin is whether you do a full security audit of every framework and dependency graph before you use it? When you write your own code you know there is nothing hidden.
- philtar 8y agoThat's a highly simplistic and incorrect way of looking at it. Do you know what CSRF is? Do you want to implement it every time you create a website? And all the other XSS vulnerabilities that could occur because you weren't careful. Frameworks are much better at handling most security needs.
- enraged_camel 8y ago>>There are reasons people use frameworks. Security is one of them - I _love_ assessing apps which are written in plain PHP because they're almost always a trainwreck. It’s totally OK for a prototype to be a trainwreck because its purpose is to give you the ability to launch it in front of potential users, show them a few features and get their feedback.
- Geee 8y agoThis might be true if you're creating a very simple web site that is never meant to be a real app. If you're creating a more complex web app, with authentication, user management, billing, admin pages, etc. you are better off with frameworks such as Laravel, Symphony or Slim if you are using PHP.
- shadowmint 8y agoThis is correct. ...it is also why php is not really any significantly better choice than any other framework/language combination. The benefits of ‘plain php’ (simplicity) disappear quite quickly when you’re doing anything non trivial. I would never choose php without one of those framework stacks; it doesn’t scale, its prone to hideous security issues and its a fugly mess of reinventing the wheel. Frankly, anyone doing this these days has no idea what they’re doing.
- throw2016 8y agoLet's be frank. This is a place for marketing the newest thing where skepticism and scrutiny is not welcome and likely to be dismissed as 'grey beards' and 'people scared of change'. So there is never any scrutiny, no experienced person is going to expose themselves to ridicule so all the problems are discovered years later only for a new one to take its place. Ruby for instance has huge deployment problems, why the hell do you need a build environment on deployment and expose end users to installing hundreds of gems that may need to be compiled and can fail anytime? Same with the wild lands of NPM. It's as if people have endless time to go down all the rabbit holes. On the other hand Facebook, Wikipedia, Wordpress, Slack and some of the most scalable sites online today use PHP. Yet according to the the hivemind PHP is somehow a disaster, and the next over-engineered complexity is the panacea. This is just not credible. Unless there can be a way to apply scrutiny during the hype phase the cycle of over-engineering, needless complexity and offloading bad engineering on end users is going to continue.
- deleted 8y ago[deleted]
- nikdaheratik 8y agoYou're wrong. This is a case where whatever you're comfortable with is the best solution. Just because you personally don't know frameworks, or js frontends, doesn't mean the people who do are inferior or less secure. I guarantee someone who knows how to work a framework can turn out the same work much more quickly and more maintainable than someone who is working from Vanilla PHP and having to implement basic logins and email templates on their own. And a "throwaway project" can also be turned into something customer facing much more quickly as well. I agree, you don't need to pick bleeding edge tech, but you should pick something stable and well documented and run with it rather than basically having to rewrite the same project in the framework once you've got it up and running in vanilla PHP.