开发者

Moving from asp.net to php

I am an asp.net web developer. Recently I have开发者_StackOverflow recieved a job offer to write a website in php (I'll be upgrading an already written code).

I wanted to know, how much time will it take me to learn the langauge? How different is it from asp.net? Do people usually go from asp.net to php, or is that the other way around?

Thank you


I've worked with both PHP and ASP.net, with ASP.NET being the current language of my choice.

Learning the language's syntax and functions will be a relatively easy thing for you.
The syntax is quite similar to C, and finding functions should be easy, as the PHP documentation is very helpful, the search is incredibly useful and the community and support are great.

Getting used to the nature of PHP, being a dynamic and weak-typed language will be more difficult, perhaps.
Personally, I found it easy to get into a more restricting environment, since I went from PHP to C#.
Just a few examples, you will have to get used to the notion of arrays being able to contain multiple types of variables, associative arrays being different than Dictionary, and not having to explicitly declare variables unless configured otherwise.

You will also need to learn the drawbacks, potential problems and security issues this might cause. However, you can choose to work in a different fashion, declaring variable types and working in an object-oriented fashion.

With that being said, it's worth repeating the things previously mentioned--
The bare-naked PHP model resembles classic ASP more than ASP.NET.
There is no strict method of constructing a website, as opposed to the ASP.NET method of inheriting from a Page class or using ASP.NET MVC.
But if you find that too flexible, you could always use one of the many PHP frameworks, be it for MVC or any other model.


vondip,

at work here, we use both php and asp.net (laterally, mvc). the biggest 'jump' will be in getting aquainted with a comparable development environment. when i arrived at this workplace a year ago, they didn't have a php IDE in place and had been echo debugging stuff out to the html page. I immediately (as i'd come from a 100% .net environment at the time) researched the php IDE world and arrived at nusphere phped (http://www.nusphere.com/products/phped.htm). The difference that this made to my transistion is hard to over-estimate as i spent 90% of my life on a suspended debug line at the best of times :).

That would be my one main bit of advice - get a good debugger/editor. the rest will fall into place naturally once you're 'on the job'.

jim


PHP is very different from Asp.Net. While the syntax isn't too far off C#, the concepts behind Asp.Net just aren't there in PHP. Asp.Net can be run both as a scripted page or as a compiled resource. PHP is strictly scripted. The framework in .Net makes a lot of tasks much easier to develop rapidly and work through (which if taken too far may take away from the understanding of how things function and interact). There are some frameworks out there for PHP, but if you're going to be maintaining an already written application, most of your choices will be made for you and your learning curve shouldn't be too steep. If you're a VB.Net developer, you're going to struggle for a little while as your brain adjusts to curly braces and dollar signs everywhere. If you're a C# developer, it shouldn't be a big adjustment at all, particularly if you have a traditional C background.

I have known a lot of developers who program in both (myself included). No actual "movement" is indicative of learning a new language, though with the increased functionality and "buy-in" from work environments, I see a trend towards .Net away from traditionally scripted languages at the enterprise level. Small-business and small application development seems to be trending towards PHP, Ruby and Python in my opinion.


Thats a hard question to answer, as none of us know your skill level.

a couple of things - the function names in php are quite different from asp. - the syntax is more like C# then Vb, so depends what type of asp you have been doing

but the best part about php is the documentation http://www.php.net/docs.php

there are heaps of examples in the comments below each function, which are extremely helpful

i think your experience will also be dependent on how good the application you will be working on was written.


ASP.NET is quite different from PHP, but I think you can catch up, provided you are willing to put some effort into it.

In general, PHP is considered an easily language, especially if you are familiar with Java / C style of syntax.

You can find many different resources on the Internet where you can learn PHP but mind the problems can have: since PHP is a popular language, you will also find many bad examples which may lead into writing bad code yourself as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