GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Refugees (https://gfy.com/showthread.php?t=1066601)

raymor 05-01-2012 10:30 PM

I really respect people who learn new skills. Learning complex subjects like computer science takes a lot of dedication, so I do respect those who say:

Quote:

Originally Posted by A lot of people
well I only know html, css and php all self taught mind you and I build some cool ass shit! so blah..

Not to pick on anyone in particular, but the number of people saying "all I know is PHP and I've no actual training in computer science, but go ahead and trust your sever to my guesses" is one reason PHP a) has a reputation as a language people write bad software in and b) caters to non-programmers.

It's awesome when people learn a bit of PHP so they can solve simple problems for themselves. It's bad when those people pretend to be qualified software engineers and sell really crappy software for complex systems to others.

V_RocKs 05-02-2012 02:22 AM

People who go to school will always rag on those who don't... Don't hate...

mafia_man 05-02-2012 06:04 AM

Quote:

Originally Posted by brentbacardi (Post 18919902)
Should I learn rails or ruby first? how does that work?

Read through this first:

http://ruby.learncodethehardway.org/book/

raymor 05-02-2012 06:33 AM

Quote:

Originally Posted by V_RocKs (Post 18920182)
People who go to school will always rag on those who don't... Don't hate...

Some extremely capable people didn't have much schooling. Although I have piles of comp sci and security related textbooks around here, my schooling was actually in law, not comp.sci or security. I'm not putting down people without formal schooling.

What I am saying is simply that PHP has allowed a lot of people to do a little scripting and the web and adult in particular doesn't always distinguish between people who picked up some PHP vs qualified software engineers. To design software well, you almost have to have experience with at least one high level language and one low level. To design scalable software, you need to know systems. Database architecture is a science itself, which includes relational algebra and calculus as subcomponents. If you're self taught, cool. I'm largely self taught in that I read the books and I speak with the experts independent of any college class. The books I read include the works of Codd and Date because in order to use relational databases PROFESSIONALLY, you need to understand relational algebra. To design them correctly, you need to know relational calculus. How you learn it doesn't matter, but these things make the difference between a professional and an amateur.

PHP reminds me of Lego. Like PHP, Lego is easy and you can build cool stuff with Lego, without knowing much about mechanical engineering. Just don't confuse a Lego device with a professionally fabricated item.

Why 05-02-2012 09:52 AM

i like how people who know "low level" stuff always try to rip on php coders. how many of the web's largest sites are written in pure C, or Perl, rather then PHP. how many of the most used web apps are written in php? wordpress, drupal, joomla, this forum, nats, flickr... the list is endless, so much of whats on the web most people use all day is in PHP. i believe LAMP is landing more hits a day and servicing more requests then any other stack out there.

PHP is a perfectly fine language as long as you learn to secure it properly and optimize it. I remember a day when Perl was considered easy and lots of people wrote really bad form mailer scripts they picked up on the web somewhere... this led to trillions of unsolicited emails due to poor security. ;)

@raymor, i agree that high end math skills help, when you are writing code for companies like google. most web companies do not require such skills, lets be realistic. as for php having multiple ways to do things... i dont really see that as an issue.

i think these arguments go both ways... its not he bike, its the rider.

to each his own, i like PHP, Perl and shell script, but I believe they all have their own place.

mafia_man 05-02-2012 11:47 AM

Quote:

Originally Posted by Why (Post 18922216)
i like how people who know "low level" stuff always try to rip on php coders. how many of the web's largest sites are written in pure C, or Perl, rather then PHP. how many of the most used web apps are written in php? wordpress, drupal, joomla, this forum, nats, flickr... the list is endless, so much of whats on the web most people use all day is in PHP. i believe LAMP is landing more hits a day and servicing more requests then any other stack out there.

PHP is a perfectly fine language as long as you learn to secure it properly and optimize it. I remember a day when Perl was considered easy and lots of people wrote really bad form mailer scripts they picked up on the web somewhere... this led to trillions of unsolicited emails due to poor security. ;)

@raymor, i agree that high end math skills help, when you are writing code for companies like google. most web companies do not require such skills, lets be realistic. as for php having multiple ways to do things... i dont really see that as an issue.

i think these arguments go both ways... its not he bike, its the rider.

to each his own, i like PHP, Perl and shell script, but I believe they all have their own place.

Quoted for the truth!

There's nothing wrong with PHP (well I'm not a big fan of $ and -> syntax) but there's everything wrong with the programmers who use it.

