News for hackers. Stuff that matters.
Re:PracticeJS – Coding exercises in a mobile friendly web app by wcchoi on Sunday June 09, 2019 @01:37AM (#20137336)
I think coding on a phone is doable if we "rethink" the keyboard part.

I've built a PoC (also a Web app, but requires a backend), video demo here:

https://vimeo.com/339574087

The neat thing is that all the heavy-lifting of syntax highlighting, autocomplete, etc are done by Vim, so I don't need to port everything to the front-end.

Re:PracticeJS – Coding exercises in a mobile friendly web app by the_pwner224 on Saturday June 08, 2019 @07:44PM (#20135959)
This seems very similar to codingbat.com. My CS teacher in high school made me do codingbat and it was very helpful; I could see this site doing the same for JS learners. Codingbat is not as mobiles optimized but is still usable on my phone. As another commenter mentioned, some important differences are:

Number of problems, sorted into levels of difficulty / focus areas (this has only one problem that I would consider 'hard')

Help (not just solution) is available to those who want it

Helpful error messages

Syntax highlighting

That said, I really like the interface here. It works well on my phone and looks nice on a desktop, and is straightforward and simple. The only issue is that keyboard auto capitalization/autocorrect gets annoying to deal with on a phone. Hacker's Keyboard (free software Android keyboard) could help with that; it would be nice to have a link to something like that for Android+iOS on the website.

Re:PracticeJS – Coding exercises in a mobile friendly web app by gwillz on Saturday June 08, 2019 @08:05PM (#20136057)
Auto capitalization can also be fixed with a cheeky little `autocaptialize="off"` attribute.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_att...

Re:PracticeJS – Coding exercises in a mobile friendly web app by tinalong on Saturday June 08, 2019 @10:40PM (#20136711)
I'm not convinced coding on a phone will ever be a thing. I've tried a few challenges on my phone while interviewing and it was just a clunky and slow experience
Re:PracticeJS – Coding exercises in a mobile friendly web app by untog on Sunday June 09, 2019 @12:39AM (#20137153)
I don't think coding an entire app ever will be. But mini training exercises? Maybe.
Re:PracticeJS – Coding exercises in a mobile friendly web app by wolco on Sunday June 09, 2019 @12:49AM (#20137187)
AWD editor has a built in sftp plus something like juicessh for command line server access makes it not too bad even on a small phone.
Re:PracticeJS – Coding exercises in a mobile friendly web app by ricklamers on Sunday June 09, 2019 @04:31AM (#20137972)
I like the initiative, but the 'editor' on desktop is just an input field. Would have benefited from something like Ace Editor or CodeMirror.
Re:PracticeJS – Coding exercises in a mobile friendly web app by stevewodil on Saturday June 08, 2019 @06:43PM (#20135699)
Not sure what the test cases are for the Fibonacci sequence (just happened to pick that one first), but it gives an error for my code, and I'm not able to figure out why. (please ignore my bad variable names)

  function(index) {
   var fib = [0,1];
   for(var i=2; i<index; i++){
     fib[i]=fib[i-2]+fib[i-1];
   }
   return fib[index-1];
  }
Re:PracticeJS – Coding exercises in a mobile friendly web app by viceroyalbean on Saturday June 08, 2019 @06:51PM (#20135741)
Your function will return 2 for index = 4, whereas it's expecting 3.
Re:PracticeJS – Coding exercises in a mobile friendly web app by stevewodil on Saturday June 08, 2019 @11:13PM (#20136858)
Then are the instructions not clear enough, or am I just missing something....

From the website: "For example, the sequence [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] forms the first ten entries of the Fibonacci sequence." Entering 4 should return 2 in this case, which is correct? I don't get it.

Re:PracticeJS – Coding exercises in a mobile friendly web app by fwip on Sunday June 09, 2019 @01:38AM (#20137342)
Index 4 is the fifth element, 3. Index 0 is the first element (a zero).

Reread the examples.

Re:PracticeJS – Coding exercises in a mobile friendly web app by stevewodil on Sunday June 09, 2019 @09:56AM (#20139200)
Hmm...I see. Thank you for the help!
Re:PracticeJS – Coding exercises in a mobile friendly web app by obituary_latte on Sunday June 09, 2019 @07:16AM (#20138484)
1) would benefit from some kind of keyboard help so that it’s not capitalizing every first character.

2) getting errors when trying to use single or double quotes which makes things difficult:

>SyntaxError: Invalid character '\u201c

Otherwise, nice work.

Re:PracticeJS – Coding exercises in a mobile friendly web app by tianshuo on Sunday June 09, 2019 @06:05AM (#20138244)
The test cases for the Fibonacci sequence is terribly bad, you can cheat by returning fn = n=>[0, 1, 1, 2, 3, 5, 8, 13, 21, 34][n] You need random test cases and larger test cases.

Codewars is definitely better than this.

Re:PracticeJS – Coding exercises in a mobile friendly web app by albertgoeswoof on Saturday June 08, 2019 @06:54PM (#20135749)
Neat! Are there any programming keyboards for iOS out there that help with common operators /characters?

Can you add syntax highlighting to this?

Re:PracticeJS – Coding exercises in a mobile friendly web app by jbaber on Saturday June 08, 2019 @08:29PM (#20136152)
Messagease is really good for coding and typing at a shell prompt, etc.
Re:PracticeJS – Coding exercises in a mobile friendly web app by gravypod on Saturday June 08, 2019 @07:09PM (#20135807)
Seems very procedural-oriented. Would be really cool to see a procedural and functional orient solution.
Re:PracticeJS – Coding exercises in a mobile friendly web app by tdhz77 on Saturday June 08, 2019 @06:28PM (#20135620)
Terse and you don’t learn anything. You should build levels and offer explanations to YOUR code.
Re:PracticeJS – Coding exercises in a mobile friendly web app by tinalong on Saturday June 08, 2019 @10:33PM (#20136675)
algodaily.com has some really good explanations