Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Komag
Level 9

How long is your code?

I know the same program written crapily can take double the code length, but assuming we're all being at least somewhat efficient and reasonable, how long is your code?

Currently my game is about 7600 lines long, and weighs 440k of code, about HALF of which is comments! So probably about 200k+ of real code.

I "think" I'm about half done, but it's really hard to say.

So I'm curious how that compares to what's out there. I assume regular channels would usually be smaller than a game, but I guess I don't really know. This is my first real programming, so it still might be pretty bloated, though I've tried to kill off any repeated code if possible with good use of loops or functions.
0 Kudos
28 Replies
sjb64
Level 7

Re: How long is your code?

Our FlixRaider channel is right about 3,000 lines, with various text file contents (about us, announcements, etc.) stored externally, so the 3,000 lines is pretty much just code. But a third of that is probably deserialization routines in the data access layer, so maybe 2,000 lines of actual operations code.
FlixRaider channel
0 Kudos
Romans_I_XVI
Level 7

Re: How long is your code?

If you're wanting to compare you can view Retaliate here. https://github.com/Romans-I-XVI/Roku-Retaliate-Channel-Open-Source

Although I haven't updated that since all the recent changes.
0 Kudos
Komag
Level 9

Re: How long is your code?

That's got about 2000 lines all together, and it's nice to see the code, thanks! Smiley Happy
0 Kudos
destruk
Level 10

Re: How long is your code?

For a complete roku channel which loads a single live stream for playback, 50 lines.
0 Kudos
EnTerr
Level 8

Re: How long is your code?

"destruk" wrote:
For a complete roku channel which loads a single live stream for playback, 50 lines.

Can you make it a 1-liner? #CodeGolf FTW!
0 Kudos
RokuMarkn
Level 7

Re: How long is your code?


u=CreateObject("roUrlTransfer") : u.SetUrl("http://where/my/code/is") : Eval(u.GetToString())


--Mark
0 Kudos
EnTerr
Level 8

Re: How long is your code?

"RokuMarkn" wrote:
u=CreateObject("roUrlTransfer") : u.SetUrl("http://where/my/code/is") : Eval(u.GetToString())

LOL #NoFair
That's like saying "10 LIST" is a legal quine (self-printing program).
A legit one-liner can be done though, right? Just have to avoid loops and IFs.
0 Kudos
TheEndless
Level 7

Re: How long is your code?

"EnTerr" wrote:
A legit one-liner can be done though, right? Just have to avoid loops and IFs.

Does this count?
Sub Main():screen=CreateObject("roVideoScreen"):screen.SetContent({StreamFormat:"hls", Stream:{Url:"http://media.heywatch.com.s3.amazonaws.com/hls/big_buck_bunny/big_buck_bunny.m3u8"}}):screen.Show():While True:End While:End Sub
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
EnTerr
Level 8

Re: How long is your code?

"TheEndless" wrote:
"EnTerr" wrote:
A legit one-liner can be done though, right? Just have to avoid loops and IFs.

Does this count?
Sub Main():screen=CreateObject("roVideoScreen"):screen.SetContent({StreamFormat:"hls", Stream:{Url:"http://media.heywatch.com.s3.amazonaws.com/hls/big_buck_bunny/big_buck_bunny.m3u8"}}):screen.Show():While True:End While:End Sub

Abso-censored-lutely, provided it runs. My bad, i thought the loops have the IF statement problem.
Can lose the Sub Main(): ... :End Sub brackets btw (courtesy of SquirrelTown and RokuMarkn)
0 Kudos