PHP is far too easy to start using. <?php and ?> in a .php file and through it on a server, run it, that's it.

Django and Rails on the other hand are much harder to use. Sure there are build a blog in 5 mins screencasts, but deploying those in a production environment isn't as simple as uploading the files to the server.

Finally, the internet is polluted with awful PHP tutorials and snippets that allow SQL injection and XSS. Not that you can't do that in Rails and Django.

V_RocKs 05-02-2012 12:34 PM

Quote:

Originally Posted by raymor (Post 18920423)

PHP reminds me of Lego. Like PHP, Lego is easy and you can build cool stuff with Lego, without knowing much about mechanical engineering. Just don't confuse a Lego device with a professionally fabricated item.

Perfect analogy. Put legos into the hands of somebody that understands things on a larger scale and they will build you something truly amazing. Put them into less capable hands and they will build you something that works...

2012 05-02-2012 03:09 PM


Theo 05-02-2012 03:13 PM

Quote:

Originally Posted by Why (Post 18922216)
i like how people who know "low level" stuff always try to rip on php coders. how many of the web's largest sites are written in pure C, or Perl, rather then PHP. how many of the most used web apps are written in php? wordpress, drupal, joomla, this forum, nats, flickr... the list is endless, so much of whats on the web most people use all day is in PHP. i believe LAMP is landing more hits a day and servicing more requests then any other stack out there.

so true, PHP took over

raymor 05-02-2012 03:32 PM

Quote:

Originally Posted by Why (Post 18922216)
i like how people who know "low level" stuff always try to rip on php coders. how many of the web's largest sites are written in pure C, or Perl, rather then PHP. how many of the most used web apps are written in php? wordpress, drupal, joomla, this forum, nats, flickr... the list is endless, so much of whats on the web most people use all day is in PHP. i believe LAMP is landing more hits a day and servicing more requests then any other stack out there.

PHP is a perfectly fine language as long as you learn to secure it properly and optimize it. I remember a day when Perl was considered easy and lots of people wrote really bad form mailer scripts they picked up on the web somewhere... this led to trillions of unsolicited emails due to poor security. ;)

@raymor, i agree that high end math skills help, when you are writing code for companies like google. most web companies do not require such skills, lets be realistic. as for php having multiple ways to do things... i dont really see that as an issue.

i think these arguments go both ways... its not he bike, its the rider.

to each his own, i like PHP, Perl and shell script, but I believe they all have their own place.


As far as low level versus high level, I said a professional programer should know at least one high level language and one low level. The big sites that use PHP use PHP written by programmers who understand what it's doing at a low level. That is, they could translate the PHP to C, they picture what the C or assembler would look like, and therefore know WHY some algorithms are good and others bad. For example, I have a function in a very high level language - a rewrite rule in .htaccess. I know that rule only calls the stat() system call, and I know what stat() does in assembly, so I know it's fast. I write efficient .htaccess by understanding how that's translated to assembler. If I had no experience in C or assembler, my .htaccess wouldn't be nearly as efficient.

Regarding high level math, a relational database management system such as MySQL is a calculator for doing relational algebra. That's all MySQL is - a calculator. If you have no understanding of what relational algebra is, you won't be very good at doing relational algebra using MySQL. How many PHP scripters don't know that MySQL in a RDMS? If you don't even know what it IS, how well are you going to design schemas for it? Not well at all, obviously. MySQL is a tool for managing relational databases, but many scripts create things in MySQL that are not in fact re relational databases, so the scripts suck and break in various ways. Trying to design a MySQL database without knowing what a relational database IS is like designing a CMS without knowing what a web site is.

u-Bob 05-02-2012 03:38 PM

50 ways to do things in perl :)

brentbacardi 05-02-2012 08:16 PM

No offence but a lot of coders do have sticks stuck so far up their ass. Just because code may be sloppy as fuck and far from elegant doesn't mean it sucks! The person on the front end would never know the difference, so for people running their own sites, its not such a big deal as long as it makes sense to them. Yet I have spoke with a few programmers who are like "Oh its sloppy, you suck balls"... doesn't matter if it does something really fucking cool or not.

That being said it is better to be efficient and neat etc for many reasons but jeez... just sayin.

2012 05-02-2012 08:18 PM

http://30.media.tumblr.com/tumblr_m3...ntmlo1_500.jpg

Paul 05-02-2012 08:42 PM

