Skip to content

Commit 8d415b4

Browse files
committed
Update site
1 parent 923d3fa commit 8d415b4

File tree

3 files changed

+45
-14
lines changed

3 files changed

+45
-14
lines changed

_octopress/source/_includes/custom/navigation.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,4 @@
33
<li><a href="{{ root_url }}/blog/archives">Blog</a></li>
44
<li><a href="{{ root_url }}/functions">Functions</a></li>
55
<li><a href="{{ root_url }}/authors">Authors</a></li>
6-
<li><a target="_blank" href="https://github.com/kvz/phpjs/wiki/_pages">Wiki</a></li>
7-
<li><a target="_blank" href="http://twitter.com/phpjs">@phpjs</a></li>
8-
<li><a target="_blank" href="http://identi.ca/brettz9">@brettz9</a></li>
9-
<li><a target="_blank" href="http://twitter.com/kvz">@kvz</a></li>
106
</ul>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
layout: post
3+
title: "Coding style"
4+
date: 2013-05-04 18:01
5+
comments: true
6+
categories: [coding style, convention]
7+
---
8+
9+
Given [the focus of php.js](/blog/2013/05/03/a-word-on-the-focus-of-php-dot-js/) I think
10+
we should re-invent as few wheels as possible and make use of sensible tools
11+
and standards that are other people have already invested a great deal of time
12+
in to get right.
13+
14+
In this light, I've decided to adopt [Felix' Node.js Style Guide](http://nodeguide.com/style.html)
15+
for coding standards, instead of maintaining our own.
16+
17+
It saves us time maintaining and it becomes easier for people to contribute because
18+
they don't have to memorize php.js' own where we diverge.
19+
20+
For the most important parts, our codebase is already compatible with it, so
21+
we won't get any weird space+tab indentations as a result.
22+
23+
Going forward, contributions should comply with these conventions before being
24+
merged in.
25+
26+
27+
Best wishes,
28+
29+
[Kevin](http://twitter.com/kvz)

_octopress/source/about/index.markdown

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ alias:
1111

1212
php.js is a resource that offers community-built JavaScript alternatives to PHP functions.
1313

14-
If you want to perform high-level operations on JavaScript platforms such as
15-
webbrowsers, node.js, etc, you probably need to write JS that combines its
16-
lower-level functions and build it up until you have something useful like:
14+
**Why on earth would you port php to js?**
15+
16+
- to see if we can
17+
- to learn JavaScript
18+
- to help others learn JavaScript
19+
- to see how a php program performs with V8 strapped on it's back
20+
- to run & debug php code in the browser
21+
- to profit from helpful functions like:
1722
[strip_tags](http://phpjs.org/functions/strip_tags/),
1823
[strtotime](http://phpjs.org/functions/strtotime/),
1924
[strftime](http://phpjs.org/functions/strftime/),
2025
[number_format](http://phpjs.org/functions/number_format/),
21-
[wordwrap](http://phpjs.org/functions/wordwrap/), or
22-
[date](http://phpjs.org/functions/date/).
26+
[wordwrap](http://phpjs.org/functions/wordwrap/),
27+
[vsprintf](http://phpjs.org/functions/vsprintf/), and
28+
[date](http://phpjs.org/functions/date/), that are too high-level for JavaScript.
2329

2430
PHP is a language with many high-level functions and while they're not always
2531
implemented as consistently as we'd like (mimicking their underlying C parts),
@@ -28,13 +34,13 @@ or abstractions.
2834

2935
We recognize JS has beautiful language features, and we encourage you to learn them.
3036
Never let php.js be an excuse not to. For the this reason we don't offer
31-
gigantic php.js packages or compilers anymore.
37+
gigantic php.js packages or compilers.
3238

3339
That said, we do think it's a challenge to port everything and decided to also port
3440
low-level PHP functions like
3541
[strpos](http://phpjs.org/functions/strpos/)
36-
even though it has a perfectly fine (and more performant!) JavaScript
37-
counterpart ([String.indexOf](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf)).
42+
that have a perfectly fine (and more performant!) JavaScript
43+
counterparts ([String.indexOf](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf) in this case).
3844

3945
Besides the geeky-challenge of seeing how far we could come, porting ALL THE THINGS also
4046
opens up php.js to other fun experiments such as realtime in-browser debugging/running of
@@ -50,12 +56,12 @@ And what not.
5056

5157
Going by [The McDonald's Theory](https://medium.com/what-i-learned-building/9216e1c9da7d)
5258
we have plently of functions here online that aren't perfect just yet.
53-
If you know how to improve, just send us a pull request on GitHub.
59+
If you know how to improve, just send us a pull request on GitHub!
5460

5561
## Contributing
5662

5763
We use [GitHub](http://github.com/kvz/phpjs) for collaboration. Comments are for remarks only.
58-
Please adhere to our [coding standards](https://github.com/kvz/phpjs/wiki/DeveloperGuidelines) before
64+
Please adhere to our [coding standards](http://nodeguide.com/style.html) before
5965
sending a pull request.
6066

6167
## Licensing

0 commit comments

Comments
 (0)