I want to learn programming in my spare time...

I want to learn programming in my spare time, with the goal of releasing a single program which could be used on pretty much any platform.
Is this my best bet ?
Also Java talk thread

Attached: java.png (640x393, 134K)

it's your only option

Java is an excellent language

>Bloat the language

C# is the way to go

>bloat
Well that's what you get when you want a cross-platform-ready language running in a VM, but hey, I'm probably talking to a GentooFag compiling everything by hand because muh bloat and efficiency

Idris is your best bet.

Idris runs on:
JVM
.NET
Native
Browser
and can make use of almost any language as a target (including php!).

Do you need to mess with the complexity of java? NO
How about the pain of learning haskell? NO, Idris is much simpler and comes with better tools for learning and work.

What do you gain?
* Dependent types allow you to encode domain logic and verify it's correct without even compiling thus faster to develop with.

* Syntax extensions for those times where embedding a domain specific language makes sense.

* DSL syntax allows overriding regular Idris syntax with your domain specific language.

* Multiple codegens means you can practically run it anywhere.

There's just so much more, have a look and see idris-lang.org (check the docs for tutorials and better examples)

Takes a lot of ram and cpu but works pretty well all and all.

>67573074
Yes I just checked some benchmarks and it does seem relatively resource-hungry
However this is not a problem considering what I intend to do with it

yes learn java

shut up nigger

app : Vect n a -> Vect m a -> Vect (n + m) a
app Nil ys = ys
app (x :: xs) ys = x :: app xs ys

>this is considered a programming language

Never heard about this, I prefer staying on mainstream solutions

Python is also cross platform. But I would rather learn Java.

Use Go

Attached: 1_HkZDCVL7uUpYxOqpR5e_wg.png (650x650, 36K)

Middle tier languages like Java or C# are the best first programming language to learn.

I prefer C# to Java a bit tho, unless you don't want to be a cuckslave to Microsoft I would go with that. Otherwise Java is fine.

I don't like Microsoft since Windows 10 was released
EMBEDDED

A
D
S

Java is awful. Enjoy being a pleb in a sea of plebs.

Minecraft was coded in Java you neckbeard

Any of you have experience in Java coding ? Can a complete novice directly learn about it ? What are pros, cons etc ?

Yes I use Java professionaly. Yes, many people start with Java.
Advantages are that it's widely used, it's typed so the compiler can find some errors before you run the code and I think it helps to avoid mistakes. It's relatively fast, though not as fast as c++.

Middle tier languages like C# and Java are the best first languages to learn. From there you can either go towards more lower level programming like C and C++ and higher level stuff like JavaScript and Python without much issue.

For example I would never tell somebody to learn JavaScript as the first language.

thank you for helping me make my mind
I'll definitely learn Java for this little project
night Anons

W-w-what am I l-looking at, a-user.

Attached: 49b72b1a466e3c0725e09f634428ade0626c75004584f7bd2b541a6be41c7e1b.jpg (500x522, 37K)

If you want to learn Java learn Kotlin instead. It's pretty much Java 2.0

"Pretty much any platform" doesn't necessarily mean Java.
C and C++ are pretty good if you stick to the standard and use multiplatform libraries for advanced stuff. All platforms have compilers for them, but not all have good working JRE.
Minecraft Bedrock edition is in C++ and it is the same program that is on PC, PS, Xbox, Switch and mobile.

Java is as good as your JRE is, which may often be bad thing. Also you can't predict how would it perform because of Garbage Collector, so it's really bad for games and servers.
Example:
I2P daemon was originally in Java and someone made a i2pd version in C++, which becomes more and more popular and more suitable for home servers.

and it was shit

Attached: 1529770027854.jpg (576x512, 214K)

It was enough to be bought by Microsoft and rebuilt by a team of engineers. If you're an individual developer just use whatever you know, if your product is worth it someone will buy it. Performance is the least of your concerns

wish that I wrote this >shit
now I would be very rich

I used to be a java dev professionnally.
I really like it, it is simple to learn, has a HUGE library included, has top tier documentation, good performances and is actually multiplatform.

However, actually making a multiplatform app is not easy because of some little differences between OS, deploying is a pain because either users have to install a jvm or you have to package one (painful and os specific) and there are some limitations that extremely hard to get around like the impossibilty to make a system wide keyboard shortcut.

As a novice, I suggest that you first learn a language that is not object oriented (java is), the concept is hard to grasp at first.

I always felt that OOP is easier for beginners, because people tend to think in terms of objects. Many things in the real world can be described as objects, it's also very intuitive for gui.

> Garbage Collector
> bad for servers
Nigga what ?

>You don't have to worry about freing your memory so unless you fuck up real bad, no leaks.
>The small latency induced by GC runs while very noticeable in games is almost indetectable in most cases on a server (your 20ms average response time is 25ms this time, big deal).
>It adapts to the available ram and only run when needed.
>It is extremely efficient if objects are used during a short period, like during a transaction.
I remember some guy who wrote a video transcoder in java (some ffmpeg wrapper if I remember well) demonstrated that it was more efficient in java to allocate big ass buffers on demand then discard them rather that allocating one statically.

