When do you make the leap to programming?

So I’ve been given the task of creating websites that will entail ecommerce and want to be able to have the client update it regularly. Now with this said, my knowledge in php is limited, but I do understand how that works. However, my HTML/CSS skills are decent I believe.

My main questions isn’t when do you make the leap, but really how do you make the leap to programming? In what order? PHP seems like it has so much to it and I’m thrilled. Now I know that PHP has is own forum and PHP.net has a manual. Cool. The reason I post in this category is because I want to know how designers transition. As in do you always think of design first then what you need to program, or simultaneously.?

Also, when doing sites that need a blog or ecommerce(such as a clothing line). I’ve been lead to believe use a CMS already made instead of re-inventing the wheel. I played with wordpress and it was not my cup of coffee, not because of the language, but because I’t didnt seem powerful enough and so I chose Drupal. Is this correct?

I think that the transition is gradual for a lot of people. Personally, I started getting tired of doing the same tedious tasks over and over, and so I started doing some PHP includes, then a little logic, and it just progressed from there.

PHP’s manual is great when you know the language, but learning the language from scratch using the manual is not something I’d recommend. SitePoint has some great books on the subject, such as the classic Build Your Own Database Driven Web Site Using PHP & MySQL.

Welcome to another of the reasons I consider design before content the road to failure. Your PHP should be outputting content as HTML – the “layout” or design shouldn’t even be a CONCERN for the HTML or the PHP, as that’s CSS’ job.

In fact, creating semantic markup of your output and having separation of presentation from content makes the job easier in PHP as you usually end up needing less HTML in your PHP.

Which is why I always write a mockup of the content first as plaintext, apply the HTML to the plaintext to give it semantic structure, then create the layout in CSS, then the paint program to make images to hang on it… THEN slice up the HTML into the PHP… If all the images and layout are external to the HTML, that makes putting the markup into the PHP piss simple.

Of course, if in your PHP you use echo instead of opening and closing <?php ?> two or three times on every line like some lame ASP developer, and use single quotes instead of double-quotes so you can maintain formatting in your output – the result will be easer and code in both php and HTML output – meaning easier maintenance and easier debugging.

If you’re worried about the “design” when your making your markup that’s going to be output by your php, you may have already screwed up!!!

But then REALLY GOOD HTML can take a total reskinning just from the CSS with little or no changes – it’s one of the reasons we have CSS in the first place!

or you could just use a template engine and no… I am not referring to smarty I am referring to a basic bare bone template engine that can be created in less then 50 lines of code. Normally if you have to open and close a bunch of PHP statements besides for some simple variable prints or loops the template layer is doing to much work that needs to be moved to the view or controller depending on the framework in use.

I began learning programming when I realized how limiting CSS and HTML where. I hate doing things more then once and if you only know HTML and CSS yet are working on large scale sites your going to have repeat yourself A LOT. For a simple mom and pa type site you can kinda get away with stupid simple HTML and CSS but when it comes to large scale web applications, stores, social networks, job boards pretty much anything useful good luck creating it without knowing some type of server side language or using a open source CMS. One thing I would recommend is before jumping into PHP learn either C++ or Java to get some fundamentals down. If you just dive into PHP your likely to write some really bad code that could have easily been avoided by learning a little lower level language first.

Well I started as a graphic designer then as web intrigued me more, I dived into it w/o really knowing where to start. Thus creating much more work for myself since I had to go back to the fundamentals and know the steps. As in not using HTML as design and mainly CSS, How to code to standard, Wireframes, but now that I’ve been playing with all this for a good amount of time…it kind of bores me because HTML/CSS doesn’t have much power at all and I spend most of the time creating a website, repeating many things over and over again as you stated.

One thing I would recommend is before jumping into PHP learn either C++ or Java to get some fundamentals down.If you just dive into PHP your likely to write some really bad code that could have easily been avoided by learning a little lower level language first

Now this is where you lost me, I have some information on C++ but I haven’t really looked into it. I assumed C++ was more advanced then PHP and that PHP was really the fundamentals of programming. Now besides the fact of which language was created first, why do you suggest C++ or Java to start out learning over PHP?

Starting with an older and stricter language can definitely make sense, as it will teach you more about why the computer acts the way it does. Some of the best programmers in the world are the ones who started out learning how to code in assembly, simply because they had to know exactly what was happening to make their code work. I’m not suggesting going this far, but it does make sense to learn how to solve some problems in a language with fewer build-in functions and libraries, simply because it forces you to think about what you are doing, rather than looking up the appropriate function.

