|
Hi I'm studying enginerring right now, learnt some Matlab and C and it's by far my best subject where I can understand everything really quickly, faster than the best student who's amazes me at when he nods during other lectures while all of us were blank. And of course, the relationship between my results and my effort put in was really makes me feel good. Not to brag but the other Engineering stuff (maths) is just so much harder for me.
Now that I'm thinking of learning web programming by myself (right thing to do for setting up a website?), I was thinking about learning Python since it looks similar to Matlab, which I like for having less bullshit, I've read a blog about Python vs PHP and it seems to be a better choice to learn PHP.
Can anyone help me? What do you think is the better language to learn?
Thanks.
   
|
Blazinghand
United States25550 Posts
PHP and Python serve different purposes. Both are interpreted languages, which is nice, but Python is typically used to write scripts and the like that aren't part of a webpage proper. PHP, on the other hand, is definitely used for web programming and design. I'm personally a huge fan of Python-- I love programming in it-- but PHP is where it's at in web development.
|
It really depends on what you want your website to do. For a basic information site, you may not even need PHP, just HTML and possibly CSS if you want to pretty it up. At the very least, you just need some HTML to make a basic website, or a program that has a designer UI to avoid coding all together. If you're wanting to do some more advanced things like processing forms, creating a user system, etc, I would recommend PHP as it's IMO the fastest/easiest to pick up compared to your other options (java, asp.net, etc).
This is all assuming you don't want to become a full time web developer, and just want to make your own site this one time, which is what I got from your post.
|
You want to learn html, css and javascript (especially the jQuery library once you get proficient in the basics) first, because that's how you build a website. PHP, Python, Java, Ruby, C++, C etc. are used at the webserver to dynamically create the Information fed to the browser via html, javascript and css and only needed once you have more complex site with say a database and dynamic content.
You HAVE to at least learn HTML to do any website work at all (fear not, it takes like 10 minutes) and if you want your site to look pretty, you will need css too. If you then want animations and other fancy interactivity, you have to learn javascript.
Only once you know that stuff you can get into PHP and similar languages. I would not recommend python, because AFAIK it's not really tailored to this stuff (although certainly used for it). If you want to stick to a C-like language, you can learn Java with JSPs, which works similar to PHP, but the programming stuff is done in Java. It's a bit harder to learn than PHP, but then again, probably everything is.
|
Matlab and C (both beautiful languages) have nothing in common with web programming. Do you want to learn web programming because you think of it as a future career choice, or just because you want to get a website up for personal purposes ?
|
Knowing hot to program and C will make it easier to learn PHP.
PHP is really nice and easy.... but you must also learn some Javascript and some ajax.... and you are set to go....
Also don't forget about CSS (web design) and you will learn the complete package
|
Web programming involves a lot of moving parts, you can't really avoid it. You should consider the complexity of what you're making before deciding on the language / framework. For sure you will need to know HTML, CSS, Javascript regardless of what is going on in the back-end. If you want dynamic content pushed to the website and have persistent data you will need to consider how to hook together your entire technology stack. You'll also have to deal with other things like getting a server, hosting, dns.
|
On July 12 2012 04:11 Apom wrote: Matlab and C (both beautiful languages) have nothing in common with web programming. Do you want to learn web programming because you think of it as a future career choice, or just because you want to get a website up for personal purposes ?
Sorry for not clarifying to everyone.
Maybe as a career but mostly to be able to put something to work if I suddenly have a $1000000000 idea, you never know :D
So what I'm getting is that I'll need to learn quite a number of languages?
|
If you like the C syntax i would recommend checking out C# with ASP.NET.
|
I would recommend against learning PHP. While it might very well be a big standard in web development right now, it's just... crap compared to more complex solutions such as ASP.Net, Ruby On Rails, Django etc. It's in no way useless, but if you're a programmer, you'll probably appreciate the web application solutions. If you're into Python, learn python and use django, and you won't have to care about PHP at all.
I work fulltime in web development, I never touch PHP.
|
On July 12 2012 03:38 MaGariShun wrote: You want to learn html, css and javascript (especially the jQuery library once you get proficient in the basics) first, because that's how you build a website. PHP, Python, Java, Ruby, C++, C etc. are used at the webserver to dynamically create the Information fed to the browser via html, javascript and css and only needed once you have more complex site with say a database and dynamic content.
You HAVE to at least learn HTML to do any website work at all (fear not, it takes like 10 minutes) and if you want your site to look pretty, you will need css too. If you then want animations and other fancy interactivity, you have to learn javascript.
Only once you know that stuff you can get into PHP and similar languages. I would not recommend python, because AFAIK it's not really tailored to this stuff (although certainly used for it). If you want to stick to a C-like language, you can learn Java with JSPs, which works similar to PHP, but the programming stuff is done in Java. It's a bit harder to learn than PHP, but then again, probably everything is.
This, but probably would recommend using node.js so you can learn the design challenges of building both a client and a server without having to learn an extra language. Once you feel comfortable building out this sort of stuff you can easily pick up PHP, Java, Ruby, etc.
|
Ah ya totally forgot about Java
I already learnt some HTML while I was trying to tweak my blog from a long time ago. However I don't think people actually program from HTML right? Don't people use something like frontpage? (CSS looks very similar to HTML from skimming wikipedia)
|
CSS and HTML are completely different, but both can do a lot of the same stuff due to various reasons. HTML is supposed to define your content. CSS is supposed to make it look pretty.
|
Html is just a mark-up language not programming. Css is similarly just styling Html elements. I wouldn't recommend node.js if you want to avoid moving parts.
|
thanks everyone for making stuff clear. Keep it coming please, going to sleep now.
|
Hyrule19001 Posts
PHP is a shitbag and is quirky and annoying. I use it every day.
Python is cool and all, but not really quite suited for web development.
PHP has the advantage of being used just about everywhere; Python isn't as universal.
IMO it's worth it to learn both eventually, but if you want to do websites specifically, PHP.
Regardless which of the two you pick, you will need to learn HTML, CSS, and JavaScript
|
All of this discussion is moot unless you have a clear understanding of what it is you're developing. Which language you use to build it is mostly trivial and the decision should be made in response to your requirements. It would be fair to use multiple scripting and programming languages for any given project, and an entirely different set for another.
One option is to look at Perl. It's old, essentially the grandfather of newer languages like PHP, Python, or JavaScript. It's unforgiving and difficult, but in understanding it you pick up a lot of concepts about memory structures and execution which you can apply to other languages you encounter.
And if you are serious about developing web applications I'd also look at understanding some web and application servers. Apache Web Server and Apache Tomcat are free options and are actually used for a lot of commercial applications.
|
On July 12 2012 04:11 Apom wrote: Matlab and C (both beautiful languages) have nothing in common with web programming. Do you want to learn web programming because you think of it as a future career choice, or just because you want to get a website up for personal purposes ? For speed critical web code you will likely want to code it in C.
|
On July 12 2012 04:47 JieXian wrote:Show nested quote +On July 12 2012 04:11 Apom wrote: Matlab and C (both beautiful languages) have nothing in common with web programming. Do you want to learn web programming because you think of it as a future career choice, or just because you want to get a website up for personal purposes ? Sorry for not clarifying to everyone. Maybe as a career but mostly to be able to put something to work if I suddenly have a $1000000000 idea, you never know :D So what I'm getting is that I'll need to learn quite a number of languages?
I feel like everyone's making this way too complicated.
Just learn HTML or an HTML designer program (frontpage, dreamweaver, etc). If you want to truly understand webpage layout, skip the designer and learn HTML.
That's all you need for a basic website and isn't daunting at all. You don't need to learn a bunch of different languages to get up and running and figure out if it's something you're interested in.
After that it's up to how deep you want to go. You can learn CSS to make it pretty, or javascript to add extra UI functionality. You could learn a javascript library like jQuery to make life easier, or one of the other many options. Then if you want to have a backend element for processing things (storing data, making your website dynamic, etc), you pick up a backend language like PHP, Java, C#, etc. You can research the pros and cons of each and determine which backend language you want to learn first. If it becomes a career, you may end up learning them all, or you may not, depending on your company's needs, but learning new languages becomes easier the more you do it.
Everything is quite separate, so it's not like you have to learn javascript before PHP, or visa versa. You also may not have to learn one or the other depending on what you want to accomplish. I would suggest starting with HTML and start picking stuff up as needed to accomplish different ideas you have. Mess with some already written javascript and get some hello worlds going in different backend languages. A little here and a little there. If you choose to make it a career, that's when you settle down and really learn the ins and outs of specific languages.
|
On July 12 2012 05:40 DRTnOOber wrote: All of this discussion is moot unless you have a clear understanding of what it is you're developing. Which language you use to build it is mostly trivial and the decision should be made in response to your requirements. It would be fair to use multiple scripting and programming languages for any given project, and an entirely different set for another.
One option is to look at Perl. It's old, essentially the grandfather of newer languages like PHP, Python, or JavaScript. It's unforgiving and difficult, but in understanding it you pick up a lot of concepts about memory structures and execution which you can apply to other languages you encounter.
And if you are serious about developing web applications I'd also look at understanding some web and application servers. Apache Web Server and Apache Tomcat are free options and are actually used for a lot of commercial applications.
The truth is before this blog I didn't even know what to know and I definitely didn't know what I didn't know, especially the Apache part.
Thanks again everyone!
and Rad, I'd rather it be too complicated than too shallow :D
|
Short question: when I click 'view source code' in chrome it's html right? Or PHP?
Or does it depend on the actual code used?
|
On July 12 2012 14:26 JieXian wrote: Short question: when I click 'view source code' in chrome it's html right? Or PHP?
Or does it depend on the actual code used? It's HTML and its the only thing along with Javascript you will see from the view source code. PHP/Java is being executed before the webpage loads so you will actually never see it from the view source.
Example of html would be: <Html> <head> heading </head> <Body> <h1> this is a text</h1> </body> </Html>
php would be:
<? php $variable ="foo"; Define 'text' = 'excellent'
if (!empty($variable && text)) { echo "this is " . $variable . "and " . text; } else { echo 'variables were empty so something didn't work as it was suppose to.' }
?>
|
On July 12 2012 05:06 tofucake wrote: PHP is a shitbag and is quirky and annoying. I use it every day.
Python is cool and all, but not really quite suited for web development.
PHP has the advantage of being used just about everywhere; Python isn't as universal.
IMO it's worth it to learn both eventually, but if you want to do websites specifically, PHP.
Regardless which of the two you pick, you will need to learn HTML, CSS, and JavaScript
This.
PHP is a crappy, annoying and really bad language... but if you are looking to work in web development you need it since it's probably the most common web development language on the market eventhough even the PHP creator says "If you want clean code, PHP is not for you" (I think it was http://vimeo.com/13768954 around 1:03:00 - 1:05:00)
Most companies that do Web Development have: * MySQL as database backend * PHP on the server side * JavaScript on the client side
You need to know all 3 and of course HTML&CSS.
MySQL is quite simple, once you get the hang of joins, subselects and such. It's not the best database in the world but it does it's job. PostgreSQL is more powerful but basically noone uses it.
PHP is very similar to C - lots of basic functions are even called the same - since the creator originally just wanted PHP as a C abstraction. However, i strongly suggest using object oriented programming. Still, it's wierd scoping and it's very loose type system makes it annoying to work with. To interface with the MySQL backend, don't use the common mysql_* functions, use PDO or some database abstraction framework.
JavaScript is a very misunderstood language. It's not really procedural like C or object-oriented like C++, it's actually a lot closer to functional languages like lisp or scheme and once you actually understand that, it becomes a lot easier. Once you are accustomed to the basics, use jQuery, it makes a lot of stuff very easy.
|
Thanks thanks and thanks everyone, very informative. I'll learn all of them (HTML, PHP, Python, Java, MySQL & CSS) since they are needed.
However given the fact that Youtube and Google use Python, does it mean something?
Also, do any of you happen to have any recommendations for goos sites/guides/techniques to learn a language? I'll be searching for them but it'll be great if anyone has any good suggestions. I'm talking about sites which good way of slowly introducing new things btw.
Thanks again
|
On July 13 2012 00:56 JieXian wrote: Thanks thanks and thanks everyone, very informative. I'll learn all of them (HTML, PHP, Python, Java, MySQL & CSS) since they are needed.
However given the fact that Youtube and Google use Python, does it mean something?
Also, do any of you happen to have any recommendations for goos sites/guides/techniques to learn a language? I'll be searching for them but it'll be great if anyone has any good suggestions. I'm talking about sites which good way of slowly introducing new things btw.
Thanks again
The big 3 is PHP, MYSQL and traditional HTML (which includes HTML/XHTML/javascript/CSS) learn those first, once you done that you will know if there is anything else you should learn. But go learn the 3's first, then you can see if there is something else you can complement it with.
|
meaning not python 1st right? Actually it seems quite easy for being similar to matlab/pseudocode. But Ya will take your advice.
|
|
|
|