Everything posted by palko
-
PHP devs stop doing things bad!
I agree with you to a point. Unfortunately I only registered today, so for some reason this is the last post I'm able to make until tomorrow...
-
PHP devs stop doing things bad!
I agree that you can over engineer things, but it's also the case that you should put some thought into what you're doing and you should plan for the future as best you can. Not to the point that you cripple yourself and don't get anything done, but certainly a few design principles can go a long way. If you code to abstractions and interfaces, your code is much more likely to be easy to extend in the future. I've found this through personal experience.
-
GitHub/Local development
Except he was arguing that dropbox is actually better than git (he was saying stuff like "what if you forget to do a commit" as an example of why it's actually better). This argument is going nowhere anyway. Using dropbox for this purpose is just silly when something like git exists. I can't believe I'm even having to make this point, and then actually have to defend it afterwards.
-
GitHub/Local development
I'm a lead developer for a company called Electronic Arts. You've probably heard of them.
-
PHP devs stop doing things bad!
Most of the people on this forum do lack coding ability. I know because I've had a good read through. I don't have a problem with people who are learning (I still consider myself a learner in a lot of ways). What I really don't like is when you get people who bring up legitimate criticism or good ideas who are then flamed by a load of people who simply don't really understand what they're saying. PHP has a well deserved reputation for terrible practices and awful code. After years of inheriting crap php code I have a much shorter tolerance for people who don't want to improve and make things better. If I write some code and you look at it and can show me a way to genuinely improve it, I'd love that. I'd respond really well to that. This thread though was a good example of why PHP has the reputation it does to me. The OP brought up some very strong points and was correct in everything he said, and yet he got battered down by a bunch of amateurs who don't know any better. This is why I'm planning to move on to a different language soon. I'm considering rails - not because rails is necessarily a better language, but just because the community is full of people who understand the virtues of things like unit testing. Unit testing has improved my code massively over the past year or two, yet whenever I start talking about it amongst php folk, I prepare myself for the same old flawed arguments about how "we don't have time for that" and how it's "overkill" or whatever. I just wish the guys in charge of php would take a bold step and rip out a bunch of the old crap like all the mysql_ functions - if I had my way, updating to the newest versions would just break old scripts, which would force maintainers of old scripts to either update their code or just not update to the latest versions of php. A lot of good work has been done by people like the Zend and Symfony guys, and many others. But even then, when you start talking about frameworks, within the php community you'll still get people who write crappy code yet attack people who use frameworks for being "mickey mouse" programmers - it's the other way round of course. I guess I'm just tired of years of dealing with people who don't want to push themselves forward in any way. The arguments in this very thread had me shaking my head constantly.
-
GitHub/Local development
The guy started the thread by asking whether he should use github or something else, and was advised to use dropbox, which is a really poor solution. I then pointed out that not only does git/github provide the answer to his original issue, but it gives him all these extra options, and from there I've been told that no, apparently, dropbox is better... Did YOU read the thread? *Edit: my arguments are not stupid. I'm sorry you're incapable of reading a few simple posts - the end result is this: he was advised to use dropbox for the very thing that git should be used for - so for THAT reason I pointed out how git is a far superior option and why dropbox shouldn't be used this way. I AGREE that they are very different tools, which is why dropbox should NEVER be used for this purpose. That was my whole point. You are actually agreeing with me while calling me stupid - you dumbass.
-
GitHub/Local development
I did. What is your point?
- How do I update my online mysql with my local mysql data
-
GitHub/Local development
One more great resource: http://git-scm.com/book/en/Getting-Started-About-Version-Control
-
GitHub/Local development
Good stuff. I'm not gonna post much more in here now. What I would say though, is if you have a little bit of time, have a go through this tutorial and it'll show you the ropes: http://learn.github.com/p/intro.html Sorry for the flamewar - just one of those things. Have a look at that tutorial and good luck
-
GitHub/Local development
I don't get "aroused" by it - I just know it's the right tool for the job. It's by far and away better than dropbox in every single way for software development, and it's in no way a complicated thing to understand for basic usage. The problem with places like this is that amateur hackers like you think their hacky methods of development are just as valid as tools used by professionals. The solution to the guy's problem is to us a proper tool like git, not to use your hacky method. Anyone in their right mind can see that. I get really irritated by people like you - people who are not particularly good at something, but who are so confident in their ability that they actually argue for their inferior methods over blatantly superior ones. There's not really a debate to be had, and I'm wasting my time here. It's a bit like trying to argue basic maths with someone who believes that 1 + 1 = 10.
-
GitHub/Local development
This is a dumb argument now and I can't really be bothered with it. You're wrong and your arguments are facile and daft. I can't be arsed with it any more. Just some of the reasons as to why git is superior to a hacky and tacky solution like dropbox are here for all to see in this forum. If people want a dirty solution they can use your method. If they want to take advantage of some of the most powerful software for version control and syncing that exists on the planet, they can go with what I said.
-
GitHub/Local development
I've been using git and mercurial for years, and I don't think I've ever seen this happen. It's just a part of your daily workflow and becomes natural. And I don't see your point - if you made the above mistake in dropbox, the solution is the same as fixing it in git - I don't even see your point. Here's a direct question to you personally - do you actually not use version control for your own projects??
-
GitHub/Local development
But my point is this: Who wouldn't want to be able to do all the things git can do? Who wouldn't want to be able to go back in time and have a history of the project? My point is that git provides the solution to the original problem AND offers all of these frankly essential features, so therefore it's better. If we're giving advice to someone about how to sync his files, we should offer the best possible solution, git/mercurial are the best solutions to this problem. And talking about what happens if you forget to commit and push is silly - you're just talking about human error there. I could say "what if you setup dropbox incorrectly and accidently copied the files to your local machine, did all your work on them and then found they hadn't synced?". If you make a human error it's just a human error.
-
GitHub/Local development
From what you've said, it sounds like you're not very experienced with version control. If you forget to push your changes then that's your fault. This isn't something that should happen often though, because commits and pushes just become part of your normal flow. In terms of commiting things that are incomplete - well yeah, I do this all the time. Most of my commits represent works in progress. It might take me 200 commits to finish a working module, and there's nothing wrong with that. What's the issue here? In terms of not having ssh access (which to be fair, I'm used to - I've not used a control panel in 4/5 years now), I know there are ways around this actually. There are ftp plugins for git. I personally think using ftp is dirty and tacky, but if you absolutely have to, there's stuff like this: https://github.com/resmo/git-ftp At least that will stop you from having to remember what you changed. It's not ideal, but it's still a lot better than having to track stuff or upload everything each time. I just can't fathom why anyone would want to work without version control - and worse, actually argue that this is better! It's not better. If something breaks, I can revert instantly. I can revert back to my code last tuesday if I want. I can even pull out individual files from last tuesday and merge them back into the project today, without reverting anything else. I can see a line by line changeset of each that changed. I can work with other people, even on the same file at the same time, and it will STILL work. I can do bug fixes to the live site while working on different modules in parallel, and all of this I can do because I took the time out to learn a proper tool. The OP will see the benefit of using proper version control the first time he messes something up and can't quite figure out the issue. Using git - no panic, revert back to a working version and stick that back on the live site, then go through your changes and figure out what went wrong. Writing code without version control is like skydiving without a parachute. Effectively, you're hurtling to the ground at a hundred miles an hour with a tissue instead of a parachute, and all the while you're laughing at me for using a parachute :-)
-
GitHub/Local development
Dropbox is a great tool for syncing things like word documents and pdf files, images and music and stuff like that. Not for programming projects. And saying "but the OP doesn't want version control" is silly. Everyone should use version control and should be encouraged to use version control. Give me one good reason why you wouldn't want to use version control in a project? Of course he should be encouraged to use version control. This is why I'm saying your argument is lazyness - so what if you have to commit each time? It makes sense to have to commit, because you might consider a bunch of related changes to be a single commit - this makes sense. We're talking about two commands here btw - commit and push, that's all. It takes like 10 seconds to do, so you're really not saving any time at all. Any time you save (which will be literally just seconds anyway) will be instantly lost when you need to revert changes or when you come to deploy. For the third time I'll mention deployment, because you've ignored it twice already - what speed benefit do you get if you've made changes over the course of say a couple of weeks to say 50 files - what, you then have to remember each individual file and upload them one at a time? Or do you seriously just upload every single file to your live site each time you want to do an update? Using git/mercurial, I can update my site in seconds - even if I'm updating it with changes to 50 files made over 2 weeks. And saying he doesn't want version control is silly. Of course everyone wants version control - he just needs to understand what massive benefits it will give to him. Honestly, give me ONE reason as to why you wouldn't want to use version control in a project? Git provides the best solution from every angle. *Edit: And something I should have mentioned - you don't have to commit each time you make a save to a file or anything like that. You do a commit whenever you want to take a 'snapshot' of your current project. So you can work all day if you want and only do a single commit. Personally, I tend to commit fairly often, so in a single day I may have 10-15 commits, depending on what I'm doing.
-
GitHub/Local development
No, sorry. You should realise that offering half baked solutions to problems that have already been brilliantly solved is not good form. There is no benefit to using dropbox over git other than sheer lazyness. That's literally the only benefit. Git solves the original problem + adds a complete version control system that the original poster will come to rely on very quickly. The capacity to be able to turn back revisions and have a full history of all changes + being able to branch and merge is invaluable, will work on any project no matter the language, and will also put you in good stead for most professional enviroments (because git/mercurial are pretty much the industry standards these days). You didn't even get to my point about deployment. Any supposed benefit you get from the drag and drop functionality of dropbox (which isn't really an advantage at all btw) is lost completely when you've done changes to 30 files and have to remember each one individually when you go to deploy the update. What do I do to update? Login to the server and type two commands (I can do it in one command if I just want to go live with the update straight away) - this will work out all of the 30 files changed and sync them all. I don't have to remember anything. Sorry, no. Dropbox is inferior to using real version control. Dropbox is a great tool, but it's not designed for this purpose, and the moment you start using proper tools you see why. To the original poster: if you'd like to learn some of the basics of git (it's well worth your time as you'll be able to use this tool in every project you make from now on), check out the helpful tutorial on github (remember github and git are not the same thing - you can use git without github if you want): http://learn.github.com/p/intro.html
-
GitHub/Local development
The fact is that git solves the original poster's problems AND provides a tonne of extra features, some of which are invaluable. I can't comprehend how anybody can work on a programming project in the year 2013 without using version control. Number one thing I do when I start any project is create a repo. It's literally the very first thing you should be doing on every project, with no exceptions.
-
GitHub/Local development
Using git is in NO WAY complex. The only vague complexity would stem from having never used it before. Once you know how to use it, it's EASY to use and takes seconds to implement on any project. What I have said is absolutely accurate - dropbox is inferior to using proper version control like git in every single way. Show me a SINGLE advantage to using dropbox over git for this purpose? I stated a bunch of reasons as to why git is better above. Here's another one - deployment. Using your method, I take it in order to update your site you ftp (ugh) from dropbox and have to remember each file that has been changed for each update, yeah? Using git, I can type one command and update everything instantly on my server. I can revert changes if something went wrong directly on the server in a flash again. I have a FULL history of everything that changed. Something broke? Ok, go back and see what you did. You want to know how a single file has changed over time, no problem. Want to have someone else join your project but don't know whether their code will work? Not a problem - give them a repo and try out their changes as they push them. If they don't work you can scrap them - if they do, then great. There is literally no reason at all to use dropbox over git for this purpose. I bet you can't give me a single advantage. Saying "it's easier" is not true at all - once you understand the concepts behind git, it's absolutely simple to use. You're just lazy and you're giving terrible advice.
-
GitHub/Local development
You are offering a demonstrably inferior solution to a problem that has already been solved. Even just for syncing between two machines, git is better than dropbox. Dropbox is not designed for handling code projects. GIt does everything dropbox can do for this purpose, but then does 100 times better. Your solution is awful and he should disregard it. Don't be so lazy and figure out how to use git.
-
Help with uploading new website!
You shouldn't really be using ftp to deploy websites. There are far better ways. If you're just starting out then fair enough, but ideally you should be doing someting like this: http://net.tutsplus.com/articles/from-ftp-to-git-a-deployment-story/
-
PHP devs stop doing things bad!
It depends on what you mean by compexity. For example, if I asked you why a systems engineer might use interfaces and abstract classes to design a system, you would probably say that was "complicated" and "overkill", when in reality it's essential in semi-complex systems to ensure the scalability of a system over the long term. What you are saying makes sense on a surface value only - at first glance "just do the simple thing" seems to make a lot of sense. The problem is that the reality of this in the PHP world tends to mean "hack it until it works and then job done", which ultimately leads to messy code that breaks easily, can't adapt to change and actually causes countless lost hours in maintenence. Using well designed OOP code backed up by unit tests will give you a much more stable system that, when well done, can adapt to change and can GUARANTEE that changes to one thing will never break changes to another. Most php code is horrible, and the "just get it working" mentality is largely to blame for this. Put it this way - I'm a lead developer in the company I work for, and if you worked for us and submitted code that produced the expected output on the screen but was poorly written under the surface, I would consider the code NOT complete and make you re-write it until it was better.
-
PHP devs stop doing things bad!
I agree with literally everything you've said in this thread. Most php code is awful amateur garbage, and I see lots of it in places like this. I've had a good look through these forums, and you can see why such crap code gets written on such a regular basis. The fact that so many people in here argued against OOP shows their real ignorance and lack of ability. It's the attitude that bothers me more than anything. PHP is one of the few languages where you have to really argue with people on a regular basis about the profound benefits of using things like unit testing and oop. Most other languages have communities well beyond this stage. It's also STILL perfectly normal to see the mysql_ functions used widely in places like this, and html/php/sql all stuck together in horrible spaghetti code fashion. What gets to me is that people barely point out these issues, and when they do, instead of being respected for giving valuable advice, this community of amateurs tends to respond by criticising the legitimate criticism. I just had a look through these forums and found a debate on which was better: dreamweaver or notepad++ (with nobody pointing out they are both terrible solutions), and then found a guy asking for advice on git who was told (and convinced) to use dropbox instead of git. You are right and the rest of the people in here arguing against you are wrong. At least take solace from the fact that you're not as lazy and negative as they are.
-
GitHub/Local development
The advice you have received here is atrocious. Using dropbox for version control/code syncing is absolutely stupid when git/mercurial are FAR superior options. Look at some of the stuff you can't do with dropbox, that is integral to git: Can you revert to previous versions of your code? Yes with git, no with dropbox Can you sync your work with other people easily, in a way that will ensure your changes do not conflict with other peoples changes? Yes with git, no with dropbox Can you see a full history of every commit, seeing on a line per line basis what changed, who it was changed by any when it was changed? Yes with git, no with dropbox. Can you branch your code to work on seperate features or bugfixes and then easily merge your branch into your main development branch with minimul fuss? Yes with git, no with dropbox Here's another scenario: let's say you're working on a web application. Say your last update to the live site whent live a month ago. Since then, you've been working on a new feature, but your code isn't quite ready for production yet. Suddenly, your boss comes in and asks you to put that work on hold and to add a new report to the site. The problem is that the code you've been working on is half finished, and if you want to update the reports, it'll involve uploading this new, unfinished code to the live site. So what do you do? The wrong answer is to hack it so that you're hiding changes by commenting out hundreds of lines of code and stuff like that - the correct solution is this: Update your local repo to the last version of your code that has gone live. Create a new branch at this point in your code Create the new report your boss wants (this will mean ALL of your other changes over the last month are not in this branch, but the new report is) Send the update to the live server and update the live application - this will mean your boss gets his new report, and NONE of your new, half finished features will appear anywhere Then merge this branch with your development branch with all your extra work This will mean your development branch now has the new reports + all your extra work Continue working on the extra stuff until it's done. When this goes live, it will have all your new features + the new reports Try doing that in dropbox. You can't. Dropbox is a ridiculous solution to this problem when something like git exists. Learn git and don't use dropbox for anything like this at all.