I would, but I’m a …

Conversely in a language with as many functions as PHP, it often helps to look up the function instead of trying to brute force it… I end up seeing that a lot lately, people brute forcing things PHP already has code to handle… in an INTERPRETED language system code (built in library functions) are ALWAYS faster than user code… See the extreme paranoia about regex, where I’ve seen people replace single line regex with 30 lines of code using two or three loops – because that’s going to be SO much faster…

But there is a lot ‘under the hood’ of how high level languages work that many coders today are blissfully unaware of, as evidenced by their fat bloated and often nonsensical code. There was a thread I was posting in not to long ago where someone was shocked at the concept of “calling a function for a single evaluation is a waste of code” – for example:


public function isFull() {
  return $this->value >= $this->max;
}

if ($myObject->isFull()) {

For us old timers that’s a “well DUH” moment – the overhead of saving the state, putting the values passed on the stack, making a far call, and then doing the reverse when finished is wasted overhead – AND it ends up more code.

You see that blunder in PHP all the time with people adding methods to do what should either be handled outside the object, or should be stored in a variable… the only excuse for the practice being if those properties are private – and that’s more a shortcoming of PHP’s sloppy handling of objects than good coding practice… but quite often those variables are public – in which case using that function is just banging the brakes on code execution. A C or Pascal programmer would backhand you for that.

Though I think it goes hand in hand with the new attitude of “who cares if it’s efficient or even good code, just throw more hardware at my ineptitude”. Some of the code I’ve seen lately I’ve been scratching my head and wondering if we’re back in 1980.

See, back in the day most mainframe programmers quoted their projects by the K-LoC… You got paid for every thousand lines of code. Naturally it wasn’t long before you had programs with as many lines of comments as they did code – or sloppy programming logic done intentionally to make the program as big as possible.

I’m seeing code lately that seems to be built on that philosophy, though it seems to be done more out of ignorance than intent. Simple stuff I was taught as programming 101 that people today have never even heard of… strict formatting to reduce errors, verbose function and variable names to reduce the need for comments and provide clearer code, formatting your output as clearly as your generation code to make debugging simpler – you get these snot-nosed punks today calling those things “arbitrary formatting” and “a waste of my time”, vomiting up code any old way and then wondering why it either doesn’t work, is riddled with bugs, or ends up so huge nobody is willing to sit there and actually use it.

Literally it reminds me of the very first software I wrote professionally – taking a 500K-LoC inventory management package that couldn’t even fit entirely in the PDP-11’s 256k of RAM, and rewriting it to fit into 32k of RAM multi-user capable so it could STAY in memory (basically I turned it into a glorified BBS)… Ah, the joys of working in DiBol.

Even simple concepts like “off the shelf user function libraries in an interpreted language are impractical at best, a disaster at worst”… remain as true today in PHP, Javascript and Perl as they did thirty years ago in Basic, Smalltalk and Fortran.

Even more so when it comes to many of these ‘improvements’ to the languages being as needlessly cryptic as Cobol prior to Cobol '85… At least C had the “one character at 150 baud” excuse for it; but really we’re talking the type of garbage code that should have gone the way of the dodo two decades ago… Many of the more cryptic languages (and yes, C++, I’m looking at you!) being harder to use and harder to follow than MACHINE LANGUAGE. As I’ve said many a time, I’d rather hand assemble 8k of Z80 machine language and enter it one bit at a time on toggle switches, than deal with 24 lines of C++ code.

It’s usually less work…

Dope. ^

deathshadow
I pretty much agree with everything. I would say it’s a combination of hype and inexperience. When CSS was the new black, some coders were swapping semantic elements for divs and spans. Likewise, someone who have learned that OOP is the only way to go, will make up loads of unnecessary objects and functions, without considering why they’re doing it.

(Oh, and by the way, if you want a cumbersome language, try TI-BASIC :wink: ).

Off Topic:

I have, it’s robust compared to the TRS-80 Level 1 Basic, or worse the Sinclair ZX-80.

Was one of the old jokes, a TI-59 was a more robust computing device than a ZX-80… though working inside a 4 bit processor was a stone cold PITA… Though still better than machine language on the Cosmac.