• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=BeatAlex;44976324]Can anyone recommend a good FTP program? I currently use FileZilla but I want one that auto uploads on file save and is free. I also use Sublime Text 2, so if anyone knows any working FTP addons then that would be awesome too, thanks! :smile:[/QUOTE] [url]http://wbond.net/sublime_packages/sftp[/url]
[QUOTE=Miljaker;44976517][url]http://wbond.net/sublime_packages/sftp[/url][/QUOTE] Thank you! I'll look into this!
[QUOTE=BeatAlex;44976324]Can anyone recommend a good FTP program? I currently use FileZilla [B]but I want one that auto uploads on file save [/B]and is free. I also use Sublime Text 2, so if anyone knows any working FTP addons then that would be awesome too, thanks! :smile:[/QUOTE] No you don't. That's a [I]really[/I] bad habit to start. Test locally, and push to production when you know it's working.
[QUOTE=KmartSqrl;44980401]No you don't. That's a [I]really[/I] bad habit to start. Test locally, and push to production when you know it's working.[/QUOTE] I find it quite useful. I save to a dev server and if it works I push to live. Dev server is exactly the same configuration as live so it helps.
[QUOTE=Miljaker;44980591]I find it quite useful. I save to a dev server and if it works I push to live. Dev server is exactly the same configuration as live so it helps.[/QUOTE] Still a bad habit, IMO. You should be deploying through version control because as soon as you have a second person working on the project the save->auto upload stops being okay. If you're deploying through version control you always know exactly which revision is live at any given time and can easily roll back if you need to, and it really does not take much to get a simple deploy script set up so you can just type "deploy staging" in terminal and have it all handled for you. Deployment should always be automated.
[QUOTE=KmartSqrl;44981229]Still a bad habit, IMO. You should be deploying through version control because as soon as you have a second person working on the project the save->auto upload stops being okay. If you're deploying through version control you always know exactly which revision is live at any given time and can easily roll back if you need to, and it really does not take much to get a simple deploy script set up so you can just type "deploy staging" in terminal and have it all handled for you. Deployment should always be automated.[/QUOTE] When multiple people are working they work on different branches. -Make new branch (on remote dev server) -Do your stuff -if it works merge with master -push master to live I've never had trouble working this way, even with multiple people.
[QUOTE=Miljaker;44981733]When multiple people are working they work on different branches. -Make new branch (on remote dev server) -Do your stuff -if it works merge with master -push master to live I've never had trouble working this way, even with multiple people.[/QUOTE] Sounds a lot like git without the cool features of git. I wonder, how do you merge it? (Or are the people working on different parts like some lego where you can assemble more pieces) As far as I can understand it seems like a lot of work
[QUOTE=gokiyono;44981785]Sounds a lot like git without the cool features of git. I wonder, how do you merge it? (Or are the people working on different parts like some lego where you can assemble more pieces) As far as I can understand it seems like a lot of work[/QUOTE] The linux kernel was developed by passing patches and tarballs around; it's entirely possible to develop software outside of any SCM. I agree that once you use git you will never want to go back, but if it works for him and his team I think its at least reasonable.
[QUOTE=Miljaker;44980591]I find it quite useful. I save to a dev server and if it works I push to live. Dev server is exactly the same configuration as live so it helps.[/QUOTE] if you are doing that just save locally to a [webserver software] stack so that you can test whatever you are doing on localhost, then you can scp or git your changes to the live server
Thanks for your feedback guys! Should I just use git then for version control?
[QUOTE=BeatAlex;44986067]Thanks for your feedback guys! Should I just use git then for version control?[/QUOTE] I don't see a reason why you shouldn't, so yes.
[QUOTE=BeatAlex;44986067]Thanks for your feedback guys! Should I just use git then for version control?[/QUOTE] Git is the most commonplace so yeah, I would go that route.
Question about using git. Is there a way to automate the deployment completely? As in, when I push to the stable branch the live machine will pull the latest code? I know you can do this with web hooks on GitHub (which is what I'm using) but I would rather not set up a web server to host 1 web page. Right now it seems silly to push a bunch of code to the dev branch, merge everything to the stable branch when I'm done, open putty, log into the production/live server, navigate to the directly, and run git pull.
[QUOTE=Banana Lord.;44989343]Question about using git. Is there a way to automate the deployment completely? As in, when I push to the stable branch the live machine will pull the latest code? I know you can do this with web hooks on GitHub (which is what I'm using) but I would rather not set up a web server to host 1 web page. Right now it seems silly to push a bunch of code to the dev branch, merge everything to the stable branch when I'm done, open putty, log into the production/live server, navigate to the directly, and run git pull.[/QUOTE] [url]http://stacksetup.com/Develop/JenkinsGitHub[/url]
[QUOTE=Flapadar;44990142][url]http://stacksetup.com/Develop/JenkinsGitHub[/url][/QUOTE] Sweet, thanks!
[QUOTE=Banana Lord.;44989343]Question about using git. Is there a way to automate the deployment completely? As in, when I push to the stable branch the live machine will pull the latest code? I know you can do this with web hooks on GitHub (which is what I'm using) but I would rather not set up a web server to host 1 web page. Right now it seems silly to push a bunch of code to the dev branch, merge everything to the stable branch when I'm done, open putty, log into the production/live server, navigate to the directly, and run git pull.[/QUOTE] I would use something like Capistrano to automatically ssh to your server and do the git pull thing when you type a "cap deploy". That will also set you up to do any other deploy related stuff you might need to do (restarting app servers, clearing caches, whatever) automatically every tim you deploy.
-snip, I don't think that even qualified as a question.- Database calls are something that can vary a lot between applications. But what about database connections? How many is the norm, and how many do hostings usually allow?
I'm creating a multiple choice question/answer quiz. How should I store the question/answers in MySQL? Right now I'm thinking of having one question per row with the multiple choice answers JSON serialized in a VARCHAR Column. Is there a better way of doing this?
[QUOTE=Poo Monst3r;45006751]I'm creating a multiple choice question/answer quiz. How should I store the question/answers in MySQL? Right now I'm thinking of having one question per row with the multiple choice answers JSON serialized in a VARCHAR Column. Is there a better way of doing this?[/QUOTE] Why not do a table with questions, then a table with answers that reference the question's ID, so you'd do a query like SELECT question, answer FROM Questions INNER JOIN Answers on Questions.ID = Answers.questionID WHERE question = 1 This would return results like This is an example question | This is answer 1 This is an example question | This is answer 2 This is an example question | This is answer 3 If you were echoing it out with PHP, on the first result row you'd echo the question and answer 1, then the subsequent rows you would just echo the answer, so you'd have This is an example question This is answer 1 This is answer 2 This is answer 3
So I've been doing web design stuff for like 2-3 years, and more recently have got work doing web design with ad agency styled companies. But I don't want to do front-end forever, and I really have no idea where to start with the learning how to create the "back-end" for web applications. I know programming languages like C++, Java, Python and Lua. When I look around at non-design web jobs I see things like node.js, rails and php, and I want to make sure my summer now (3 month break before continuing University) goes towards learning something fun that I can mostly reliably put on my CV in a couple of years. So what should I be learning for web applications?
[QUOTE=icemaz;45026650][B]node.js, rails and php[/B][/QUOTE] Basically any of these will get you going, I would say PHP but go with whatever you feel like
[QUOTE=icemaz;45026650]So I've been doing web design stuff for like 2-3 years, and more recently have got work doing web design with ad agency styled companies. But I don't want to do front-end forever, and I really have no idea where to start with the learning how to create the "back-end" for web applications. I know programming languages like C++, Java, Python and Lua. When I look around at non-design web jobs I see things like node.js, rails and php, and I want to make sure my summer now (3 month break before continuing University) goes towards learning something fun that I can mostly reliably put on my CV in a couple of years. So what should I be learning for web applications?[/QUOTE] Ruby is probably your best bet. Node.js takes a bit of getting used to, and PHP isn't a good idea, ever. You can use Codecademy to learn Ruby, and then check out Sinatra to write some simple applications. It's pretty easy.
[QUOTE=supersnail11;45026897]Ruby is probably your best bet. Node.js takes a bit of getting used to, and PHP isn't a good idea, ever. You can use Codecademy to learn Ruby, and then check out Sinatra to write some simple applications. It's pretty easy.[/QUOTE] How can you say PHP is not a good idea if he's wanting to get into backend, he didn't really specify what he wanted to create so why not go with the most popular to begin with?
[QUOTE=Moofy;45029175]How can you say PHP is not a good idea if he's wanting to get into backend, he didn't really specify what he wanted to create so why not go with the most popular to begin with?[/QUOTE] A lot of companies right now are going with ruby and node.js. It's probably best if you want to get somewhere with web development. [editline]7th June 2014[/editline] popular isnt always the best.
[QUOTE=Moofy;45029175]How can you say PHP is not a good idea if he's wanting to get into backend, he didn't really specify what he wanted to create so why not go with the most popular to begin with?[/QUOTE] PHP isn't a good idea for backend, though. It's only still around because it's popular, not because it's a good choice.
[QUOTE=supersnail11;45029259]PHP isn't a good idea for backend, though. It's only still around because it's popular, not because it's a good choice.[/QUOTE] I know I am not saying that "oh we should all stick to this because new stuff is icky" - But might as well learn the most commonly used up front than picking up something like Ruby. As far as I could tell he works front end for clients and wants to go backend, it's more likely to encounter a site that's using PHP and needs some fixing than a site using Ruby for example.
[QUOTE=supersnail11;45029259]PHP isn't a good idea for backend, though. It's only still around because it's popular, not because it's a good choice.[/QUOTE] Would be nice if you explained why?
[QUOTE=djjkxbox360;45029337]Would be nice if you explained why?[/QUOTE] It has some weird rules of how to call functions: underscores or not (strlen vs str_replace, by example), vocals or not (wordwrap vs strpbrk, which admittedly, I had to see what it was about)... Also, you don't need to specify the type of variable you're using (integer,string,boolean...), as it auto-converts them as it's needed (which some people hate because it interfers with some strange code that nobody would really use on day-to-day use). Plus, it keeps running when something goes wrong (unless it's a fuckup big enough to trigger a Fatal error), which some people hate because they'd rather have it halt (while others don't, as to give the user [I]something to see[/I] at least). My opinion? Look at some scripts and see if you can understand it, and compare it against others. If you like it and think you can do wonders with it, go ahead. [editline]7th June 2014[/editline] If you do go with it, don't 'trap' yourself on it. Learn other languages too, as one might be way better for X use than another.
[QUOTE=Moofy;45029304]I know I am not saying that "oh we should all stick to this because new stuff is icky" - But might as well learn the most commonly used up front than picking up something like Ruby. As far as I could tell he works front end for clients and wants to go backend, it's more likely to encounter a site that's using PHP and needs some fixing than a site using Ruby for example.[/QUOTE] Learn the right way first, then go back and learn the popular way. [QUOTE=djjkxbox360;45029337]Would be nice if you explained why?[/QUOTE] Oh, man. You've probably read the "[URL="http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/"]fractal of bad design[/URL]" article, which - though it overstates its terribleness in a few places - does give a good overview. However, here's an outline: • It's slow. Not just because it uses CGI (because you can use FastCGI). It also recompiles the page on every request, instead of caching the bytecode like every sane interpreter. • Your filesystem is the same locally and on the server. No routing or anything (unless you do it yourself). • If you do do routing yourself, you'll have to deal with rewrite rules, which are different for every webserver you use. • Config is defined in php.ini, .htaccess, or at the top of every file. • Errors are sent to the client by default. • Everything is in one global namespace. • Inconsistencies in function naming (htmlentities, html_entity_decode). • Global namespace is polluted with deprecated functions and libraries. • The lovely == isn't really equals problem (yes, Javascript has this too). • A different operator for string concatenation. Strictly, this makes sense (you're concatenating strings, not adding them together), but I'm sure we can all figure that out. • It can't decide if it wants to be OOP or not. The standard library wants to be C, classes and namespaces want to be Java. • Comparing a string to a number will cast the string to a number, if the string starts with a number. • Some functions return a modified version of the argument passed, some modify the arguments in place. That's just a few of them. In addition to "a fractal of bad design," there's a bunch [URL="http://phpsadness.com/"]here[/URL]. Telling people to learn PHP as a first web development language is like telling them to learn VB6 as a first programming language. Sure, it'll work, but it's going to teach them a ton of bad habits.
[QUOTE=Coment;45029579]It has some weird rules of how to call functions: underscores or not (strlen vs str_replace, by example), vocals or not (wordwrap vs strpbrk, which admittedly, I had to see what it was about)... Also, you don't need to specify the type of variable you're using (integer,string,boolean...), as it auto-converts them as it's needed (which some people hate because it interfers with some strange code that nobody would really use on day-to-day use). Plus, it keeps running when something goes wrong (unless it's a fuckup big enough to trigger a Fatal error), which some people hate because they'd rather have it halt (while others don't, as to give the user [I]something to see[/I] at least). My opinion? Look at some scripts and see if you can understand it, and compare it against others. If you like it and think you can do wonders with it, go ahead. [editline]7th June 2014[/editline] If you do go with it, don't 'trap' yourself on it. Learn other languages too, as one might be way better for X use than another.[/QUOTE] Just saying as I use PHP and had no [I]huge[/I] problems with it. I have to admit, I don't like the fact that it continues running when something goes wrong. There are a few languages where you don't have to specify type so just makes my life a bit simpler. I know there's a lot of complaints about being able to do mathematical operations with numbers in strings, but to me this makes sense in terms of web design, because if you want to add two numbers from text boxes, when you retrieve them from the text box they come out as a string, so it's nice to have PHP allow you to still do mathematical operations. I haven't come across a case where this has turned into a problem
Sorry, you need to Log In to post a reply to this thread.