Skip to content

u/SethKinast

In this archive from May 2011 to Jun 2014

0
posts
20
comments
0
media
42
score

They're supposedly working on a redesign at the moment, but I agree.

And yep, a website is tied to a (sub)domain. Each website can contain multiple apps in subdirectories, though you'll often just mount one app to /

This makes it easy to blow an app away and replace it.

1 points

Gah. Please take this code out back and shoot it. At least printf() so you can make it generic.

// get rows or something
foreach($row as $num => $r) {
printf('<td class="row%d">%s
<input type="hidden" name="originator_%s" value="%s" />
</td>',$num,$r['name'],$r['type'],$r['value']);
}

Ugly so I can compact it for posting on Reddit but you can heredoc a template and such to make it clean and easy to follow.

1 points

I dunno where you're working, but if you have even basic PHP chops you should probably be making more than this. What area of the country?

One of your greatest strengths as a PHP programmer should be your flexibility. PHP is so tightly coupled to HTML that you should really have excellent HTML / CSS / JS+jQuery skills to be "the whole package", as it were. This will make you very valuable to lots of different people.

2 points

Python makes it much easier to write good code by enforcing a lot of good practices that PHP will wink and let pass. It also has a lot of really awesome datamunging ability that takes several times the code in PHP.

That said, it is not a web language first-and-foremost, as PHP is. So you'll need a web framework to take care of things that PHP handles for you. Most common: web2py, Django, Flask, Pylons.

PHP lets you drop in some code into an HTML file and run with it in five minutes. It's easier by far to get started since it was designed for the web. Python is more flexible (and I think it's hella fun to write) but it takes a lot of getting used to if you just want a quick-and-dirty app.

Learn both if you want, I did. I would pick PHP first, though.

1 points

Frameworks are very nice (CakePHP, Kohana, Zend) but they hide some of the low-level implementation. It's really a distinction of whether you need to learn PHP, or a framework built on PHP.

I can't find the specific article I'm thinking of, but there was a discussion recently that frameworks should be used to ease the pain of the developer implementing a login system for the nth time, not to provide a drop-in black box that you use without knowing the details.

PHP of all languages is so friendly to use. This also means you can pick up bad practices easily, because it's so forgiving.

I would at least do some projects on your own that implement your own login functions, say, before just using a framework. For many small sites, that could be all you need. If you're eventually looking to do something more enterprise-y a framework helps alleviate much of the repetitive heavy lifting.

2 points

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.