Most people think in term of objects but more like javascript objects (yes javascript is object oriented, shit's fucked to the bone).
Classes, inheritance (even if single like java), interfaces, constructors are hard to understand for most people.

First understand what an instruction is, what memory is, what a function is, then learn learn a low level language like C or pascal then move to java.
There is no point in going in the details of the first steps, it just lays the fundation to understand more complex stuff.

For example, java is compiled to bytecode and then interpreded / JIT'ed. If you have never run a compiler and your own compiled program, you will never understand how java works.

It's math. What's the problem?

There's a C compiler on pretty much every platform and architecture you can think of. If your goal is just portability...

Don't listen to this guy. To learn how to code this is what you have to do
>Learn basic syntax, Hello world ect
>learn what data types
>learn flow stucture, loops, if statements ECT
>Learn what classes and methods are and how everything is an object

Boom you know Java

BIG mistake

don't listen to these idiots

you wanna learn javascript + electron

WAY easier and more modern/good looking, way more portable, etc

>inb4 electron is bloat
>inb4 javascript sucks
>people who say this are NEETs and/or autistic

Is this bait?

Is this? OP didn't say what he wants to make, just that he wants it portable. C builds on fucking everything. Just avoid extensions. Now if OP had something more specific in mind and has dependencies outside the language and standard lib (e.g. GUI), then he should think about what platforms he's targeting and what languages/libraries/tools are best for the task on those platforms. But for all we know he's writing a compression tool and just wants it to be deployable on as many platforms as possible. C is great for portability.

C is fine but arguably harder to use and he already looked into Java and I think Java will be fine. C might run on more systems, but some of them are so niche that I personally don't think he had them in mind.

OP here
I'm targeting personal computers (Windows, Mac, GNU/Linux) and smartphones, maybe gaming consoles as well.

With Java you get desktops and android. Consoles not so much, but writing console games is pretty hard and I would not start with it. You can still learn C or C++ later. But as I said, C is also not that bad of a choice, still I think Java is better for the beginner. It's much easier to create something that is almost immediately at least semi useful, like a graphical interface or web stuff. I started with Java and never regretted it, but it's still just an opinion of course.

Seems like good enough for portability what I want to do

It is true.

>C# is the way to go
He wanted cross-platform. C# support on other platforms practically only exists through Mono and it isn't as seamless as Java. Microsoft is developing .NET Core but that only has console/web application support.

I'm personally a C++ fanboy and think it's a good place for a beginner to start, but like you said, he can probably produce something semi-useful in Java quicker. If he's making a game, he should think about if there is a tool/frramework

If there is a tool/framework/engine he had in mind to use, that could impact his choice as well. If just making a raw, simple game, Java is significantly less shit for doing that kind of I/O in the base language than some other languages.

For games, C# is a shit language on its own. The .NET drawing APIs were not built for that. Good language behind a game engine, though.

You are already fucked from the start. It's the same shit as laying bricks. No one learns how to lay bricks so they can lay bricks, they learn so they can build walls or a building.

You have no idea what you want to code.

>with the purpose of releasing a single program

>The .NET drawing APIs were not built for that.
This is true.

Dotnet core is basically feature complete except for a standard gui library. Just use qt or something.

>Unity doesn't exist.

Idris is extremely simple yet powerful as you can extend the language to meet your needs as shown in the example here where a simple web application is built on top.

import Control.ST
import Js.Dom

record Model where
constructor MkModel
name : String
password : String
passwordagain : String

%name Model model

model : Model
model = MkModel "" "" ""

data Msg = Name String
| Password String
| PasswordAgain String

%name Main.Msg msg

Gui : Dom m => Type
Gui {m} = DomRef {m} () (const Model) (const Msg) ()

total
update : Dom m => (dom : Var)
-> (model : Var)
-> Msg
-> ST m () [model:::State Model, dom:::Gui {m}]

update dom model msg = call $ domUpdate dom $ change
where change : Model -> Model
change = case msg of
(Name x) => record { name = x }
(Password x) => record { password = x }
(PasswordAgain x) => record { passwordagain = x }

total
validate : Model -> Html Msg
validate model =
let (color, message) = if password model == passwordagain model
then ("success", "OK")
else ("failure", "Paswords do not match")
in div [cssClass color] [ text message ]

partial
view : () -> Model -> Html Msg
view () model =
div []
[ input [ onchange Name ]
, input [ onchange Password ]
, input [ onchange PasswordAgain ]
, validate model
]

partial
loop : Dom m => (dom : Var)
-> (model : Var)
-> ST m () [model:::State Model, dom:::Gui {m}]
loop dom model = do
message ST m () []
page = do
dom

Not OP, but I'm also thinking of getting into programming and came across Kotlin being better than Java hype. My concern is getting into it as an absolute beginner with no programming knowledge whatsoever.

So, anyone have any advice on how to achieve this:


Requirements

You should have basic programming knowledge

But user, electron IS bloat and JavaScript DOES suck

t. micropajeet

t. triggered kode artisan

hurr

Stating an opponents argument doesn't invalidate it