devwebee
|
12 years ago
|
on: What it's like to use Haskell
Vim is multi-platform, and there are GUIs for Vim, particularly GVim and Macvim, where you can use the mouse, and copy/paste, etc, just have to do it the Vim way. You gave up too early, Nano isn't even close; it's like comparing Notepad to Notepad++. Give both Haskell and Vim another chance.
devwebee
|
12 years ago
|
on: What it's like to use Haskell
I've seen experienced programmers failing at learning Haskell for the same reason experienced programmers fail at learning Vim, the initial learning curve is very steep, and they don't see the value on climbing that wall. Now, if you know Vim, ask yourself, was it worth it? I'm convinced 99% of people would say yes. It is the same with Haskell, all those seemingly complex concepts come with a big reward.
Learning Haskell is easier with a strong functional programming background; sadly CS students don't learn much about FP, so having lots of experience in CS and compilers won't necessarily put you in a better position than somebody who has no formal background in CS but lots of programming experience.
A math background on the other hand should help you. Learn about how category theory is applied in Haskell, and you're already half way there. Monads are just a piece of the puzzle.
I do agree with your last three points. I haven't used Haskell in production, so my experience in "real world Haskell" is limited, but it has helped me immensely in my daily work with other languages. Haskell forever changes the way you think and approach problems, just like Vim changes the way you write and edit code; it will make you a better programmer.
devwebee
|
12 years ago
|
on: How 13 programming languages got their names
Interesting title, too bad I've to click "next" fifteen times; lost interest; skip.
devwebee
|
12 years ago
|
on: Ask HN: I am a PHP Newbie, Why do most developers hate it
PHP can handle as well or better than Python and Ruby. The performance difference is not that important when choosing between these languages, because they are all slow anyway. If you compare PHP vs Java or Ruby vs NodeJS, then performance gain might be an important factor when choosing. Python is used more outside of webdev than PHP and Ruby, so that might be something to consider, because there are more libraries for making UIs, games, graphics, etc.
devwebee
|
12 years ago
|
on: Ask HN: I am a PHP Newbie, Why do most developers hate it
The problem with PHP is its design, or lack of it to be precise. It's inconsistent and quite verbose. But it's made for the web, so it's very easy to deploy, and the workflow is straightforward, put file in a folder on a server and refresh the page. If you're new to web development but already have some programming experience, PHP is a good language to learn because it's ubiquitous and very easy to get started. If you're new to programming, I'd suggest you learn Python first; it's a beautifully designed general purpose language, and will guide you through the right path before diving into the PHP jungle.
devwebee
|
12 years ago
|
on: Hack: a new programming language for HHVM
It looks promising, I highly dislike writing PHP and this seems like it might ease the pain, but they could've gotten rid of the damn dollar sign in front of variables, how ugly is this? "return ($y) ==> { return $y + 1; }"
devwebee
|
12 years ago
|
on: Show HN: Tired of doing coding interviews on Skype? We've built this
I noticed this too. Plus they're using a bad example. Looping an array with "for..in" in JavaScript is one of the most known antipatterns.
devwebee
|
12 years ago
|
on: Be brutally honest, would you use this site?
Yes, maybe, in the same way I would browse for random stuff on other places out of pure boredom, there are some interesting polls. But the site is too slow, it takes ~5sec to load, on my desktop, and the scrolling isn't smooth. Loading 50 jQuery libraries in the header plus some other 30 libraries in the footer don't help, it's killing the site... You need to concatenate and minify all that code, same with the CSS. And do some profiling. Ebay, arguably one of the biggest sites on the internet runs on ~80mb but your site uses up 130mb; you might have a memory leak.
devwebee
|
12 years ago
|
on: Beginner Web Design Mistakes
Yes, content first web design is good web design, not superfluous decoration.
devwebee
|
12 years ago
|
on: Ask HN: What's your favorite keyboard for programming?
Dell SK-8115 is a classic.
devwebee
|
12 years ago
|
on: The New Razer Blade
They are loading like 20 jQuery libraries in the header. Nothing is minified. By looking at the JS code here
http://assets.razerzone.com/eeimages/products/15348/js/templ..., it seems like they vomited jQuery on top of a PSD2HTML site. Bad indentation, bad class names like ".bar-prc1", ".bar-prc2", ".bar-prc3", no selector caching, no consitent usage of chaining, inconsistent style overall, in other words, a mess.
devwebee
|
12 years ago
|
on: Objects vs. Functions round 1: Currying vs. Instantiation
Not sure those two cases are really interchangeable. It doesn't seem like a very good example. By introducing an object that way you're coupling your functions that work on pure data to an instance. Now to multiply two numbers you need an instance of Calc. I'd suggest something like this instead:
var multiply = curry(function(x, y){
return x * y;
});
var add = curry(function(x, y){
return x + y;
});
var Calc = (function(){
function Calc(x){
this.x = x;
}
Calc.prototype.map = function(f){
this.x = f(this.x);
return this;
};
return Calc;
}());
new Calc(2).map(compose(add(2), multiply(4)));
// or
new Calc(2).map(multiply(4)).map(add(2));
devwebee
|
12 years ago
|
on: 7 KB front-end framework with many common features
TBH, it doesn't look too good. The syntax is all over the place, bad indentation, missing semicolons, a loop variable is leaking, it doesn't follow common conventions... But don't give up, keep improving your skills. Here's a replacement for that monstrous "getURLParameters" to pique your curiosity that can save you a few more lines:
function getURLParameters(url) {
var res = {},
re = /[?&]([^?&]+)=([^?&]+)/g;
url.replace(re, function(_,k,v) {
res[k] = v;
});
return res;
}
Then use it like "getURLParameters(window.location)".
Also just a tip in general, if you're up for some more constructive criticism I'll rewrite your "hasclass" function following conventions. So it goes from this:
function hasclass (el, className) {
if (el.classList)
return el.classList.contains(className);
else
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
}
To this:
function hasClass(el, className) {
if (el.classList) {
return el.classList.contains(className);
}
return new RegExp('(^| )' + className + '( |$)', 'gi').test(el.className);
}
Notice the camel casing in "hasClass", the braces around "if", and the early return.
devwebee
|
12 years ago
So what kind of object is a multiplication, or an addition? Monoid has "no real good real-world parallel" because it is not a real-world concept. -- "It has no related or relevant meaning outside of very, very specific contexts" -- Well, that's the very nature of these abstractions; they apply to many many contexts, when working with data.
devwebee
|
12 years ago
|
on: German freemail sites trick Firefox and Chrome users into removing AdBlock
I completely agree. You're not losing me because I would've never clicked. If I want something, I go look for it myself. I don't understand why people try to make this a morality issue. You shove ads in my face, I block them, simple as that.