Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 517 518 [519] 520 521 ... 795

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 818519 times)

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7770 on: September 10, 2015, 03:47:49 am »

What programming language would you suggest to learn to a novice? I study C/C++ at university and I feel genuine hatred towards it. I also had Lisp classes in the previous term which I liked much more better, but people say it has not much application these days.
So far Python is always going to be my hands-down top suggestion for a first computer language to learn. It does away with the vast majority of stupid syntax things, albeit at the expense of some of the more advanced things they let you do, and lets you focus on learning the ideas behind the code that are similar amongst all (or at least most :P) languages.

That said once you have the basics down I'd honestly suggest revisiting some of the languages like C++. Not struggling to know the ideas behind the language (and therefore just needing to remember the little syntax gotchas) makes them much more palatable, and helps you to see the things that they are good for.

I can understand your hatred towards C/C++. It seems like a world of workarounds, hacks and quick ugly fixes for awful design decisions made ages ago (like that awful compilation process).
I used to feel that way too, at least until I actually looked into the reasoning behind a lot of those "workarounds, hacks, and quick ugly fixes", which is often just a sensible choice of "cost of X for benefit of Y". Things like compiling making a lot more sense once you realize that the cost in things like debugging on the fly and time are paid back by huge increases in areas like optimization and running speed of the finished program. (If you manage to find me an interpreted language that can outperform a natively compiled language running the same code content then I'll applaud you :P).

-snip-
One thing that that comes to mind is that because you weigh your diagonals the same as your orthogonal, the actual optimal path between any two cities is going to be a diagonal line for a number of squares equal to the minimum dimension followed by a number of orthogonal ones equal to max dim - min dim (though that's more for after you've actually solved what route you want to go).

If you haven't already you might want to check out the Computing a Solution section on the wikipedia page on the problem. It has a variety of different optimizations and potential algorithms that function more efficiently than the naive one, and at this point you probably know more about the exact specifics of your problem (which can make a big difference in which implementation to select) than we do.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7771 on: September 10, 2015, 03:56:43 am »

I quit learning C++ around the time I reached the section on header guards and linking. I don't even remember what the difficulty was, I just remember being frustrated and quitting.
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7772 on: September 10, 2015, 06:24:55 am »

C# 4 lyf
Logged

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: if self.isCoder(): post() #Programming Thread
« Reply #7773 on: September 10, 2015, 06:27:39 am »

* Arx looks left, looks right.

Java for life!

* Arx ducks.

But seriously, Python's great for learning (and when you want to write a script for something quickly), C++ is great for coding for PCs, and Java's good for mobile apps. I've never used C#, but it's in the same space as C++.
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.

Antsan

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7774 on: September 10, 2015, 06:41:59 am »

I used to feel that way too, at least until I actually looked into the reasoning behind a lot of those "workarounds, hacks, and quick ugly fixes", which is often just a sensible choice of "cost of X for benefit of Y". Things like compiling making a lot more sense once you realize that the cost in things like debugging on the fly and time are paid back by huge increases in areas like optimization and running speed of the finished program. (If you manage to find me an interpreted language that can outperform a natively compiled language running the same code content then I'll applaud you :P).
False dichotomy. SBCL has a REPL (which works like you're used to from an interpreter, probably) and is a compiler with speed comparable to C/C++. I think it's within a factor of 2 in that benchmark game, but I'm not quite sure. It's been a while since I last looked and I'm too lazy to search for it now.
I have no problem with compiling itself – I have a problem with the complex way C/C++ does it.

It actually outperforms C/C++ in terms of list manipulation (which is to be expected, the name "LISt Processing" already tells us) and CL-PPCRE is an implementation of Perl regular expressions for Common Lisp outperforming Perl, which is written in C/C++ (this is because these regular expressions can first be analyzed an optimized, then transformed into Common Lisp code that can be optimized by the Common Lisp compiler. That certainly is possible in C/C++, but it isn't done, because it's a huge pain).
Logged
Taste my Paci-Fist

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7775 on: September 10, 2015, 06:42:59 am »

I've never used C#, but it's in the same space as C++

^ java for life as well, but you should really have a deeper look at c#, it's a very fine language and similar to java in many, many ways.

except java build system rocks and you can find libraries for whatever. if you don't believe me, compare creating an app on top of a distributed file system in java and c++ and then get back :P
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7776 on: September 10, 2015, 11:17:54 am »

C# is like java except it doesnt suck. :v
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7777 on: September 10, 2015, 11:21:48 am »

C# is like java except it doesnt suck. :v

thems fightin' words boi
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.

Antsan

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7778 on: September 10, 2015, 11:28:00 am »

C# is like java except it doesnt suck. :v
thems fightin' words boi
*gets out flame thrower*
As far as I can tell Java is mostly made up of boilerplate, designed by a committee of PR people excited about CS buzzwords without knowing what they actually mean or why the concepts behind these words were developed in the first place.
Logged
Taste my Paci-Fist

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7779 on: September 10, 2015, 11:43:17 am »

public static abstract final native synchronized double checkAndReturnTheValueFromTheClient()
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Gatleos

  • Bay Watcher
  • Mournhold... City of Light... City of MAGIC!
    • View Profile
    • Someone Sig This
Re: if self.isCoder(): post() #Programming Thread
« Reply #7780 on: September 10, 2015, 12:18:23 pm »

So apparently vim is the Dwarf Fortress of text editors. Is this thing worth learning, or does anybody have a suggestion for a lightweight coding-focused text editor on linux?
Logged
Think of it like Sim City, except with rival mayors that seek to destroy your citizens by arming legions of homeless people and sending them to attack you.
Quote from: Moonshadow101
it would be funny to see babies spontaneously combust
Gat HQ (Sigtext)
++U+U++ // ,.,.@UUUUUUUU

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7781 on: September 10, 2015, 12:39:13 pm »

I have no problem with compiling itself – I have a problem with the complex way C/C++ does it.
Fair enough. I wasn't totally sure which thing you were talking about from your original statement. (Though there are still a small handful of advantages to the way C/C++ compiles... just not near as many as a fair number of other languages :P).

On the topic of compiling itself I'm not sure what false dichotomy you are seeing in my statement. I'm not saying it's impossible that you can find an interpreted language faster than a compiled one, just that the speed boost granted by compilation is large enough to make it improbable. It's like if I pick a bunch of random people and ask them "pick a random number". I think we'll all agree that the vast majority of people are going to pick a low number just due to picking bias. I then divide the results into two random groups, and compare A + 200 against B. The vast majority of the time A +200 is probably going to be higher. Similarly the actual act of compilation gives enough benefits in terms of optimization and running speed with modern compilers that in many cases the benefit gained from that it is going to outweigh any particular speed benefits created by language choice if that language is not compiled. It's not impossible that you could find an interpreted language that is faster than a compiled one, just unlikely, and that benefit would most likely be limited to only handful of processes.

As for SBCL and co., what's going on there is just that you're using a language that can alter how much of the work is done through interpretation (thus allowing for easier code modification and debugging) and how much is done through compilation (for fast running speed). This allows you to perform many operations much faster than purely interpreted competitors (such as Python) and lets you determine exactly what balance between speed and dynamism you want to have (which can be a major advantage to that language).

Of course really every language is just a tool. My university even occasionally offers a course on "picking the right language for a given task", because every language has it's benefits and drawbacks, and ideally programmers should be familiar enough with as many languages as possible that they can pick the one that works best at their specific given task, instead of just whatever one they happen to be most familiar with. Even esoteric languages like Ante might hypothetically be the best choice if for some reason your need for code obfustication was so high that it outweighed the additional cost of time and debugging ease to actually write the program.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: if self.isCoder(): post() #Programming Thread
« Reply #7782 on: September 10, 2015, 12:41:22 pm »

So apparently vim is the Dwarf Fortress of text editors. Is this thing worth learning, or does anybody have a suggestion for a lightweight coding-focused text editor on linux?

I've always just used Pluma, which comes bundled with the distro I run. I'm not really a purist, though.
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.

Levi

  • Bay Watcher
  • Is a fish.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #7783 on: September 10, 2015, 01:37:17 pm »

So apparently vim is the Dwarf Fortress of text editors. Is this thing worth learning, or does anybody have a suggestion for a lightweight coding-focused text editor on linux?

Its not bad.  Its usually pre-installed on linux systems, which is handy if you need to ssh somewhere and edit something.  Its a lot different than usual text editors though, so its kind of a pain to learn.
Logged
Avid Gamer | Goldfish Enthusiast | Canadian | Professional Layabout

Arx

  • Bay Watcher
  • Iron within, iron without.
    • View Profile
    • Art!
Re: if self.isCoder(): post() #Programming Thread
« Reply #7784 on: September 10, 2015, 01:50:50 pm »

So apparently vim is the Dwarf Fortress of text editors. Is this thing worth learning, or does anybody have a suggestion for a lightweight coding-focused text editor on linux?

You will never get a consensus on this question, by the way. People are very defensive of their choice of text editors, especially with Linux.

Relevant xkcd.

But yeah. Do whatever makes you happy?
Logged

I am on Discord as Arx#2415.
Hail to the mind of man! / Fire in the sky
I've been waiting for you / On this day we die.
Pages: 1 ... 517 518 [519] 520 521 ... 795