Bookmarked

brentbacardi 05-02-2012 08:47 PM

Yes! Exactly like that! lol :1orglaugh

raymor 05-02-2012 11:16 PM

Quote:

Originally Posted by brentbacardi (Post 18925235)
Just because code may be sloppy as fuck and far from elegant doesn't mean it sucks!

Very well put. Wrong 90% of the time, but very well phrased. Reminds me of a certain president. :) Well, wrong 50% of the time - only for publicly accessible web sites or code used more than once. Seriously, sloppy normally means you can't be sure what the code will do in edge cases. What if that list you're working on happens to be empty? Sloppy, far from elegant code will probably break on an empty list. (Ex. code to modify a password file that happens to be empty because it's a new site, or code to find the middle of a file that happens to be empty.)

Further, show me any sloppy code that isn't vulnerable to an evil null attack. Sloppy coders probably don't know what an evil null attack is, and therefore don't know they've just allowed the bad guys control of the server. It may well be fine for you own personal one-time use. Half the code I write is like that - use once and throw away. That's a very different standard from creating a professional product that's on a public web site exposed to the hackers' bots.

mafia_man 05-03-2012 07:08 AM

Quote:

Originally Posted by brentbacardi (Post 18925235)
No offence but a lot of coders do have sticks stuck so far up their ass. Just because code may be sloppy as fuck and far from elegant doesn't mean it sucks! The person on the front end would never know the difference, so for people running their own sites, its not such a big deal as long as it makes sense to them. Yet I have spoke with a few programmers who are like "Oh its sloppy, you suck balls"... doesn't matter if it does something really fucking cool or not.

That being said it is better to be efficient and neat etc for many reasons but jeez... just sayin.

Time, Money, Good Code. Choose 2.

The only excuse for sloppy code is if there's not time and money to create good code.

I was talking to a guy that was creating a program in COBOL for some university project. He told me he was copying and pasting code instead of creating functions because it was easier than figuring out parameters and return values.

He's an engineer not a dev but he didn't seem to understand why his compile time was rising exponentially.

Jakez 05-03-2012 09:07 AM

I guess PHP is kinda like the Model T of programming. Made it easy and accessible to the masses.

Quote:

Originally Posted by raymor (Post 18925435)
What if that list you're working on happens to be empty? Sloppy, far from elegant code will probably break on an empty list. (Ex. code to modify a password file that happens to be empty because it's a new site, or code to find the middle of a file that happens to be empty.)

If it's going to be a product then yeah you should have all that kind of checking, otherwise what is the point of checking if say a MySQL database of referrers is empty when the only time it was and ever will be empty was when it was first created?

uniquemkt 05-03-2012 09:56 AM

Don't blame the language. Among other things, I'm a Zend certified PHP developer, and the ubiquitousness off the LAMP stack means I can write code and expect it to run almost anywhere with minimal fuss. I can run a high performance Development environment on my Netbook, try doing that with Weblogic... PHP had a shitty start, but obviously there was a need for it at the time, or it wouldn't have taken off the way it did and become so pervasive. These days its a grown-up language with grown-up features, many of which you can choose to not use.

Seems like its fashionable to rag on PHP for allowing non-programmers to write code. Why can't we go back to hating Perl for being a write-only language?

maylow 09-10-2012 09:21 AM

A lifetime PHP wrangler, I hate the language. RoR (Ruby On Rails) is the best choice you can ever make if you want to keep your sanity.

newb102k 09-10-2012 06:15 PM

i really want to learn what i can use for my client and business

but now im decided most of my client used php backend and this also what i want to provide for my web apps development and maybe used my cousin skills in c# and .net for desktop and web

livexxx 09-10-2012 07:04 PM

PHP & Symfony , although MVC might be outside of most peoples range IMHO. Scrum for the team as well with a bit of Kanban if they like. Still not 100% sold on Propel ORM but everything seems good so far.

edgeprod 09-10-2012 07:41 PM

Quote:

Originally Posted by brentbacardi (Post 18925235)
No offence but a lot of coders do have sticks stuck so far up their ass. Just because code may be sloppy as fuck and far from elegant doesn't mean it sucks!

You're narrowly right, and widely wrong. When I'm doing rapid prototying (typically, with a client in an ICQ window waiting to see, or otherwise interactively), I only bother to indent. And I probably only indent because NOT doing so would take my brain LONGER at this point.

