Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Komag
Roku Guru

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 28
sjb64
Roku Guru

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.
0 Kudos
Romans_I_XVI
Roku Guru

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
Roku Guru

Re: How long is your code?

That's got about 2000 lines all together, and it's nice to see the code, thanks! 🙂
0 Kudos
destruk
Streaming Star

Re: How long is your code?

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

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
Visitor

Re: How long is your code?


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


--Mark
0 Kudos
EnTerr
Roku Guru

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
Channel Surfer

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
Roku Guru

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.