It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I'm working on my first professional project. The fact is that I don't know which are the best tools to produce something serious (I'm talking about web-develop through PHP):
Are template engine like Smarty mandatory? Which one is "the best" (the most used, complete, documentated)
At the moment I'm developing on Notepad++ (mostly because I find it useful and complete) is there a better development tool? Or is just a matter of personal taste?
At the moment I'm studying JQuery and deepening my knowledge as regards CSS what other "mandatory" subjects can you suggest me?
This is what I can think of at the moment, have you any other suggestions?
Thank you.
EDIT: As someone made me notice the question is a bit ambiguous. I know the basics (HTTP protocol, Java Script, CSS, HTML, OOP theory and practice etc...). I'm studying computer science at the University (and the project I'm speaking of is my thesis). I need advise on how the "real world" works (outside my basement).
Don't focus on becoming a Professional PHP Programmer. Focus on becoming a professional web developer, and check out the What should a developer know before building a public web site? question.
Saying "I want to become a Professional PHP Programmer" is like saying "I want to be a professional painter" when you actually mean "I want to be a professional artist." Sure, at the end of the day both might paint and get paid for it, but what their customers expect of them is very different ;)
Specifically for PHP I'd recommend:
Learn a good framework. Depending on the size of the project, you can use Zend/Symfony or CodeIgniter/others for small ones. There are tons. I'd stick to Zend/Zymfony for something mid-sized and/or "real world".
In general these frameworks come with a basic template engine or you can plug in other ones like Smarty or Twig. I'd say it improves the code a lot. So, yes to your first question.
Also, notepad++ is amazing, but I recommend using an IDE if you're working on a project and not a simple 2,3 file script. I strongly recommend Netbeans. It has lots of teatures and it's really active. Check it out: http://netbeans.org/features/php/
Since you're coding in PHP, I'd say you get to know the SPL (Standard PHP Library): http://php.net/manual/en/book.spl.php
To sum up:
Strongly recommended to keep code clean and mainteinable.
Yes.Netbeans.
Yes. SPL, and a lot more I can't think of now.
A templating system like Smarty isn't mandatory, since PHP is technically a templating system. However, it's not a very good one. It's clumsy, very easy to make mistakes with, and you frequently end up with an incomprehensible mess.
There are better alternatives than Smarty out there. I'm kind of partial to Twig, myself.
Using a framework is pretty much mandatory these days. Development with a framework is generally much easier and quicker than using raw PHP, once you've got the hang of how it works. Code Igniter's pretty good, although minimal. CakePHP is quite good, although seems very heavyweight at times. Kohana, Symfony, and the Zend Framework are pretty highly regarded as well.
1 - The Smarty engine is very useful and probably the most popular in PHP application development.
2 - I use Aptana studio for PHP development. It's pretty complete and has nice tools coupled with it. It's based on the Eclipse IDE, so it's pretty customizable. The major drawback is that it uses a lot of resources.
3 - I recommend learning development patterns like MVC (Model - View - Controller) to get a good base of how data should be organized.
Also, look up Code Igniter, It's an amazing framework to work with (it uses the MVC pattern). Building something with it is really easy and very easily manageable. If you want simple tutorials, you can check on NetTuts for a serie of tutorials.
Agree with what Pekka is implying, which is that it's important to pick up another lang in addition to PHP. Please. Also, I can't see learning PHP without knowing stuff like Smarty. Notepad++, who cares there, each to his own. jQuery is fine though I might opt for plain vanilla Javascript before getting into a library. Even though jQuery makes things easier it abstracts a lot of stuff and what you really want is those Javascript mechanics.
I would also add a solid knowledge of the HTTP protocol as a must-have that some web devs seem to think is optional. You should know what a hard 404 is, and what content encodings are, and the different flavors of caching disposition, etc, etc, etc.
Above all, have fun!
Most web development includes some degree of database interaction, so good DB skills is always useful.
Basic normalization of tables.
Understanding Transactions
Knowing how to escape your values
before insert/update/etc
write selects with joins how to avoid
nesting database selects within code
loops
differences between database
and PHP dates (and how to work with
them)
etc
My standard recommendation in questions like this, in addition to the excellent suggestions given in the other answers already, is to at least dabble with a strongly typed language like Java, C++, Delphi or C#, with a merciless compiler enforcing discipline - proper declaration of variables, definition of complete class interfaces etc. etc. I love PHP, but it is very permissive and sometimes still shows its templating language roots, and tends to seduce newbies into bad practices. (That said, PHP nowadays is a fine language and it is well possible to write very high-quality software in it.)
However, you say in your update that you do Computer Science at University, so I guess you are already getting your helping of at least one other language, and CS theory, and your focus is indeed which frameworks to use etc.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
as web developer using PHP/JS/CSS for years , i suffer from repeat myself over and over and over and over , even if i use a PHP framework , i feel the same thing every time, i start to build new feature , so every time i started new thing i feel the 'Déjà vu' ( i write it before ) , and i rewrite many things from scratch despite i write something same before , if i use previous written code , i may take more time to reuse it , i love programming and web development , but by this way i will lose this :( ...
Where the problem ? in language , my way to built software or what ?
if i use previous written code , i may take more time to reuse it
This, I believe, is your real problem: you're writing way too much quick-and-dirty code and are suffering from the resulting techincal debt. The problem is, what is quick in the short term can lead to being very slow in the long term.
If I may offer a non-technical comparison, consider a Ferrari and a cargo ship. When delivering just one letter, it seems obvious that the Ferrari would be much faster not to mention much more convenient compared to using a cargo ship. Just loading the ship before leaving the docks can take hours. By which time the Ferrari would have already completed the delivery. But when you have to deliver a hundred tons of mail, the cargo ship would complete the delivery while the Ferrari would still be busy speeding back and forth delivering each letter.
It's the same in your case. When developing just a single web site, it will always seem obvious that you should write the least amount of the simplest possible code to get the job done quickly. And if your whole career is devoted to just one web site I would even say that that's the right way to do it. It is, after all, the essential spirit of Agile methods. But if your job is to develop websites (plural) then this approach will start to become slower with each new site. Just like how the Ferrari is not ideal for delivering a hundred tons of anything.
One real world example is 37signals. When their business model requires that they should be able to quickly develop and deploy sites as necessary, instead of just diving in and develop their first site in a quick-and-dirty way, they took a step back and developed Ruby on Rails instead.
I'm not saying that you should go ahead and start your own framework, re-inventing the wheel is exactly what you want to avoid at this point. What I'm suggesting is to separate the functionality you're developing from the web related code. In other words, when writing new code write it as a library. Yes, it's a bit more involved writing code in two or more files compared to inlining the functionality directly in the PHP page. But in the end your next web site would be easier/quicker to implement.
I always, as a matter of habbit, create a lib directory in a project's base directory whenever I start a new project. I then force myself to write all code even remotely reusable as separate modules in this directory. These days I find that, more often than not, I'd simply copy (or more commonly make a symlink) of files I need to the lib directory instead of writing the needed code.
The problem is that when PHP started, every tutorial, every demo and all code was made in a very structured way, because PHP descended from the C/C++ family. Many developers took this problem and have carried it, and it was visible that we couldn't keep this.
Now, we have PHP 5.3.3 available, we have namespaces, objects, classes, interfaces and all of this. Many of the things that helpt making bad code like magic quotes and register globals are now deprecated. PHP is evolving into the OO world, it took long enough, but is happening. So if you want to start again to "relearn" PHP I would suggest getting your hands on some frameworks like:
symfony, joomla, propel, doctrine
learn about mvc and design patterns applied to PHP and you will see how you'll start making good OO code, and the deja-vus might stop before you knwo it.!
Hope I can help
David
This is exactly why a framework is the best way to go. It takes out the mundane parts of code (the stuff you always have to write over and over like DB connections).
I would suggest picking a good framework (I use CakePHP, but there are others like Symphony, Codeignitor, Zend, etc.), and as you build various components, you can reuse them in other projects. It will reduce the time it takes to write all future projects.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Back in the 90's I used to develop websites using Cold Fusion. We also still used tables for most of our page layout, hehe.
I just started getting back into website development again seriously. I'm getting a pretty good handle on the basics with CSS and starting to add Javascript. I'm guessing that I will eventually add PHP as a modern replacement to my CF skills.
Right now I am using an old copy of Cold Fusion studio for my editor and of course Photoshop for my graphics. I have also discovered Firebug and found it to be very helpful.
I was wondering if the community here could give me some pointers as I start back out in this field. Do you have any software suggestions? A new editor I should use? Other debugging tools? Languages you would recommend?
Any comments or ideas that would help a website developer who is starting out would be greatly appreciated. Thanx!
You might consider Eclipse for your IDE. It's free, open source and pretty full-featured. Also, you'll want to implement source control. I like Subversion, which integrates nicely with Eclipse.
If you're looking to update your image editor and you don't want to spring for Photoshop's licensing fee, GIMP is very much improved, open-source and free.
You may want to investigate the various CMSs and frameworks out there. It's possible that one or another may suit your target market. And they can speed up development significantly once you learn their quirks.
Also: JQuery. Don't spend your javascript coding time dealing with cross-browser issues and common tropes.
I would look at Net Tuts+, Think Vitamin, and Smashing Magazine to get back up to speed on what's fresh.
You definitely want to look into a framework. You'll be disappointed with PHP out of the box if coming from ColdFusion, it's not nearly as friendly. This is assuming you're going to use it for database applications, otherwise it really doesn't matter.
Of course, I'm obligated to tell you to check out Ruby on Rails.
I'm a big fan of jQuery for elegant, client side cross-browser javascript.
If you want to look at some "modern" concepts on the server side, REST is getting some airplay, and cloud stuff like Google App Engine can make for a really efficient development path (scalability 'for free').
But I still stick with the old-school IDE - syntax highlighting text editor. Or eclipse, which sometimes isn't much better ;)
I agree with finding a framework. As a general editor, I can't live without notepad++ - http://notepad-plus-plus.org/
It is a text editor, but it does so much. It has code highlighting for many languages - it is an indispensable tool for me.
For CSS I would recommend reading CSS Mastery for a nice overview including browser differences / bugs.
As far as the software is concerned, I still use Dreamweaver for my old, template based sites, but I´m moving to NetBeans for my new sites. Apart from all the expected features, NetBeans has nice ftp integration, one of the reasons I started using Dreamweaver years ago.
The Opera Web Standards Curriculum is a great (re)start for writing correct HTML and CSS and JS. Read it at your own rythm (I mean pace, sorry for my english).
IE6:
Just give up with IE6 if you can (if your clients don't ask specifically for its support). It'll give you plenty of time to learn better things.
If you work for administrations or companies that work for them, that won't be the case; prepare for severe headaches.
Position is everything is a great resource. Don't try to understand everything but at least learn to know and recognize those IE6 bugs. A doubled margin, 3px margin, content seen twice, disappearing content are very well known and documented bugs but if you don't know here they come from ...
Conditional comments and hasLayout (zoom: 1; in one instruction) have been better explained elsewhere I believe, because P.I.E. is really an old site (though still useful).
Page layout:
If you have used tables, spacer.gif and are new to web standards like CSS 2.1 used the right way, you'll have a hard time for layouts displaying correctly cross-browser even if you know hot to style entire blocks in the page.
Don't bother to reinvent the wheel, use resources like HTML Gala. Pick up the layout you need depending on fluid/fixed width, number of columns and whether their width is fixed or not and whether there is a footer or not, then understand how/why they did it but don't try to do it from scratch: it's just too complicated when you start to use CSS.
Tools:
a good text editor
Firefox and great extensions
and you're done. Quite :)
Chrome also has extensions, keep an eye on it in a few months. For now nearly everything needed by a webdesigner/webdeveloper exists on Firefox and some of them on other browsers too.
Firebug that you already cited. Explore its tabs, its select boxes and breadcrumbs, where you can edit things live, etc. And I heard you like extensions so dev created extensions for this extension (meme ©Xzibit :)), check for extensions to Firebug. I use Pixelperfect and CSS Usage mainly but others are useful too.
Web Developer Toolbar is the other must have extension. Be sure to try every option at least once, there's even a gem in the last menu, first option that only a few know.
QuickJava allows quick enable and disable of Java, Javascript, Flash, Silverlight and Images from the Statusbar without having to open any dialogs.
MeasureIt to measure width and height of an element or margins.
ColorZilla brings a color picker (Shift-Esc)
Fireshot for snapshots and commenting them, useful if you want to communicate with a client or a designer, write documentation or for your portfolio.
Others
source control (let's avoid the pain of "It worked 3 days ago/I just deleted the wrong file aaargh")
two offline backups that won't get robbed/flooded/burnt with the rest of your house/office. The second one can be an USB key/HD with Truecrypt given to family or friends, along with a password only known from your wife/husband and your parents or children for example. You can keep the first one with you (encrypted is better if you get robbed).
CMS: you can test Drupal, Joomla and Wordpress as a beginning. Magento for e-commerce. Numerous plugins for each one but their quality may vary!
I'd look at Net Beans as an editor/IDE if you definitely want to go the PHP route.
I'm a .NET developer, so maybe i'm biased but i'd look into the .NET framework, and specifically ASP.Net MVC (go for c# if you can in my opinion)
It all depends on what you want to do in the longer term, and if you want to do this just as a hobby or to work as a full time developer.
In the area of the UK i'm in it's a bit harder to find PHP jobs in the larger companies, many are tied in with Microsoft and rely on their technologies such as .NET and MS SQL etc.
Are you looking at taking on more of a design role, css/xhtml coding, or writing applications, web services etc?
Note, just to clarify I also use PHP for many projects outside of full time employment, you can make a living using most technologies, so go with the ones you prefer.
Also check out Tizag for loads of useful, easy to follow tutorials that can quickly get you up to speed on the basics.
Whichever route you go down, definitely get familiar with the jQuery javascript library, it's very powerful and many of the basic functions it makes available are expected in websites these days by clients i've found lately.
I've not looked at it myself yet, but the new PhpStorm IDE seems to be getting a lot of praise at the moment
Futher to the nettuts+ answer.
If you're on a mac, i can highly recommend panic's coda http://www.panic.com/coda. It makes writing css a breeze, even though i hand write mine. However if you're strapped for cash a free alternative to that is textmate http://macromates.com/
Firebug is a fantastic little tool, and there is also web developer toolbar https://addons.mozilla.org/en-US/firefox/addon/60/, which is also very very helpful! It has built in links for validating your html and css with w3c.
Languages, definitely PHP imo. I started out in ASP.NET, found it good but i just feel more comfortable in PHP, my suggestion for you is to try them all out and see what works best.
Also when you feel comfortable, take a look into the kohanaphp framework (kohanaphp.com/), its a fantasticly simple framework which as someone else put it, is unobtrusive, you can use as much or as little of it as you like.
Finally my best advice is to just spend every waking moment trying out new things, like making a html page and styling it, making a contact form that kinda thing, i found just messing around is the best way to learn a language.
Hope this helps you get started :)
ColdFusion has evolved nicely since the 90's, check out the details of version 9 before abandoning it. Also, consider CFBuilder for a nice IDE for ColdFusion.
ColdFusion 9
CFBuilder
here are some helpfull links.
css-tricks.com
net.tutsplus.com
ajaxian.com
webmonkey.com/category/javascript
smashingmagazine.com
(i visit them daily to be up to date with web Design / development).
I think there are two things that mark modern web development:
Web development frameworks
JS libraries, mainly jQuery
Although most of the concepts behind today's Web development is not new (MVC structure, AJAX...), re-discovering these led to a shift in how we do things, and brought back the trust of veteran developers in it as an effective and serious medium.
I definitely recommend that you dive into Ruby on Rails. Learn the main principals and concepts underlying the framework: reusable modules, elegant MVC structure, templating, RJS...
(Alternatively, you might like to check cakephp, the PHP cousin of Rails, which inherits most of the family traits)
Eventually, when you play enough time with it, come to like it and understand it well, you'll stumble upon other frameworks that might suit you more (for one reason or another). My experience moving from Rails to Django (Python), then to Google AppEngine (Python or Java) was nice and rewarding (in personal satisfaction, that is).
That's for the back-end.
Then you come to the vast world of ninja-style-ultra-useful-and-still-fun jQuery (and its numerous plugins) where the joys of web development continues.
Enjoy the ride!
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a heavy web dev background with PHP. My reasons for learning a functional programming languages are:
to improve my programming skills. It was heavily suggested that learning a FPL helps. this has high priority because I want to be better and better.
learn a general purpose programming language to solve tasks like scripting (OS scripting, text manipulation etc..)
to be used as an alternative for PHP in web development.
Also which has the better community support, tutorials and books and the better web application framework?
Feel free to suggest other languages.
For functional languages, learn both Scala and Clojure. You'll learn new ways of thinking from both of them. Go learn some Reia and Erlang while your at it too.
Seriously, the more languages you have under your belt, the better off you'll be as a programmer regardless of the language you end up using.
Rant: "What language should I learn?" questions are getting tiresome. The answers should be the same every time, yet no one gives the correct sage advice. Instead, everyone spreads FUD and suggests that the language they happen to use for their day job is the one you should learn. Poppycock.
I've tried both Scala and Clojure recently, based on similar motivations. Here's what I found:
Scala is enormously versatile and powerful; Scala lets you define types with great precision and it allows you to define DSLs that are terse and clean. Scala has a lot of cool constructs that one wishes Java had, including a bunch of functional extensions. But when it came right down to it, I ended up coding imperative Java in the Scala language because the complexity of all that cool stuff overwhelmed me.
I did some Lisp back in University, and always had a hankering to get back to it again. Some really cool cutting-edge stuff is done by very smart people in Lisp, and in very few lines. I wanted to be one of those smart people, or at least try to be like them. But I never really understood Scheme, and I missed my "infinite supply of libraries" from Java. I couldn't see myself writing a GUI in Scheme, and had trouble envisioning a Web application.
Then I tried Clojure and it seemed like everything clicked into place. Clojure was intentionally made more outsider-friendly: There is an attempt to cut down on the parentheses and to use different parenthetical punctuation for different situations. Treating things like arrays, text and XML as sequences, combined with a powerful set of sequence functions, made a lot of problems quite simple, as does the support for arrays and hashmaps. It's (intentionally) like functional Java. The functional mindeset takes a bit of getting used to, but nowhere did I find it as approachable or as enjoyable as in Clojure. My code hardly needs loops any more, yet it's more clear about where it's looping/sequencing, and more concise. I can do mutable state if I really need to, but I have to be explicit about it; in exchange, that state is protected by Clojure's concurrency mechanisms. Concurrency, then, becomes almost a no-brainer, sometimes my code executes safely in parallel with no conscious effort of my own.
Not coming from Java, this will not seem very useful to you, but Clojure can do anything that Java can, including fully compatible .class files. Most importantly, it can interface with all Java libraries, and that ability alone will make PHP seem like a toy language to you.
My suggestion is to learn JavaScript.
I mean, really learn it.
Here's what a self-professed Clojure advocate has to say about Scala. Make up your own mind, of course, but you may find his perspective useful.
Scala Vs Clojure — Let’s get down to business
Scala vs Clojure — Round 2: Concurrency!
You may also be interested in what he has to say about PHP vs Clojure.
That's a very difficult call. Personally, I think Scala is more useful as a general language for web developers. There are many web frameworks for it, or adapted to it. On the very quick&dirty side, for instance, there's Play. On the full-fledged with excellent Comet support side, there's Lift.
But you talked about learning to program in a functional style. In that regard, there is no way Scala can compete with Clojure. Scala can be used in a functional style, but it makes sure you don't have to. With Clojure, on the other hand, doing anything but functional style is painful.
So, if you want an alternative to PHP, I'd bet on Scala. If you want to really learn functional programming, Clojure.
Finally, let me state that I do not think Clojure isn't a general purpose language, or that it can't be used for web development. I just think Scala is more on both regards.
Get a bag of cement, harden up and Learn You a Haskell, for Great Good!
It's purely functional, so you cannot fall off the ship.
It's general-purpose with loads of libraries (including a web application stack), and no VM startup time penalty (JVM languages are not great for OS scripting and the like, since you have to start the JVM every time).
Jumping form PHP to Scala or Clojure is going to be a huge culture shock. PHP is very focused on quick/dirty getting things done (or 90% clean with the last 10% dirty (-:), whereas functional programming languages force a certain correctness and abstractness onto your thinking. Before you get to Scala or Clojure, you're going to want something inbetween. If it was me, I'd
Pick my final target as Clojure, since (as I understand it) you get the entire Java standard library with Clojure, making it immediately more useful than something pure like Scala
I'd spend some time building something in Java, just to get a feel for a strongly typed OO language. I picked Java over C# (or even ZendFramework style PHP) because it will prove useful once you arrive at Clojure. Google Web Tools might be a good place to start with this. It's kind of web development, but very very Java like and not at all PHP/HTML like.
Spend some time looking at the guts of jQuery, and either develop your own jQuery module or add a core feature. This will get you used to the functional way of thinking, while applying it to a problem you're familiar with.
Final bit of advice: Try to embrace the common methods of the language/platform you've chosen. Don't try to bring your style of PHP coding to either language. Although it will seem easier at first and let you get some kind of results, you'll miss the point of the exercise, which is to think differently and more broadly about problems.
Good luck!
If you are looking for a good alternative for PHP, I suggest Python and Ruby. If you need a Functional language with good support for web development - learn Erlang. Here are some projects/frameworks that will help you create highly scalable web applications in Erlang:
Yaws - An Erlang webserver particularly well suited for dynamic-content webapplications. (Also see this Apache vs Yaws benchmark)
Erlyweb - A component-oriented web development framework written in Erlang and designed to work with Yaws.
Erlang Web - The Erlang Web is an open source framework for applications based on HTTP protocols, giving the developer better control of content management.
Nitrogen - An event-driven web framework for Erlang.
It is also one of the few languages that is specifically designed for building fault-tolerant, distributed software.
While it gets less press coverage than Clojure and Scala, I'd really recommend you to take a look at Fantom: http://fantom.org/
It's like the best of all both worlds and really should deserve more attention.
I'm a new convert to Clojure. It's making me expand my mind but it's approachable enough to be fun and productive. I'm a happy customer.
But
PHP and Clojure live in different universes. I've had some introductory dabbling in FP languages, and a few false starts into other Lisps before embracing Clojure. For a less experienced developer coming straight from PHP, Clojure might be too much of a culture shock.
As a reasonable compromise between the two, and a language that is scripty enough to let you approach FP on a gradient rather than a plunge, I recommend Ruby. Ruby is modern, clean and elegant. In its JRuby incarnation, it's even fast. Learning Ruby and playing with Rails is enjoyable and instructive.
Though Scala is my favorite language for now, i think it's not the best choice to learn FP. It's mainly OOPL with good support of FP. I would suggest to start from Haskell to quickly dive into FP. You will learn how the following concepts of FP work (which are not just supported, but enforced and ubiquitous in Haskell):
1) powerful static type system with type inference
2) lazy evaluation
3) side-effect free computing
After dynamically-typed "pragmatic" PHP and pure functional "academic" Haskell you will have quite full picture of programming languages landscape.
My $.02 is to check out Perl. I may sound like a geezer, but keep in mind that Perl has CPAN (http://cpan.org) and many very, very helpful online resources.
Ruby is probably the most "functional" mainstream language that's also good for scripting. Python is a close second, but ruby's habit of implicitly returning the result of the last expression in a function/block is the tiebreaker for me.
Both have excellent web frameworks (Rails and Django, respectively), and both will definitely broaden your horizons after programming PHP. At the same time they will allow a lot of opportunity for incremental learning.
Neither of them use S-expressions and both allow imperative programming, so there won't be anything to force you to give up the imperative style cold turkey.
Finally the much-lamented TCL is basically Scheme as a scripting and extension language. I'm not sure where it's at these days, but the ArsDigita Community System was written in TCL.
Web development depends ENTIRELY on: First, the quality of the web-framework and second the tools for development. I do not know why you want to move to functional languages for programming web applications.
Python allows some functional constructs for programming and it has frameworks and tools. Lua allows the same level of functional programming and it does not have either high quality frameworks for web development or tools, however its simplicity/primal-nature is its elegance.
Now as a puritan I'd say look at haskell, but that is counter-productive :D,. You my friend are looking for Python. I have not evaluated Ruby, but it might have some functional constructs.
May not appear so fancy, but I strongly suggest JavaScript.
A lot of years ago I was strong at PHP development, but then switched over to Java, C#, C, Objective-C. During my Java time I stepped deeply into JavaScript and did some pretty cool things with it. Someone I know developed an entire client-side temporary lightweight DBMS. Just have a look at Ext.js what they do with JavaScript. It's so underestimated, but doesn't deserve it. I suggest you google for "Douglas Crockford Video". At Yahoo he has created several excellent presentations about JavaScript, also I suggest you get the book "Javascript - The Good Parts" from Douglas Crockford, and "JavaScript - The Definitive Guide". Both the best JavaScript books available. And you'll be amazed what's possible and what a beautiful language it actually is. In fact, you can do AI with it, it has Lambda, there's actually nothing really "cooler" than that! What a pitty it's only used for clientside scripting. Few people know JavaScript can be used for serverside programming as well, but that's really rare / not well documented.
And thanks to Adobe Air you can bring JavaScript to the Desktop.
It would be an optimal addition to your PHP knowledge. It's always good to do related stuff. You can be the best Web Developer, or the best Desktop Software Architekt. But our brains are too slow to grasp all proffession needed nowadays to be the Guru in multiple directions. Beeing the Guru is essential for success, I think. Some friends of mine just do one thing: Beeing the Guru. They study their entire life one small subject and are extremely successful. They earn 5 times as much as any I-can-do-it-all-but-know-just-5%-in-this-topic-Developer in a quarter of the time only.
So I also suggest: Write a 600 pages PHP book before you forget your PHP knowledge while doing something totally different.
I did forget almost everything I knew about PHP and JavaScript, but in those early days I definitely was one of the expert guys who showed others a lot of stuff. Now it's a pain I have to ask so many basics again to recall them in my tiny brain. By writing your book, you'll recall your PHP expertise very fast even after a few years of doing something different, because it's your book, fitting your brain, from your brain. And you'll not loose your PHP-expert status even after several years of doing something else.
Good luck.
I tried Scala and found it a bit much (huge amount of operators that you have to recall how to use). But that could just be me. I've heard that Clojure is more functionally pure and closer to Lisp, but haven't checked it out.
F# is Microsoft's take on functional languages, you may want to check it out. I hear it has been used for several projects in industry.
I would suggest learning languages that have frameworks beyond the web front end such as Java EE (Java EE[JSP/JSF] + Java) or .NET (ASP.NET + C#, etc.). That would give you a bit more leeway with your career options, and you would be able to connect server components to a web front end with (relative) ease.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have this idea for a website that's been floating around my head for quite sometime now and now have finally decided to get to work on it. Due to the nature of the project and my experience I am getting comfortable with the idea of running it as a PHP+MySQL application on an Apache server.
This is my first time doing web programming of any sort(I have a background in sysadmin and mainframe systems coding) and I am pretty unsure of what practices to take into consideration so that I don't find myself undoing/redoing things later in the project. Considering all the flak the language has taken on StackOverflow(which can be seen here and here) it would be nice to have a set of common mistakes to watch out for for a beginner like me. I did find this thread outlining things to avoid in PHP but most of the points made little sense to someone like me who's just setting out in PHP.
Do you have any suggestions, tips or tutorials outlining common gotcha's in the language which might come back later in the project demanding entire rewrites.
For what it's worth I am currently working my way through Programming PHP(O'Reilly) and PHP in Action(Manning).
I was in a very similar position a couple years ago, having come from a NOS background myself.
I actually started with PHP and MySQL for dummies. Once I had absorbed the knowledge contained therein, I hit the Web (I used SitePoint a lot, like Boushley recommended) and I read a couple of O'Reilley's book on the subject.
Once thing I will tell you, is that if you want to streamline your understanding and your efficiency, I have found great success with a number of MVC frameworks(CodeIgnitor, CakePHP, etc). If you have no idea what MVC is, I recommend finding out. Now that I use MVC, my code is easier to understand, modify, troubleshoot, etc.
And honestly, half of the learning in PHP is running into those common mistakes and learning from them. Its hard to appreciate those 'common mistakes' until you make them.
Don't worry about HOW you are going to learn, just START leaning!
If I could give you one piece of advice, it'd be to use a framework - they will make your life so much easier. They take away all the repetitive code from programming websites, handle security concerns and abstract lots of things, as well as make you build your website using a pattern such as Model-View-Controller.
I highly recommend the CodeIgniter framework for it's simplicity, power, great documentation and ease of use, but there are plenty of other good frameworks too. There are lots of questions on SO on this so have a quick search. There is a fantastic introductory screencast on CodeIgniter (soon to be a series) from BinaryCake, so check that out here.
I hope that's helped! If you have any PHP concerns, feel free to message me - it's my area of expertise (along with CodeIgniter) and I love it!
While still developing, have all errors show up:
ini_set('display_errors', '1');
error_reporting(E_ALL | E_STRICT);
Can save a lot of time (in case of say, typos in variable names). Change this when it goes live to not display or only display "real" errors depending on the type of site and security levels involved (you don't want everyone to know paths and variable names and such..).
Find a variable/function naming convention (under_scores vs camelCase vs..) that suits you and stick to it. Also, classes go in the /class directory, includes in /inc etc. Both these make it easier to understand your own code years from now. Oh, and the same goes for coding style, I guess: choose one and stick to it (indentation, bracket style, ..).
Comment your code :-) Personally I also have a little log at the end of longer files that shows when I did what and why. Each addition is timestamped, and the same timestamp is also in the comments behind the change itself, as the line number on which it sits can easily change. Similarly, in an included file containing a bunch of functions, I have the list of function names in a comment at the top of the file, with a one-line description behind them.
Finally on security (though this should really be your first concern ;-) ), treat all user input as suspect. That's POST & GET data, cookies, user-agent string, search strings - anything that is supplied by the browser. It's trivial to change cookie data or change/add form items.
Read up on SQL injection & XSS attacks, and look at PHP's relatively new data filter functions: http://php.net/manual/en/intro.filter.php
Google any of these to get some good reading
Don't use register_globals
Turn off magic_quotes - escape all user entered input in SQL statements
Escape any user entered input printed with htmlspecialchars()
Plus a lot more... These are some common things to watch out for though.
There are a number of great websites out there with lots of tutorials. One that comes to mind is Site Point. They'll try their best to sell you a book or two while your're there, but they do have some decent articles. This article for instance discusses some common security blunders in php.
http://www.sitepoint.com/article/php-security-blunders/
They have lots of them...
http://www.sitepoint.com/search/search.php?ps=10&q=php&submit=Search
Also a nettuts.com has a load of tutorials an things of that nature. They're more all across the board though.
http://nettuts.com/
And I think pretty much everywhere you look you'll see the common ones like watch out for register_globals, magic_quotes...
one good book to look at that is also free to download here covers beginner to advanced PHP techniques and is good way to learn good standards :)
Use a framework and use Object Oriented Programming
Books are great for learning additional languages, but for your first one, a good video tutorial is a great way to go!
Register for a Lynda.com account (google: lynda trial) and sign up for as many one day trials as you need (or be a good honest person and purchase a week). They have a pretty good beginner and advanced PHP series of video tutorials which are (IMHO) a great way to learn your first language.
A tip: If you can start programming Object Orientedly from the get-go, you will save some time in the future and learn good practice from the start, luckily the advanced tutorials cover this!
Here's a link: http://www.lynda.com/home/DisplayCourse.aspx?lpk2=435
I've never taken this particular course (when I learned a few years ago, it was different), but I just recommended this to a friend (who was just starting), and he really liked it!
Hope this helps!
If you're new to programming in general, A database backed web application is likely to be a bumpy ride. You will probably be programming in at least two, real programming languages, PHP and SQL, and if you're going to do anything of modest complexity, JavaScript too. Keeping them strait will be rough, because they are all quite different.
Just to warm up to programming, you might want to start instead using a more focused learning excercies, such as working through the Euler Project problems, or Code Kata.
Either way, Try to pick up good habits wherever you learn about them, including the popular suggestion here of using an MVC framework for the heavy lifting.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I myself am one of these types of coders, who never learned coding in a formal setting, but am instead, self-taught by the use of copy and paste scripts, and pre-authored works available through GPL projects and premium software's(which is often the way commerical script companies show you how to change, or update code in their script ie. "Copy & paste this on line 234, etc..")... this are my beginnings.
I don't understand how what I do works, but I am getting good at what I do with code, though I feel because of my informal learning methods, that I lack in knowledge, some of the really simple, but necessary principles of web coding in general(the ins and outs of servers, browsers, etc). I feel as though I have started from the inside of understanding code, the practical side.. and lack the basic fundamentals, and theorized understanding of what I am doing.
I also know quite a few others who are the same, who started learning in the same communities as I, and are pretty much at the same point as me... Feeling as though something big is missing from the picture.
I see the lacking in my discipline when I attempt to use PHP authoring tools, which I find very challenging to understand... and this is becoming a downfall on the time frames in which I complete my projects(having to hand code everything). I also find it difficult to ask for help at times, for lack of the specific language that comes with programming, and being able to use the right words to explain the intricacy of my problem.
I was a hairdresser by trade, I worked as a bartender, and hotel manager, I'm a business consultant by profession. I've been learning web development slowly now for 3 years, and I have taken on quite a few commercial projects over the past 2 years, but I'm obviously feeling some lacking in my skills & overall knowledge.
Basically, Id like to ask any experienced coders who've had similar beginnings to give me an idea on how I can adapt my coding disciplines to be more effective and productive. What would someone with such an informal understanding of programming want to seek to learn, and understand. What are the things I must know as a programmer... and what is a basic overview of the whole picture???? Feel free to direct me to articles
Any help is always appreciated.
Lea
Edit: Just to give a round up of my actual capabilities. I am a programmer, I do author my own code from scratch.. and sell my work. I can write PHP functions, and classes, use mysql, have a good working understanding of html & css, and am very good in the design aspects(web graphics), and am learning javascript/ajax/jquery, as I am using jquery in most of my projects. Thanks for all of the answers so far!
Realise that "copy and paste programming" is not actually programming, despite the name. The act of "programming" is figuring out how something should work, and what code is needed to make that work. Therefore, when you copy and paste some code, it is someone else who did the programming. This isn't a bad thing necessarily, as you shouldn't always need to write code yourself. But to call yourself a programmer, you do need to have written the code yourself.
You will want to start humble. Don't try to write a large complex application as your first step into programming. There is a good reason why most people who are taught programming are first taught how to print "Hello, world". This is because there is a lot more that you will need to know than just what code to use - you need to know where code execution starts and how it flows, and that sort of thing. You need to be able to look at the code and step through it mentally, knowing where program execution will go next, so you understand how it will work.
Take a tutorial or course in programming. There is so much free stuff online. Do not trust any tutorial that just gives you large chunks of code, make sure it forces you to actually come up with some code yourself. Do exercises such as sorting strings, calculating fibonacci sequences, and the like, and "echo" or "print" the results. Learn about conditional statements (like "if") and the "for" loop and play with these to do various things.
GUI or forms programming is more complicated; make sure you know the fundamentals of the language before you go looking through any API or framework documentation to see what the language can do. You'll need to know how execution flows, how to write functions, what types of variables you can use etc before you can effectively use an API or framework anyway. It is boring not being able to do cool graphics or forms and sticking to basic text or number processing, but you have to walk before running. Make sure you are doing, not just reading. When you learn about something new like the Array type, the "while" statement, try it out. By actually doing it, you'll "get it" a lot faster than just reading a book or website and you may be more likely to remember it.
Read books about programming. Some people say you should learn C before you learn anything else. I don't necessarily agree, but if you do learn C then the book to read is "The C Programming Language" by Kernighan and Ritchie. Many programming books are very interesting but either not suitable for beginners, or aren't going to teach you how to actually begin programming. This one is an exception.
Use a decent text editor with syntax highlighting and line numbering. That's all you should need. A big IDE that also does code completion and the like is not necessarily helpful at the learning stage. Don't spend too long choosing one or setting it up. If you don't already have one, just get Notepad++ (if you're on Windows) and be done with it. If you don't like it you can change it once you get more proficient. Or if you've already paid for Microsoft Visual Studio then use that, but don't go out and get it just for the sake of learning a language. Avoid falling into the trap of spending all your time sharpening your tools and no time using them.
The easiest and fastest way to do this? Find a mentor, or a set of mentors. Not necessarily a real-life mentor, they can be offline, although a real-life mentor is more practical.
You can find these people when you participate in local software development communities, e.g., forums, or user group meetings. Frequent these places, both offline and online; the amount of knowledge that you will learn is immense, not to mention the benefit of being able to bounce ideas off of other people.
Code Complete and Pragmatic Programmer are likewise excellent book suggestions above. I suggest you go with Code Complete first, as it tackles on how to make your code sensible and elegant, which you certainly can use immediately.
Goodluck!
We all learn differently, so don't feel handicapped because of the way you've entered the field.
I guess the simplest, easiest thing I can suggest would be to get yourself a PHP book (seeing as that's what you're familiar with right now) and start from there to build up confidence.
In your spare time, just create some very small basic apps to practice without any pressure. Then take on a language like Python, Java or .NET.. depending on what takes your fancy. With a language or two under your belt, then you can take on books like Code Complete, which will cover some of the more esoteric areas of software development.
Good luck, this is a profession where you really never stop learning.
in case you're interested to becoming a better programmer, i must recommend that you read the pragmatic programmer, don't worry, it's not a full text of codes which will make you pull your hair out but useful lessons which can only be distilled from years of programming experience written in an easy to read but still very informative kind of way :)
I'm not at all convinced that the premise of the "Copy & Paste Generation" is any kind of new phenomenon. Only the tools are available to a wider audience now than before.
If you want to really hone your skills, it might be worthwhile to take some classes, either at a local community college or in a self-directed learning environment through the use of some of the many, fine online resources or books
I believe Code Complete is another book along the same lines of the Pragmatic Programmer that has already been recommended.
I have been your situation before, senior year of high school in an internship I "learned" c and shell programming mostly via copy and paste, and later on at various times when I may have been in a similar situation with specific technologies.
My recommendations:
Take a class at your CC. The one you want is the one that is the prerequisite for the advanced programming classes. They probably also offer a "I've never touched a computer before" level class but this one won't be the formal prereq for the follow on classes. This will probably be in Java.
Work your way through one of the better programming books that includes exercises. Kernighan and Ritchie's C Programming Language is a classic. This would be my recommendation because C is similar enough to PHP to be familiar, but different enough that you will be able to keep them separate. I say this even though you will probably never write a single line of production C. Paul Graham's ANSI Common Lisp is also a suitable choice.
If you are really hard core and have the dedication, you can try Structure and Interpretation of Computer Programs, by Abelson and Sussman. This is the book used in the first programming course at UC Berkeley ( http://webcast.berkeley.edu/course_details.php?seriesid=1906978389 ) and at MIT ( http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/6-001Spring-2005/CourseHome/ ). This may be too difficult to attempt outside a school environment. It's designed for bright young students with nothing to do but study and with the regular opportunity to get tutoring from grad students. I include it only for completeness.
I would avoid any web programming books. You already know web programming. I get the impression that you are feeling like you are hitting a bit of a wall, and looking at a way around or over that wall, rather than trying to go directly through it.
I would advise against looking into any web oriented book because it will not give you the big picture, it will describe technique only as they apply to web programming. The important things to understand are how a computer actually operates, the difference between the stack and the heap, pointers, the basics of garbage collection, recursion, and it'd probably be helpful to understand at least extension mechanism. I mean, if you understand shared libraries on Unix, or DLLs on Windows, or classpath and jars on Java, or how to create a library in PHP, Ruby, Perl or Python, any one of those will be fine. It's just the concept of loading outside code that's important.
Take a look at The Structure and Interpretation of Computer Programs and see if you think it would help.
Copy and paste programming refers to using the same code several places instead of putting it in a function or class. If all you do is modify existing source code while following a howto guide, what you do is not called programming, just copy and paste.
What you need to do is read a book on programming, whatever you feel your level is. If you feel its copy and paste level, you should start with a beginners book. Forget everything you think you know, read and follow the book. When you've finished you can remember some of the clever code(?) you noticed during your C&P days.
Mastering any skill takes time, but if you keep at it you'll become better. There is nothing inherently different about programming in that sense. Exactly how you learn best, is a highly individual matter, so it's really hard to give any meaningful advice on that. In my experience, combining different types of learning (practical experience, being around other programmers, reading books, formal education etc. etc.) in even-sized doses works better than just pursuing one type of learning (Such as formal education).
You might find these readings interesting, if you don't know them already:
http://www.norvig.com/21-days.html
http://softwarecraftsmanship.oreilly.com/wiki