Once something moves beyond the prototype stage, however -- for example, if it even thinks about touching a production environment -- you'd better believe that it's done in Model/View/Controller style, and it's done right. Anything else would not only be irresponsible, it'd be borderline fraud when it comes to "work for hire," or anything you'd be selling.

I've committed the sin of sloppiness earlier in my career, but not learning from it would speak more about me as a person than me as a coder.

I think the "stick up the ass" grows over time, and is the result of people saying "close enough is good enough" and then guys like raymor, isteve, and myself having to clean up after them. It just grates on you after enough time.

It's actually to the point where if someone documents their code excessively, I look at them as a novice. See the "sample of my code" example on my blog for a great illustration of too much documentation, and sloppy code. It was written years ago, and I've evolved as a professional and as a programmer in the interim.

I'll give you an example: I'm working on some software right now to retrieve entries from a database. On the index page, I only need 8 pieces of data, so I query that specific data. The programmers we look down our noses at (or, I guess, get sticks up our butt about) will typically suck down all of the data, parse it in PHP, and spit out what they need to the page. Not only is this wasteful, sloppy, and a potential security risk, but it doesn't handle scale (read: additional traffic), and can actually bog down everything else that shares the MySQL server.

Another example ... inside of a search for a single data point, this is my query:

Code:

$this->set('models', $this->Vehicle->find('all', array('conditions' => array('make' => $value),
                                                      'fields' => array('DISTINCT (model)'))));

All I'm returning to the $models[] array is the distinct column names for 'model' where 'make' matches the $value I have passed to the method. In PHP's "amateur-hour-friendly" structure, I could have just as easily queried ALL of the data, then grabbed ALL of the values for 'model', then used PHP to sort by 'make' key, and finally grabbed the array_unique() of the resulting array.

Instead, I'm using a very narrow query to populate an array with ONLY what I need. Then, after checking if the array exists, I can build a search field with HTML form options that includes a list of the various models.

When I'm finished with it, the query will also include an 'order' parameter to return the results in alphabetical order, instead of using asort(), or a similar language-level sort. This is what separates those of us that SHOULD be doing your projects from the bargain-basement "code hackers" who put in penny-wise pound-foolish bids on jobs. :2 cents:

Sorry for the rant, but I wanted to make sure you understood, and that you weren't misleading people into thinking that sloppy is somehow "okay" because the end user doesn't "see" the code. That's like saying your mechanic can do a shitty job on your breaks because you don't ever have to look at them.

Great thread, Brujah. :thumbsup To answer YOUR question: Python (duh!), Ruby, Ruby on Rails, and I've extended the life of PHP somewhat by moving to the CakePHP framework for development (it makes it a lot like Rails for me).

edgeprod 09-10-2012 08:32 PM

My final (git commit'd) query:

Code:

$this->set('models', $this->Vehicle->find('all', array('conditions' => array('make' => $value),
                                                      'fields' => array('DISTINCT (model)'),
                                                'order' => array('model' => 'ASC'))));

Ready to be loop'd into the iteration now, without having to have spaghetti PHP running around. Nothing to document in the code now, either, because the query is clear and when I reference it, it's just:

Code:

$models[$i]['Vehicle']['model'];
The need to "document" the method in the controller or its use in the view is now null, and should be non-documented. Its usage is now obvious.

pornmasta 09-10-2012 10:14 PM

url of this thread: https://gfy.com/showthread.php?t=1066601

edgeprod 09-10-2012 10:25 PM

Quote:

Originally Posted by pornmasta (Post 19181732)

Grin, I noticed that, too. :thumbsup

adult-help 09-10-2012 11:23 PM

php and jquery - all i need.

grumpy 09-11-2012 02:05 AM

usage of php
http://w3techs.com/technologies/hist...mming_language

78% of websites use php, 0,2 and 0.5% ruby / python
Case closed.

seeme 09-11-2012 02:57 AM

Personal choice is PHP, its easy to pick up and has plenty of support. If I was to learn another, I would look at Python.

mafia_man 09-11-2012 09:48 AM

Quote:

Originally Posted by grumpy (Post 19181922)
usage of php
http://w3techs.com/technologies/hist...mming_language

78% of websites use php, 0,2 and 0.5% ruby / python
Case closed.

Yes if you are writing a commercial script use PHP.

teg0 09-12-2012 08:49 AM

Still do a lot of PHP work and like Codeigniter, but starting the switch to Python / Django


All times are GMT -7. The time now is 10:44 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123