init
This commit is contained in:
commit
a181ac5b6e
5 changed files with 151 additions and 0 deletions
18
config.toml
Normal file
18
config.toml
Normal file
|
@ -0,0 +1,18 @@
|
|||
# The URL the site will be built for
|
||||
base_url = "https://pythonlang.org"
|
||||
|
||||
# Whether to automatically compile all Sass files in the sass directory
|
||||
compile_sass = true
|
||||
|
||||
# Whether to build a search index to be used later on by a JavaScript library
|
||||
build_search_index = false
|
||||
|
||||
minify_html = true
|
||||
|
||||
[markdown]
|
||||
# Whether to do syntax highlighting
|
||||
# Theme can be customised by setting the `highlight_theme` variable to a theme supported by Zola
|
||||
highlight_code = true
|
||||
|
||||
[extra]
|
||||
# Put all your custom variables here
|
50
content/_index.md
Normal file
50
content/_index.md
Normal file
|
@ -0,0 +1,50 @@
|
|||
+++
|
||||
title = "Why python is a bad language"
|
||||
+++
|
||||
|
||||
{{ sec_header(name="Weird Syntax") }}
|
||||
- It is hard to read, because it is missing semicolons and braces.
|
||||
- Indentation as a syntactical element is just silly. This takes away freedom from the developer and makes the code less readable without any benefit.
|
||||
- Indentation-dependant scopes make multiple statements on one line look horrible.
|
||||
- Doc comments
|
||||
- They use triple quotes which doesn't make sense for a comment.
|
||||
- They go under what they are documenting, which looks wrong and is very unusual.
|
||||
- They are technically not comments, which is a terrible idea.
|
||||
- They are accessible at runtime, but shouldn't since this encourages spaghetti code.
|
||||
- The `def` keyword does not imply a function, so one may think it is declaring a variable, or something else.
|
||||
- Strange naming
|
||||
- `__init__` or `__add__` looks like an internal function. That these define operators looks like someone was too lazy to do this properly (yet again!).
|
||||
- Exception handling using `raise` and `except` instead of the usual `throw` and `catch`. There is literally no point to do this, and it confuses users.
|
||||
- Same goes for `elif` instead of `else if`. This is just pointless, and again looks like a lazy implementation.
|
||||
- Strange symbols
|
||||
- `not`, `and` and `or` instead of the more conventional and cleaner looking `!`, `&&` and `||`.
|
||||
- Normal `if` and `else` statements are not expressions. If they were, the additional ternary operator syntax would be completely redundant, and the code would be cleaner.
|
||||
- The syntax for inheritance looks really confusing. `Foo(Bar)` looks like `Foo` has a constructor that takes a `Bar` as an argument, and not like `Foo` extends `Bar`.
|
||||
- For some reason, the `pass` keyword exists. Why can't we just leave the block empty or omit the `:`? Yet another lazy implementation!
|
||||
- The recently added `:=` (assignment expression) operator exists, instead of simply making the normal assignment (`=`) an expression.
|
||||
|
||||
{{ sec_header(name="Lacking Features") }}
|
||||
- Lambdas are a poorly implemented afterthought.
|
||||
- There is absolutely no `switch` statement or anything along those lines, leading to absolutely **HUGE** `elif` blocks!
|
||||
|
||||
{{ sec_header(name="Intepreter") }}
|
||||
- Intepreters lead to runtime errors which could otherwise be detected at compile time. This often causes bad errors to make it into production due to untested edge cases.
|
||||
- **Very bad** performance.
|
||||
- Python is hard to package. Of course tools exist that can do it, but they are slow and large as they always include the interpreter as opposed to compiling the code or using some sort of faster intermediate language. Packaged python also includes the source code, which may be undesirable.
|
||||
|
||||
{{ sec_header(name="Dynamic Typing") }}
|
||||
- Passing an invalid type into a function may cause unpredictable behaviour. Manual type checks are annoying, and type hints are still just hints.
|
||||
- It is often unclear what type a function is expecting, thus it can be hard to know how to call it, especially if it is undocumented.
|
||||
- A function can return whatever type it wants, so it is hard to work with and unpredictable.
|
||||
- Variables don't need to be declared. This leads to many issues, such as accidentally overwriting other variables with the same name, or typos going undetected.
|
||||
- A variable's type may be changed after its assignment, making it harder to work with.
|
||||
|
||||
{{ sec_header(name="Poorly done Classes") }}
|
||||
- The `self` parameter being passed into functions explicitly is pointless boilerplate. Instead it should just be there implicitly, and static functions should be declared with a keyword such as `static`.
|
||||
- Fields do not need to be declared. This leads to issues mentioned before. It also makes the data a class stores undefined, making it harder to work with. It is recommended to declare fields, but unfortunately not enforced.
|
||||
- Enums are basically just classes, and are yet another lazy afterthought.
|
||||
|
||||
{{ sec_header(name="Other Issues") }}
|
||||
- Strings can be evaluated as code, encouraging spaghetti.
|
||||
- Doc comments are available at runtime using `help(element)`. This also encourages spaghetti
|
||||
- The command line REPL prints `Use exit() or Ctrl-Z plus Return to exit` for no reason, instead of simply exiting.
|
63
sass/index.scss
Normal file
63
sass/index.scss
Normal file
|
@ -0,0 +1,63 @@
|
|||
body {
|
||||
background-image: linear-gradient(#1e415e, #2b5b84);
|
||||
background-color: #2b5b84;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
color: white;
|
||||
font-family: Arial,sans-serif;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 70%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
#content * {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#content code {
|
||||
color: #0c0;
|
||||
}
|
||||
|
||||
#main_header {
|
||||
text-align: center;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
#python-logo {
|
||||
float: left;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.sep {
|
||||
position: relative;
|
||||
border: none;
|
||||
height: 12px;
|
||||
background: #222222;
|
||||
margin: 20px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.sec_head_hr {
|
||||
display: block;
|
||||
height: 1px;
|
||||
border: 0;
|
||||
border-top: 1px solid #caccce;
|
||||
margin: 1.75em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.sec_header {
|
||||
color: #eee;
|
||||
font-size: 1.5em;
|
||||
margin-top: 1.3125em;
|
||||
margin-bottom: .32813em;
|
||||
text-align: center;
|
||||
font-size: 35px;
|
||||
}
|
18
templates/index.html
Normal file
18
templates/index.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="index.css" />
|
||||
<meta charset="utf-8" />
|
||||
<title>This is Python</title>
|
||||
<link rel="icon" type="image/x-icon" href="https://www.python.org/static/favicon.ico">
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="python-logo"><img src="https://python.org/static/img/python-logo.png" alt="python™"></h1>
|
||||
<h1 id="main_header">{{ section.title | safe }}</h1>
|
||||
<br />
|
||||
<hr class="sep" />
|
||||
<div id="content">
|
||||
{{ section.content | safe }}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
2
templates/shortcodes/sec_header.html
Normal file
2
templates/shortcodes/sec_header.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
<h2 class="sec_header">{{ name }}</h2>
|
||||
<hr class="sec_head_hr" />
|
Loading…
Reference in a new issue