News for hackers. Stuff that matters.

twii

Re:5 GPU Ethereum Mining Rig Build Guide on Thursday August 17, 2017 @06:10AM (#15035268)
Quite funny the whole thing is about 5 GPU's and the image on the repo shows 6.

There are too many good guides on the internet already, this one doesn't even come close providing all needed info. But I see the author has put his ether account address in the build string, that might be the main reason for this post.

Btw, don't go mining on linux with nvidia, it's really bad advice as overclocking all cards can take days to get it working if ever! Just use Windows for nvidia, it's a breeze to setup and you'll get overclocking for all cards out of the box.

Re:Being Thankful for Free Software Developers on Monday August 14, 2017 @04:15AM (#15007238)
I hope crypto currencies will eventually enable people and companies to more easily donate with micro payments to free software developers without the need for the greedy/stealing paypal or other banks.

I have dozens of free/open-source projects that make me 0 dollars while some of them are being used quite a bit. I currently cannot find spare time to improve on those projects because I need to work for a company to pay the bills..

I would love to have some income out of it, but I refuse to use paypal. First they take a proportional part of the sum as fee, second they take another proportional part by making up their own exchange rates for converting currencies. I refuse to support those companies and I truly hope crypto currencies will nullify them.

Re:Small functions considered harmful on Friday August 11, 2017 @08:37AM (#14988992)
So, the author thinks this is harmfull?:

  var area= ( width, height ) => width * height;
If not, it is just clickbait for me.
Re:JavaScript for People Who Hate JavaScript on Wednesday August 09, 2017 @05:28AM (#14966891)
Omg, so this guy thinks he knows why I'm hating Javascript? Well, it's definitely not because of the lack of types, or because without Prettier my code looks shit, neither would it be the lack of E6/ES7 features since I'm using Coffeescript 2. No, I hate Javascript especially for it's conitnuously changing ecosystem being forced upon you. You named Dan Abramov? Ah, the guy who deprecated almost all flux in favor of his own idea (Redux), or by deprecating React Mixins, because he thinks Mixins are bad, Higher Order Components is the new holy grail?

If I am looking for a job as a Javasript developer at the moment it is not about my coding skills, it is about my willingness to adopt all those hyped technologies, and the author of this article is just making it worse.

I also hate Javascript for all those people reading this that think I don't understand it yet, and are going to explain me how great ES6/ES7, Promises, and/or Typescript are. Please don't.

Re:Complex animated transitions in React on Tuesday August 08, 2017 @04:50PM (#14962532)
Interesting. How many kb's will be added to your bundle, including dependencies?
Re:Javascript Arrays and Functional Programming on Thursday August 03, 2017 @09:43AM (#14919479)
As mentioned in one of the comments, this is nowhere near the definition of functional programming.

> It beats complex for-loops

Nvm. I still prefer for loops in most cases, in some way it's easier to understand for me if I read it some months later. For example the reduce function I would write something like this:

  getPlayersByCountry= ( footballPlayers= [], players= {} ) ->
    for player in footballPlayers
      if players.hasOwnProperty player.country
        players[ player.country ].push player
    return players

  playersByCountry= getPlayersByCountry footballPlayers, {France: [], England: [], Spain: []}
I guess it's mere a matter of taste.
Re:Proposal for a Binary Encoding of the JavaScript AST on Wednesday August 02, 2017 @03:54AM (#14908713)
> For parsing desktop facebook.com, 10-15% of client-side CPU time is spent parsing JavaScript. The prototype we implemented reduced time to build the AST by 70-90%.

Whatever the win from their prototype, it should never be a reason to change core Javascript like .toString(). A facebook representative in this little proposal club doesn't feel good. My first thought was: please optimise your own codebase and don't break other people's code for your own profit.

Depends also on what job I guess?
Re:Deadmau5's mansion and its tech setup [video] on Friday July 07, 2017 @01:59PM (#14720521)
Looks a bit like one of JunkyXL's setups. Fortunately for mankind there is no way you can make better music with a setup like this compared to a poor man's basic setup. Most 'poor' people are lost when they happen to become 'rich'. It's a (mouse) trap. You'll see this over and over again..
Re:Mastering Programming (2016) on Friday July 07, 2017 @11:44AM (#14719268)
Good post with loads of valuable points.

This document clearly shows that "master" programmers focus on very different things than a beginner might expect. A beginner can get really excited and proud making something complex work without noticing the flaws. After years of debugging your own code you'll find out that getting complex things done is not really the issue, it is HOW it's being done that makes the difference.

Beginners tend to focus on new language features, premature optimisations, having unnecessary strong opinions about wether using a for loop or map or reduce etc.., using too many and buggy libraries, literally copy and use code from others without noticing it's flaws, getting pride from writing complex code that almost no one can understand, trying to beat the calculator, trying to beat Google with your own memory, over estimating the value of linters, CI, TDD, agile, what editor to use, etc.., etc...

All these things take up so much space and energy at the cost of what really matters if you want to do what a master does: write bug free code that is easy to maintain and a joy to read.

Re:EU Parliament calls for longer lifetime for products on Wednesday July 05, 2017 @01:58PM (#14704709)
Finally.. Although I am not optimistic about seeing results soon. Companies will go to extremes to circumvent such rules.

But it's shocking to see their lack of insight:

> software should be easier to repair and update

ROFL!

Re:I'm not a Woman in Tech on Wednesday July 05, 2017 @12:20PM (#14703714)
I cannot agree more with you! Besides, if men think they are better in tech, why do I see so much rubbish code produced by them?

Imao it's just men's ego's, sexism and stupidity that creates this discrimination. It's abject and should change, the sooner the better! (I'm not female btw)

Re:Why You Should Hire an Old Programmer on Monday July 03, 2017 @10:57AM (#14688665)
What a ridiculous assumption. It is not about age! I've seen both young and old horrible coders. Of course you can have a slight advantage from experience if your'e older, but the quality of that experience remains relative to the person in question. You might have 10 years of experience doing things the wrong way!

Growing older doesn't make you a 10x dev, just as it won't make an average musician a superstar.

Re:Node v8.0.0 Released on Wednesday May 31, 2017 @06:06AM (#14451383)
> Whenever you program in ECMAScript2016("Javascript"), you should take advantage of its features.

That's a trap, I should rather make my code as readable, scalable and bug free as possible regardless of ESxxx.

I can refactor in 10 other ways (different styles) coming to the same result, but that's not what my point was about. Using promises and so is just taste or preference, if you like it you use can it, if not do without. I've seen amazing spaghetti with promises and callbacks as well.

Easy to nitpick btw:

you compare err != null?? besides not using strict mode, what should err be? a String? So, what will happen if err is undefined or an empty String?

Then you call logFsResult with err while it is not used.. Did you even consider what happens if the value of type is not available in map_action? I'll be the end of the feast!

last one: True and False as an object key are not Booleans, so if you have your IDE up and running, the code will fail.

Now, you can try to solve this with promises, just as you can try brush your teeth with a broomstick.

Re:Node v8.0.0 Released on Tuesday May 30, 2017 @07:55PM (#14449546)
You assume a lot.

We can refactor another round:

  function logFsResult( type, err ){
  	var msg= '';
  	switch ( type ) {
  		case 'append': msg= ( err ) ? 'Failed to update file' : 'Successfully updated file';
  			break;
  		case 'write': msg= ( err ) ? 'Failed to write file' : 'Successfully created file';
  			break;
  		default: msg= 'logFsResult error, missing or invalid first argument: '+ (type || '')
  	}
  	( err ) ? console.err( msg ) : console.log( msg );
  }

  function handleFile( filename, fileExists ) {
  	const timestamp = new Date().toISOString();
  	( fileExists )
  		?	fs.appendFile( filename, `Updated file on ${timestamp}\n`, logFsResult.bind(null, 'append') )
  		:	fs.writeFile( filename, `Created file on ${timestamp}\n`, logFsResult.bind(null, 'write') );
  }
Re:Node v8.0.0 Released on Tuesday May 30, 2017 @05:50PM (#14448829)
nah, this is valid javascript, Go came later, they might have copied a thing or 2 from C, like javascript did.
Re:Node v8.0.0 Released on Tuesday May 30, 2017 @05:46PM (#14448798)
No, it's not a joke. A junior dev can read this code and it will be very hard to create bugs.

Inlining with arrows is just a more functional approach, as I would write in Coffee:

  exists filename, (fileExists) -> handleFile filename, fileExists
Anything wrong with that line of code?

I just try very hard to keep my code as simple as possible.

I hope you know it's trivial to write a log function that accepts different callees so you end up with only 1 'if (err)'.

I didn't test, but I wouldn't be surprised if my example runs times faster as well btw.

Re:Node v8.0.0 Released on Tuesday May 30, 2017 @04:59PM (#14448492)
I still don't get the need for Promises.. Almost all examples, just like this one in the provided link, talk about solving callback hell with Promises, while callback hell is just a bad way of writing software imao. Look at the code below and please tell me why your example with Promises is a better solution.

  function logAppendResult( err ) {
  	if (err) console.err('Failed to update file');
  	else console.log('Successfully updated file');
  }

  function logWriteResult( err ) {
  	if (err) console.err('Failed to create file');
  	else console.log('Successfully created file');
  }

  function handleFile( filename, fileExists ) {
  	const timestamp = new Date().toISOString();
  	( fileExists )
  		?	fs.appendFile( filename, `Updated file on ${timestamp}\n`, logAppendResult )
  		:	fs.writeFile( filename, `Created file on ${timestamp}\n`, logWriteResult );
  }

  function main() {
    const filename = './example.txt';
    exists( filename, (fileExists) => handleFile(filename, fileExists) );
  }
Re:Switching From React To Vue.js on Sunday May 28, 2017 @07:42AM (#14433990)
Working with React for almost 3 years now. Came from Angular, Bootstrap, jQuery, etc.. Done small and very large projects with it. It scales better than anything I've used before. It's amazingly reliable and robust.

Looking at Vue I cannot think of 1 single benefit I gain by switching. It doesn't even come close to what React is capable of imao. I really have no clue why people are pushing this at all.. Are there any examples of large projects that switched from React to Vue without suffering a loss?